TS-Scribe - v0.6.2
    Preparing search index...

    Type Alias DeepSet<T, P, V>

    DeepSet: P extends [] ? V : T

    Resolves the type produced by immutably setting value V at path P in T.

    Useful when you want to derive the return type of a setIn call without calling the function itself.

    Type Parameters

    • T

      Root object type.

    • P extends ReadonlyArray<string | number>

      Tuple of string / number keys describing the path.

    • V

      Type of the value to set.

    type Original = { user: { profile: { name: string } } };
    type Updated = DeepSet<Original, ['user', 'profile', 'name'], 'Alice'>;
    // { user: { profile: { name: string } } }