Function makeOverrideCollection

  • Type Parameters

    Parameters

    • collection: C
    • getDynamicModuleId: (() => string)

      function to get the current dynamic module id

        • (): string
        • Returns string

    • Optional serializeItem: ((item) => object & {
          [moduleIdSymbol]?: string;
      })

      optional function to serialize an item, defaults to returning item.toJSON or item: i => (i.toJSON || i)

        • (item): object & {
              [moduleIdSymbol]?: string;
          }
        • Parameters

          • item: T

          Returns object & {
              [moduleIdSymbol]?: string;
          }

    • Optional deserializeItem: ((item) => null | T | Promise<T>)

      optional deserialization function. defaults to returning the passed object: i => i

        • (item): null | T | Promise<T>
        • Parameters

          • item: object

          Returns null | T | Promise<T>

    • Optional ctor: (new (...args) => T)

      optional constructor to validate deserialized items against. if passed, deserializeItem must be an instance of ctor.

        • new (...args): T
        • Parameters

          • Rest ...args: any[]

          Returns T

    • Optional determineShadowIndex: ((item, shadow?, index?) => undefined | null | number)

      return the index where a shadow should be inserted. only has relevance, if the collection is indexed. previous and current index may be null.

        • (item, shadow?, index?): undefined | null | number
        • Parameters

          • item: T
          • Optional shadow: T
          • Optional index: number

          Returns undefined | null | number

    Returns OverrideCollection<T, C>

Generated using TypeDoc