Nutrient Web SDK

Function Map

Create a new immutable Map containing the entries of the provided collection-like or object.

Note: Map is a factory function and not a class, and does not use the new keyword during construction.

Function
Type Signature
Map<K, V>(
    collection?: Iterable<readonly [K, V], any, any>,
): NutrientViewer.Immutable.Map<K, V>
Map<T>(
    collection: NutrientViewer.Immutable.List<Iterable<T, any, any>>,
): NutrientViewer.Immutable.Map<T, T>
Map<R extends { [key: string]: unknown }>(
    obj: R & (string extends keyof R ? unknown : never),
): NutrientViewer.Immutable.Map<string, R[string]>
Map<
    R extends
        {
            [key: string]: unknown;
            [key: number]: unknown;
            [key: symbol]: unknown;
        },
>(
    obj: R,
): MapOf<R>
Map<V>(obj: { [key: string]: V }): NutrientViewer.Immutable.Map<string, V>
Map<K extends string | symbol, V>(
    obj: { [P in string | symbol]?: V },
): NutrientViewer.Immutable.Map<K, V>
  • Type Declaration

    Type Parameters

    K
    V

    Parameters

    collectionIterable<readonly [K, V], any, any>
    Optional
  • Create a new immutable Map containing the entries of the provided collection-like or object.

    Note: Map is a factory function and not a class, and does not use the new keyword during construction.

    Type Declaration

    Type Parameters

    T

    Parameters

    collectionNutrientViewer.Immutable.List<Iterable<T, any, any>>
  • Create a new immutable Map from an object typed with a string index signature, such as Record<string, V>, keyed by its string keys.

    Type Declaration

    Type Parameters

    Rextends { [key: string]: unknown }

    Parameters

    objR & (string extends keyof R ? unknown : never)

    Returns

    NutrientViewer.Immutable.Map<string, R[string]>
  • Create a new immutable Map containing the entries of the provided collection-like or object.

    Note: Map is a factory function and not a class, and does not use the new keyword during construction.

    Type Declaration

    Type Parameters

    Rextends { [key: string]: unknown; [key: number]: unknown; [key: symbol]: unknown }

    Parameters

    objR

    Returns

    MapOf<R>
  • Create a new immutable Map containing the entries of the provided collection-like or object.

    Note: Map is a factory function and not a class, and does not use the new keyword during construction.

    Type Declaration

    Type Parameters

    V

    Parameters

    obj{ [key: string]: V }

    Returns

  • Create a new immutable Map containing the entries of the provided collection-like or object.

    Note: Map is a factory function and not a class, and does not use the new keyword during construction.

    Type Declaration

    Type Parameters

    Kextends string | symbol
    V

    Parameters

    obj{ [P in string | symbol]?: V }