Home > @skunkteam/types > SimpleType > create
Create a simple (limited) type implementation.
Signature:
static create<ResultType>(name: string, basicType: BasicType | 'mixed', simpleValidator: (input: unknown, options: ValidationOptions, type: SimpleType<ResultType, undefined>) => ValidationResult, options?: Omit<SimpleTypeOptions<ResultType, undefined>, 'typeConfig'>): Type<ResultType, undefined>;
Parameter | Type | Description |
---|---|---|
name | string | the name for the Type |
basicType | BasicType | 'mixed' | the fixed basic type of the Type |
simpleValidator | (input: unknown, options: ValidationOptions, type: SimpleType<ResultType, undefined>) => ValidationResult | validation logic |
options | Omit<SimpleTypeOptions<ResultType, undefined>, 'typeConfig'> | (Optional) some optional features of BaseTypeImpl |
Returns:
Type<ResultType, undefined>