Options
All
  • Public
  • Public/Protected
  • All
Menu

Type parameters

Hierarchy

Index

Properties

customSerialization?: { fromJSON: any; toJSON: any }

Custom conversion to and from JSON

Type declaration

  • fromJSON:function
    • fromJSON(data: any): P
    • Parameters

      • data: any

      Returns P

  • toJSON:function
    • toJSON(params: P, obj?: B): any
    • Parameters

      • params: P
      • Optional obj: B

      Returns any

display: { description?: string; name: string }

Type declaration

  • Optional Readonly description?: string
  • Readonly name: string
isDecorator?: boolean

Decorators are special Transformers mapping the object to the same type.

Special rules apply:

  • applying decorator always "inserts" it instead
  • applying to a decorated Transform is applied to the decorator instead (transitive)
name: string

Methods

  • Apply the actual transformation. It must be pure (i.e. with no side effects). Returns a task that produces the result of the result directly.

    Parameters

    Returns B | Task<B>

  • Determine if the transformer can be applied automatically on UI change. Default is false.

    Parameters

    Returns boolean

  • Cleanup resources

    Automatically called on deleting an object and on recreating it (i.e. when update returns UpdateResult.Recreate or UpdateResult.Null)

    Not called on UpdateResult.Updated because the resources might not have been invalidated. In this case, the possible cleanup has to be handled manually.

    Parameters

    Returns void

  • interpolate(src: P, target: P, t: number, globalCtx: unknown): P
  • Parameter interpolation

    Parameters

    • src: P
    • target: P
    • t: number
    • globalCtx: unknown

    Returns P

  • isApplicable(a: A, globalCtx: unknown): boolean
  • Test if the transform can be applied to a given node

    Parameters

    • a: A
    • globalCtx: unknown

    Returns boolean

  • isSerializable(params: P): { isSerializable: true } | { isSerializable: false; reason: string }
  • By default, returns true

    Parameters

    • params: P

    Returns { isSerializable: true } | { isSerializable: false; reason: string }

  • params(a: undefined | A, globalCtx: unknown): { [ K in string | number | symbol]: <internal>.Any }
  • Parameters

    • a: undefined | A
    • globalCtx: unknown

    Returns { [ K in string | number | symbol]: <internal>.Any }

  • Attempts to update the entity in a non-destructive way. For example changing a color scheme of a visual does not require computing new geometry. Return/resolve to undefined if the update is not possible.

    Parameters

    Returns UpdateResult | Task<UpdateResult>

Generated using TypeDoc