Options
All
  • Public
  • Public/Protected
  • All
Menu

ArtSerializer serializes and deseriales Collboard arts and other objects

  • Serializer is generic serializer which can work with any rules; it works synchronously
  • Serializer with basic rules is Serializer which has registered basic rules; it works synchronously
  • ArtSerializer serializes and deseriales Collboard arts and other objects; it works asynchronously
collboard-system

Hierarchy

  • AbstractSystem
    • ArtSerializer

Implements

  • ISerializer<ICollboardSerializable>

Index

Constructors

  • Parameters

    • systems: ISystemsExtended

    Returns ArtSerializer

Properties

ready: Promise<void>

Promise which is resolved when the system is initialized and ready to use.

serializer: any
@x

Using composition over inheritance patern

systems: ISystemsExtended

Accessors

  • get isDestroyed(): boolean
  • Is this object destroyed?

    Returns boolean

  • get isReady(): boolean
  • Checks if the system is initialized and ready to use.

    Returns boolean

Methods

  • addSubdestroyable(...subdestroyable: ITeardownLogic[]): ArtSerializer
  • Binds new registration with itself. This registration/destroyable will be destroyed with this.

    Parameters

    • Rest ...subdestroyable: ITeardownLogic[]

    Returns ArtSerializer

  • checkIsReady(): void
  • Checks if the system is initialized and ready to use. If not, throws an error. If it is, do nothing.

    Returns void

  • checkWhetherNotDestroyed(errorMessage?: string, runBeforeError?: () => void): void
  • Checks, whether the object is not destroyed

    Parameters

    • Optional errorMessage: string

      Message that will replace default one before error

    • Optional runBeforeError: () => void

      Callback runed before error is thrown; typically this can be some logging

        • (): void
        • Returns void

    Returns void

  • deserialize(serialized: JsonValue): Promise<ICollboardSerializable>
  • @x

    copy from serializer

    Parameters

    • serialized: JsonValue

    Returns Promise<ICollboardSerializable>

  • deserializeWithRecursionProtection(serialized: JsonValue, errors: DeserializationError[]): Promise<ICollboardSerializable>
  • @x

    copy from serializer

    Parameters

    • serialized: JsonValue
    • errors: DeserializationError[]

    Returns Promise<ICollboardSerializable>

  • destroy(): Promise<void>
  • Returns Promise<void>

  • init(): Promise<void>
  • Returns Promise<void>

  • registerRule(...rules: ISerializerRule[]): Registration
  • @x

    copy from serializer

    Parameters

    • Rest ...rules: ISerializerRule[]

    Returns Registration

  • serialize(value: ICollboardSerializable): Promise<JsonValue>
  • @x

    copy from serializer

    Parameters

    • value: ICollboardSerializable

    Returns Promise<JsonValue>

  • serializeWithRecursionProtection(value: ICollboardSerializable, errors: SerializationError[]): Promise<JsonValue>
  • @x

    copy from serializer

    Parameters

    • value: ICollboardSerializable
    • errors: SerializationError[]

    Returns Promise<JsonValue>

  • isDestroyable(obj: any): obj is IDestroyable
  • Chcek whether the given object is destroyable

    Parameters

    • obj: any

    Returns obj is IDestroyable