1 | import { Exclude } from '../Union/Exclude';
|
---|
2 | import { Match } from '../Any/_Internal';
|
---|
3 | import { Is } from '../Any/Is';
|
---|
4 | import { At } from '../Any/At';
|
---|
5 | import { Keys } from '../Any/Keys';
|
---|
6 | /**
|
---|
7 | * @hidden
|
---|
8 | */
|
---|
9 | export declare type _ExcludeMatch<O extends object, O1 extends object, match extends Match> = {
|
---|
10 | [K in keyof O]-?: {
|
---|
11 | 1: never;
|
---|
12 | 0: K;
|
---|
13 | }[Is<O[K], At<O1, K>, match>];
|
---|
14 | }[keyof O];
|
---|
15 | /**
|
---|
16 | * @hidden
|
---|
17 | */
|
---|
18 | declare type ExcludeMatch<O extends object, O1 extends object, match extends Match> = O extends unknown ? _ExcludeMatch<O, O1, match> : never;
|
---|
19 | /**
|
---|
20 | * Exclude the keys of `O1` out of the keys of `O`
|
---|
21 | * (If `match = 'default'`, no type checks are done)
|
---|
22 | * @param O to remove the keys from
|
---|
23 | * @param O1 to remove the keys out
|
---|
24 | * @param match (?=`'default'`) to change precision
|
---|
25 | * @returns [[Key]]
|
---|
26 | * @example
|
---|
27 | * ```ts
|
---|
28 | * ```
|
---|
29 | */
|
---|
30 | export declare type ExcludeKeys<O extends object, O1 extends object, match extends Match = 'default'> = {
|
---|
31 | 'default': Exclude<Keys<O>, Keys<O1>>;
|
---|
32 | 'contains->': ExcludeMatch<O, O1, 'contains->'>;
|
---|
33 | 'extends->': ExcludeMatch<O, O1, 'extends->'>;
|
---|
34 | '<-contains': ExcludeMatch<O, O1, '<-contains'>;
|
---|
35 | '<-extends': ExcludeMatch<O, O1, '<-extends'>;
|
---|
36 | 'equals': ExcludeMatch<O, O1, 'equals'>;
|
---|
37 | }[match];
|
---|
38 | export {};
|
---|