Home > @websublime/schema > BaseSchemaType
BaseSchemaType class
Base type model validation
Signature:
export declare class BaseSchemaType<T = any>
Constructors
| Constructor | Modifiers | Description |
|---|---|---|
| (constructor)(st) | Create mixed type instance |
Properties
| Property | Modifiers | Type | Description |
|---|---|---|---|
| items? | unknown | (Optional) schema for ArraySchemaType items | |
| properties? | unknown | (Optional) Object with the schema for ObjectSchemaType | |
| required | boolean | Required property | |
| requiredErrorMessage | string | Required error message property | |
| rules | Rule[] | Validation rules | |
| schemaType | schemaType | Type name | |
| trim | boolean | Trims string | |
| type | string |
Methods
| Method | Modifiers | Description |
|---|---|---|
| addRule({ errorMessage, params, validationFn }) | Add validation rule. | |
| check(value, parent, context) | Test value types | |
| isEmpty(value) | Validate if value is empty | |
| isRequired(errorMessage, trim) | Sign as require property |