Options
All
  • Public
  • Public/Protected
  • All
Menu

flatbed

Index

Type aliases

ClassArray

ClassArray<T>: Class<T>[]

Type parameters

  • T

ClassDict

ClassDict<T>: Record<string, Class<T>>

Type parameters

  • T

ClassMap

ClassMap<T>: Map<string, Class<T>>

Type parameters

  • T

Functions

deserialize

  • Deserializes a previously serialized object.

    Type parameters

    • Root

      The type of the object being returned.

    • C = any

      The union of the types of all classes expected to be reconstructed.

    Parameters

    • root: RootSerializedObj

      The serialized object to deserialize.

    • Optional classes: ClassArray<C>

      The classes/constructor functions to use when reconstructing serialized objects. Can be either a map, an object, or an array.

    Returns Root

  • Deserializes a previously serialized object.

    Type parameters

    • Root

      The type of the object being returned.

    • C = any

      The union of the types of all classes expected to be reconstructed.

    Parameters

    • root: RootSerializedObj

      The serialized object to deserialize.

    • Optional classDict: ClassDict<C>

      The classes/constructor functions to use when reconstructing serialized objects. Can be either a map, an object, or an array.

    Returns Root

  • Deserializes a previously serialized object.

    Type parameters

    • Root

      The type of the object being returned.

    • C = any

      The union of the types of all classes expected to be reconstructed.

    Parameters

    • root: RootSerializedObj

      The serialized object to deserialize.

    • Optional classMap: ClassMap<C>

      The classes/constructor functions to use when reconstructing serialized objects. Can be either a map, an object, or an array.

    Returns Root

  • Deserializes a previously serialized object.

    Type parameters

    • Root

      The type of the object being returned.

    • C = any

      The union of the types of all classes expected to be reconstructed.

    Parameters

    Returns Root

parse

  • parse<Root, C>(json: string, classes?: ClassArray<C>): Root
  • parse<Root, C>(json: string, classDict?: ClassDict<C>): Root
  • parse<Root, C>(json: string, classMap?: ClassMap<C>): Root
  • Deserializes a previously stringified serialized object.

    Type parameters

    • Root

      The type of the object being returned.

    • C = any

      The union of the types of all classes expected to be reconstructed.

    Parameters

    • json: string

      The stringified serialized object to deserialize.

    • Optional classes: ClassArray<C>

      The classes/constructor functions to use when reconstructing serialized objects. Can be either a map, an object, or an array.

    Returns Root

  • Deserializes a previously stringified serialized object.

    Type parameters

    • Root

      The type of the object being returned.

    • C = any

      The union of the types of all classes expected to be reconstructed.

    Parameters

    • json: string

      The stringified serialized object to deserialize.

    • Optional classDict: ClassDict<C>

      The classes/constructor functions to use when reconstructing serialized objects. Can be either a map, an object, or an array.

    Returns Root

  • Deserializes a previously stringified serialized object.

    Type parameters

    • Root

      The type of the object being returned.

    • C = any

      The union of the types of all classes expected to be reconstructed.

    Parameters

    • json: string

      The stringified serialized object to deserialize.

    • Optional classMap: ClassMap<C>

      The classes/constructor functions to use when reconstructing serialized objects. Can be either a map, an object, or an array.

    Returns Root

serialize

  • Serializes the given object into a flat, JSON-friendly structure that can be resurrected back to its original state with deserialize.

    Parameters

    • obj: AnyObj

      The object to serialize.

    Returns RootSerializedObj

stringify

  • stringify(obj: AnyObj): string
  • Serializes the given object into a a string representing a flat JSON structure that can be resurrected back to its original state with flatbed.parse(x) or flatbed.deserialize(JSON.parse(x)).

    Parameters

    • obj: AnyObj

      The object to serialize.

    Returns string

Generated using TypeDoc