source: node_modules/ts-toolbelt/out/Object/P/Update.d.ts@ d24f17c

main
Last change on this file since d24f17c was d24f17c, checked in by Aleksandar Panovski <apano77@…>, 15 months ago

Initial commit

  • Property mode set to 100644
File size: 891 bytes
RevLine 
[d24f17c]1import { Key } from '../../Any/Key';
2import { Update as OUpdate } from '../Update';
3import { Update as LUpdate } from '../../List/Update';
4import { List } from '../../List/List';
5import { BuiltIn } from '../../Misc/BuiltIn';
6import { Tail } from '../../List/Tail';
7/**
8 * @hidden
9 */
10declare type UpdateAt<O, Path extends List<Key>, A> = O extends BuiltIn ? O : Path extends [Key] ? O extends List ? LUpdate<O, Path[0], A> : O extends object ? OUpdate<O, Path[0], A> : O : {
11 [K in keyof O]: K extends Path[0] ? UpdateAt<O[K], Tail<Path>, A> : O[K];
12};
13/**
14 * Update in `O` the fields at `Path` with `A`
15 * @param O to update
16 * @param Path to be followed
17 * @param A to update with
18 * @returns [[Object]]
19 * @example
20 * ```ts
21 * ```
22 */
23export declare type Update<O extends object, Path extends List<Key>, A extends any> = Path extends unknown ? UpdateAt<O, Path, A> : never;
24export {};
Note: See TracBrowser for help on using the repository browser.