Type alias PojoConstructorSyncAndAsyncOptions<Pojo, CtorInput>

PojoConstructorSyncAndAsyncOptions<Pojo, CtorInput>: {
    _experimental_syncAndAsyncPropsDecorators?: ((obj: PojoConstructorSyncAndAsyncProps<Pojo, CtorInput>) => PojoConstructorSyncAndAsyncProps<Pojo, CtorInput>)[];
    cacheKeyFromConstructorInput?: ((input?: CtorInput) => unknown);
    catch?: ((caught: unknown, options: PojoConstructorOptionsCatchFn) => unknown);
    concurrency?: number;
    keys?: (() => Extract<keyof Pojo, string>[]);
    name?: string;
    sortKeys?: ((keys: Extract<keyof Pojo, string>[]) => Extract<keyof Pojo, string>[]);
}

Type Parameters

  • Pojo extends object

  • CtorInput

Type declaration

  • Optional _experimental_syncAndAsyncPropsDecorators?: ((obj: PojoConstructorSyncAndAsyncProps<Pojo, CtorInput>) => PojoConstructorSyncAndAsyncProps<Pojo, CtorInput>)[]
  • Optional cacheKeyFromConstructorInput?: ((input?: CtorInput) => unknown)
      • (input?: CtorInput): unknown
      • Function that should produce a cache key from constructor input. Used by cachingProxy to only evaluate property once. Default is identity function - (x) => x

        Parameters

        • Optional input: CtorInput

        Returns unknown

  • Optional catch?: ((caught: unknown, options: PojoConstructorOptionsCatchFn) => unknown)
  • Optional concurrency?: number

    Minimum num value is 1.

    If this option is set, uses p-map to process properties in async mode. This is passed through as concurrency option of p-map lib.

  • Optional keys?: (() => Extract<keyof Pojo, string>[])
      • (): Extract<keyof Pojo, string>[]
      • A function that produces a list of string property names that should be applied to the Pojo Constructor.

        Default

        By default, {@link extractMethodKeysForPojoConstructorInstance} function is applied.<br>
        It works like this:
        - Use Object.getOwnPropertyNames on ctor
        - Keep only typeof "function" properties and exclude "constructor" property
        - Exclude keys that are not string
        - Recur for prototype of ctor

        Returns Extract<keyof Pojo, string>[]

  • Optional name?: string
  • Optional sortKeys?: ((keys: Extract<keyof Pojo, string>[]) => Extract<keyof Pojo, string>[])
      • (keys: Extract<keyof Pojo, string>[]): Extract<keyof Pojo, string>[]
      • A function that takes property names produces either by keys function or by default extractMethodKeysForPojoConstructorInstance function and returns them sorted. Property names will be processed in this order, unless concurrency option is set.

        Default

        By default, property names are sorted lexicographically.
        

        Parameters

        • keys: Extract<keyof Pojo, string>[]

        Returns Extract<keyof Pojo, string>[]

Generated using TypeDoc