SheetXL - v0.8.0-beta.9+sites.210.e2d420901
    Preparing search index...

    Interface TypedObject<P, T, C>

    TypedObject is a metadata entry that enabled traversing.

    • If a type has properties defined and is an Object then it will be traversed.
    • If a type has arrayType defined and is an Array then it will be traversed.
    interface TypedObject<P, T, C> {
        arrayType?: TypedObject<T extends E[] ? E : any, P, C>;
        getSubType?: (value: Partial<P>, original?: P) => TypedObject<P, any, C>;
        merge?: (
            update: Partial<P> | ((original: P) => T),
            original: T | undefined,
            context: C,
        ) => Partial<P> | null;
        properties?: TypedObject.Properties<Required<NonNullable<P>>, C>;
        shorthand?: (
            shorthand: string | Partial<P>,
            context: C,
        ) => Partial<P> | null | undefined;
    }

    Type Parameters

    • P
    • T
    • C
    Index
    arrayType?: TypedObject<T extends E[] ? E : any, P, C>

    If the type is an array it can have an arrayType. This should only be defined if the current TypeObject is an array. This would be the un-arrayed type

    getSubType?: (value: Partial<P>, original?: P) => TypedObject<P, any, C>

    Used for a determining a sub type based on the value.

    Type Declaration

      • (value: Partial<P>, original?: P): TypedObject<P, any, C>
      • Parameters

        • value: Partial<P>

          The value to determine the subtype for.

        • Optionaloriginal: P

          The value being updated, when there is one. A partial update need not carry enough information to identify its own subtype (e.g. { foreground: null } says nothing about whether the fill is a pattern); implementations should fall back to the original's subtype so the partial merges into it rather than replacing it.

        Returns TypedObject<P, any, C>

        Another TypedObject

    merge?: (
        update: Partial<P> | ((original: P) => T),
        original: T | undefined,
        context: C,
    ) => Partial<P> | null

    Returns a new T that is the result of merging the update into the original. If this is not defined then the default merging logic will be applied This is used for specialized updates of properties.

    properties?: TypedObject.Properties<Required<NonNullable<P>>, C>

    Define the properties that are available.

    This map is exhaustive - Required makes every key of P mandatory here, so the compiler refuses a type that forgets one. That completeness is what lets TypedObject.resolveTypedUpdates treat an undeclared key in an update as junk and drop it rather than shallow-copying it into the resolved (and then persisted) properties.

    Use TypedObject.PassThrough for a key that needs no shorthand, merge or traversal - it declares the key as known and takes its value verbatim.

    shorthand?: (
        shorthand: string | Partial<P>,
        context: C,
    ) => Partial<P> | null | undefined

    Normalizes an incoming update into this type's property shape.

    Type Declaration

      • (shorthand: string | Partial<P>, context: C): Partial<P> | null | undefined
      • Parameters

        • shorthand: string | Partial<P>
        • context: C

        Returns Partial<P> | null | undefined

        The normalized properties, null to resolve to nothing, or undefined to decline - undefined leaves the update exactly as it arrived, which is how a type opts out for the inputs it has no opinion about. The three are distinct; see TypedObject.resolveTypedUpdates.