KC's Workspace
    Preparing search index...

    Interface Record<TProps>

    interface Record<TProps extends object> {
        "[iterator]"(): IterableIterator<[keyof TProps, TProps[keyof TProps]]>;
        asImmutable(): this;
        asMutable(): this;
        clear(): this;
        delete<K extends string | number | symbol>(key: K): this;
        deleteIn(keyPath: Iterable<unknown>): this;
        equals(other: unknown): boolean;
        get<K extends string | number | symbol>(
            key: K,
            notSetValue?: unknown,
        ): TProps[K];
        get<T>(key: string, notSetValue: T): T;
        getIn(keyPath: Iterable<unknown>): unknown;
        has(key: string): key is keyof TProps & string;
        hashCode(): number;
        hasIn(keyPath: Iterable<unknown>): boolean;
        merge(
            ...collections: (
                Partial<TProps>
                | Iterable<[string, unknown], any, any>
            )[],
        ): this;
        mergeDeep(
            ...collections: (
                Partial<TProps>
                | Iterable<[string, unknown], any, any>
            )[],
        ): this;
        mergeDeepIn(keyPath: Iterable<unknown>, ...collections: unknown[]): this;
        mergeDeepWith(
            merger: (oldVal: unknown, newVal: unknown, key: unknown) => unknown,
            ...collections: (Partial<TProps> | Iterable<[string, unknown], any, any>)[],
        ): this;
        mergeIn(keyPath: Iterable<unknown>, ...collections: unknown[]): this;
        mergeWith(
            merger: (
                oldVal: unknown,
                newVal: unknown,
                key: keyof TProps,
            ) => unknown,
            ...collections: (Partial<TProps> | Iterable<[string, unknown], any, any>)[],
        ): this;
        remove<K extends string | number | symbol>(key: K): this;
        removeIn(keyPath: Iterable<unknown>): this;
        set<K extends string | number | symbol>(key: K, value: TProps[K]): this;
        setIn(keyPath: Iterable<unknown>, value: unknown): this;
        toJS(): DeepCopy<TProps>;
        toJSON(): TProps;
        toObject(): TProps;
        toSeq(): Keyed<keyof TProps, TProps[keyof TProps]>;
        update<K extends string | number | symbol>(
            key: K,
            updater: (value: TProps[K]) => TProps[K],
        ): this;
        updateIn(
            keyPath: Iterable<unknown>,
            updater: (value: unknown) => unknown,
        ): this;
        wasAltered(): boolean;
        withMutations(mutator: (mutable: this) => unknown): this;
    }

    Type Parameters

    • TProps extends object
    Index
    • Returns this

      Map#asImmutable

    • Returns this

      Map#asMutable

    • Returns a new instance of this Record type with all values set to their default values.

      Returns this

    • Returns a new instance of this Record type with the value for the specific key set to its default value.

      Type Parameters

      • K extends string | number | symbol

      Parameters

      • key: K

      Returns this

      remove

    • Parameters

      Returns this

      removeIn

    • Parameters

      • other: unknown

      Returns boolean

    • Returns the value associated with the provided key, which may be the default value defined when creating the Record factory function.

      If the requested key is not defined by this Record type, then notSetValue will be returned if provided. Note that this scenario would produce an error when using Flow or TypeScript.

      Type Parameters

      • K extends string | number | symbol

      Parameters

      • key: K
      • OptionalnotSetValue: unknown

      Returns TProps[K]

    • Type Parameters

      • T

      Parameters

      • key: string
      • notSetValue: T

      Returns T

    • Parameters

      Returns unknown

    • Parameters

      • key: string

      Returns key is keyof TProps & string

    • Returns number

    • Parameters

      Returns boolean

    • Parameters

      Returns this

    • Parameters

      Returns this

    • Parameters

      • keyPath: Iterable<unknown>
      • ...collections: unknown[]

      Returns this

    • Parameters

      • merger: (oldVal: unknown, newVal: unknown, key: unknown) => unknown
      • ...collections: (Partial<TProps> | Iterable<[string, unknown], any, any>)[]

      Returns this

    • Parameters

      • keyPath: Iterable<unknown>
      • ...collections: unknown[]

      Returns this

    • Parameters

      • merger: (oldVal: unknown, newVal: unknown, key: keyof TProps) => unknown
      • ...collections: (Partial<TProps> | Iterable<[string, unknown], any, any>)[]

      Returns this

    • Type Parameters

      • K extends string | number | symbol

      Parameters

      • key: K

      Returns this

    • Parameters

      Returns this

    • Type Parameters

      • K extends string | number | symbol

      Parameters

      Returns this

    • Parameters

      • keyPath: Iterable<unknown>
      • value: unknown

      Returns this

    • Deeply converts this Record to equivalent native JavaScript Object.

      Note: This method may not be overridden. Objects with custom serialization to plain JS may override toJSON() instead.

      Returns DeepCopy<TProps>

    • Shallowly converts this Record to equivalent native JavaScript Object.

      Returns TProps

    • Shallowly converts this Record to equivalent JavaScript Object.

      Returns TProps

    • Type Parameters

      • K extends string | number | symbol

      Parameters

      Returns this

    • Parameters

      • keyPath: Iterable<unknown>
      • updater: (value: unknown) => unknown

      Returns this

    • Returns boolean

      Map#wasAltered

    • Note: Not all methods can be used on a mutable collection or within withMutations! Only set may be used mutatively.

      Parameters

      • mutator: (mutable: this) => unknown

      Returns this

      Map#withMutations