UNPKG

@sprucelabs/schema

Version:

Static and dynamic binding plus runtime validation and transformation to ensure your app is sound. 🤓

18 lines (17 loc) • 828 B
import { SchemaNamedField, SchemaEntity } from './schemas.static.types'; export default abstract class AbstractEntity implements SchemaEntity { protected schema: any; get schemaId(): any; get name(): any; get namespace(): any; get version(): any; get description(): any; constructor(schema: any); abstract get(fieldName: string, options?: Record<string, any>): any; abstract set(fieldName: string, value: any, options?: Record<string, any>): this; abstract getValues(options?: Record<string, any>): Record<string, any>; abstract setValues(values: Record<string, any>): this; abstract getNamedFields(options?: Record<string, any>): SchemaNamedField<any>[]; abstract validate(options?: Record<string, any>): void; abstract isValid(options?: Record<string, any>): boolean; }