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:
705 bytes
|
Line | |
---|
1 | import { Extends } from './Extends';
|
---|
2 | /**
|
---|
3 | * Check whether `A1` is part of `A2` or not. It works like
|
---|
4 | * [[Extends]] but [[Boolean]] results are narrowed to [[False]].
|
---|
5 | * @param A1
|
---|
6 | * @param A2
|
---|
7 | * @returns [[Boolean]]
|
---|
8 | * @example
|
---|
9 | * ```ts
|
---|
10 | * type test0 = A.Contains<'a' | 'b', 'b'> // False
|
---|
11 | * type test1 = A.Contains<'a', 'a' | 'b'> // True
|
---|
12 | *
|
---|
13 | * type test2 = A.Contains<{a: string}, {a: string, b: number}> // False
|
---|
14 | * type test3 = A.Contains<{a: string, b: number}, {a: string}> // True
|
---|
15 | *
|
---|
16 | * type test4 = A.Contains<never, never> // False
|
---|
17 | * /// Nothing cannot contain nothing, use `A.Equals`
|
---|
18 | * ```
|
---|
19 | */
|
---|
20 | export declare type Contains<A1 extends any, A2 extends any> = Extends<A1, A2> extends 1 ? 1 : 0;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.