File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1338,6 +1338,31 @@ type Record<K extends string, T> = {
13381338 [ P in K ] : T ;
13391339} ;
13401340
1341+ /**
1342+ * Exclude from T those types that are assignable to U
1343+ */
1344+ type Exclude < T , U > = T extends U ? never : T ;
1345+
1346+ /**
1347+ * Extract from T those types that are assignable to U
1348+ */
1349+ type Extract < T , U > = T extends U ? T : never ;
1350+
1351+ /**
1352+ * Exclude null and undefined from T
1353+ */
1354+ type NonNullable < T > = T extends null | undefined ? never : T ;
1355+
1356+ /**
1357+ * Obtain the return type of a function type
1358+ */
1359+ type ReturnType < T extends ( ...args : any [ ] ) => any > = T extends ( ...args : any [ ] ) => infer R ? R : any ;
1360+
1361+ /**
1362+ * Obtain the return type of a constructor function type
1363+ */
1364+ type InstanceType < T extends new ( ...args : any [ ] ) => any > = T extends new ( ...args : any [ ] ) => infer R ? R : any ;
1365+
13411366/**
13421367 * Marker for contextual 'this' type
13431368 */
You can’t perform that action at this time.
0 commit comments