| 11 | /* eslint-disable @typescript-eslint/no-explicit-any */ |
| 12 | |
| 13 | export interface Type<T> { |
| 14 | /** |
| 15 | * Name of the type |
| 16 | */ |
| 17 | name: string; |
| 18 | |
| 19 | /** |
| 20 | * Test if the given value is an instance of this type |
| 21 | * @param value - The value |
| 22 | */ |
| 23 | isInstance(value: any): boolean; |
| 24 | |
| 25 | /** |
| 26 | * Generate the default value for this type |
| 27 | */ |
| 28 | defaultValue(): T | null | undefined; |
| 29 | |
| 30 | /** |
| 31 | * Check if the given value can be coerced into this type |
| 32 | * @param value - The value to to be coerced |
| 33 | * @returns A flag to indicate if the value can be coerced |
| 34 | */ |
| 35 | isCoercible(value: any, options?: Options): boolean; |
| 36 | |
| 37 | /** |
| 38 | * Coerce the value into this type |
| 39 | * @param value - The value to be coerced |
| 40 | * @param options - Options for coercion |
| 41 | * @returns Coerced value of this type |
| 42 | */ |
| 43 | coerce(value: any, options?: Options): T | null | undefined; |
| 44 | |
| 45 | /** |
| 46 | * Serialize a value into json |
| 47 | * @param value - The value of this type |
| 48 | * @param options - Options for serialization |
| 49 | */ |
| 50 | serialize(value: T | null | undefined, options?: Options): any; |
| 51 | } |
no outgoing calls
no test coverage detected