import { JSONArray, JSONObject, searchJSON } from "../../lib/JSONSearch/jsonSearch.ts"; export interface ISchema { name: string; accolades: any; // TODO - populate with accolades schema type publicationRules: { name: string; isExtensible: boolean; // overwrites: boolean; canExtend: boolean; reviewRequired: boolean; corrections: { reviewRequired: boolean; preserveHistory: boolean; } }[] allowsListBuilding: boolean; listBuildingRules: any; // TODO - populate with list building rules schema type schemaProperties: Record; } // export type searchString = `${/[a-z]/i}` export class GameSystemSchema implements ISchema { name: string; accolades: any; publicationRules: { name: string; isExtensible: boolean; // overwrites: boolean; canExtend: boolean; reviewRequired: boolean; corrections: { reviewRequired: boolean; preserveHistory: boolean; }; }[]; allowsListBuilding: boolean; listBuildingRules: any; schemaProperties: Record; constructor(schemaJson: ISchema) { this.name = schemaJson.name; this.accolades = schemaJson.accolades; this.publicationRules = schemaJson.publicationRules; this.allowsListBuilding = schemaJson.allowsListBuilding; this.listBuildingRules = schemaJson.listBuildingRules; this.schemaProperties = schemaJson.schemaProperties; } search(search: string, values: T) { return searchJSON(values, search); } }