source: node_modules/ts-toolbelt/out/Object/IntersectKeys.d.ts

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

Initial commit

  • Property mode set to 100644
File size: 1.2 KB
Line 
1import { Match } from '../Any/_Internal';
2import { Is } from '../Any/Is';
3import { At } from '../Any/At';
4import { Keys } from '../Any/Keys';
5/**
6 * @hidden
7 */
8export declare type _IntersectMatch<O extends object, O1 extends object, match extends Match> = {
9 [K in keyof O]-?: {
10 1: K;
11 0: never;
12 }[Is<O[K], At<O1, K>, match>];
13}[keyof O];
14/**
15 * @hidden
16 */
17declare type IntersectMatch<O extends object, O1 extends object, match extends Match> = O extends unknown ? _IntersectMatch<O, O1, match> : never;
18/**
19 * Get the intersecting keys of `O` & `O1`
20 * (If `match = 'default'`, no type checks are done)
21 * @param O to check similarities with
22 * @param O1 to check similarities against
23 * @returns [[Key]]
24 * @example
25 * ```ts
26 * ```
27 */
28export declare type IntersectKeys<O extends object, O1 extends object, match extends Match = 'default'> = {
29 'default': Keys<O> & Keys<O1>;
30 'contains->': IntersectMatch<O, O1, 'contains->'>;
31 'extends->': IntersectMatch<O, O1, 'extends->'>;
32 '<-contains': IntersectMatch<O, O1, '<-contains'>;
33 '<-extends': IntersectMatch<O, O1, '<-extends'>;
34 'equals': IntersectMatch<O, O1, 'equals'>;
35}[match];
36export {};
Note: See TracBrowser for help on using the repository browser.