diff --git a/metaschema.d.ts b/metaschema.d.ts index 5250a8d..0ca12ca 100644 --- a/metaschema.d.ts +++ b/metaschema.d.ts @@ -39,39 +39,39 @@ export class Schema { static STORE: Array; static ALLOW: Array; - static from(raw: object, namespaces?: Array): Schema; + public static from(raw: object, namespaces?: Array): Schema; static extractSchema(def: object): Schema | null; root: null; - kind: Kind; - references: Set; - relations: Set; - scope: Scope; - allow: Allow; - parent: string; - indexes: object; + public kind: Kind; + public references: Set; + public relations: Set; + public scope: Scope; + public allow: Allow; + public parent: string; + public indexes: object; options: { validate: Function | null; format: Function | null; parse: Function | null; serialize: Function | null; }; - custom: object; - fields: object; - name: string; - namespaces: Set; + public custom: object; // custom metadata + public fields: object; + public name: string; + public namespaces: Set; constructor(name: string, raw: object, namespaces?: Array); - get types(): object; - checkConsistency(): Array; + public get types(): object; + public checkConsistency(): Array; findReference(name: string): Schema; - check(value: any): SchemaError; - toInterface(): string; + public check(value: any): SchemaError; + public toInterface(): string; attach(...namespaces: Array): void; detouch(...namespaces: Array): void; - toString(): string; - toJSON(): object; - validate(value: any, path: string): SchemaError; + public toString(): string; + public toJSON(): object; + public validate(value: any, path: string): SchemaError; } export function createSchema(name: string, src: string): Schema; @@ -84,14 +84,14 @@ export function loadModel( export function saveTypes(outputFile: string, model: Model): Promise; export class Model { - types: object; - entities: Map; - database: object; + public types: object; + public entities: Map; + public database: object; order: Set; - warnings: Array; + public warnings: Array; constructor(types: object, entities: Map, database?: object); - preprocess(): void; + public preprocess(): void; reorderEntity(name: string, base?: string): void; - get dts(): string; + public get dts(): string; } diff --git a/test/collections.js b/test/collections.js index c19f7c0..e74861a 100644 --- a/test/collections.js +++ b/test/collections.js @@ -193,7 +193,8 @@ metatests.test('Collections: check value with long form', (test) => { metatests.test('Collections: multiple nested arrays', (test) => { const defs1 = { - Entity: {}, + Struct: {}, + name: { first: { type: 'string' }, last: { type: 'string' },