source: node_modules/ts-toolbelt/out/Object/P/Pick.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: 832 bytes
Line 
1import { Key } from '../../Any/Key';
2import { _Pick as _OPick } from '../Pick';
3import { List } from '../../List/List';
4import { Tail } from '../../List/Tail';
5import { BuiltIn } from '../../Misc/BuiltIn';
6import { _ListOf } from '../ListOf';
7/**
8 * @hidden
9 */
10declare type PickAt<O, Path extends List<Key>> = [
11] extends Path ? O : O extends BuiltIn ? O : O extends List ? _ListOf<{
12 [K in keyof _OPick<O, Path[0]>]: PickAt<O[K], Tail<Path>>;
13}> : O extends object ? {
14 [K in keyof _OPick<O, Path[0]>]: PickAt<O[K], Tail<Path>>;
15} : O;
16/**
17 * Extract out of `O` the fields at `Path`
18 * @param O to extract from
19 * @param Path to be followed
20 * @returns [[Object]]
21 * @example
22 * ```ts
23 * ```
24 */
25export declare type Pick<O extends object, Path extends List<Key>> = Path extends unknown ? PickAt<O, Path> : never;
26export {};
Note: See TracBrowser for help on using the repository browser.