Type Alias: ExtractType<T>
typescript
1
ExtractType<T> = T extends "string" ? string : T extends "number" ? number : T extends "boolean" ? boolean : T extends "object" ? object : T extends "array" ? any[] : undefined
Defined in: ridb_core.d.ts:104
ExtractType is a utility type that maps a string representing a basic data type to the actual TypeScript type.
Type Parameters
T
T
extends string
A string literal type representing the basic data type ('string', 'number', 'boolean', 'object', 'array').
Example
ts12345type StringType = ExtractType<'string'>; // StringType is stringtype NumberType = ExtractType<'number'>; // NumberType is numbertype BooleanType = ExtractType<'boolean'>; // BooleanType is booleantype ObjectType = ExtractType<'object'>; // ObjectType is objecttype ArrayType = ExtractType<'array'>; // ArrayType is Array<any>