import type { JSONSchema7, JSONSchema7Definition, JSONSchema7Type, JSONSchema7TypeName } from "json-schema"; export type ElementSchema = { description?: string; /** The element's attributes, an object's JSON schema: each of its properties an attribute, those it requires the attributes it must have */ props?: JSONSchema7; allowedChildren?: Array; }; export type ArgumentSchema = { name: string; description?: string; schema: JSONSchema7Definition; }; /** A function's arguments and return value, whose $refs refer to the data's $defs */ export type FunctionSchema = { description?: string; args?: ReadonlyArray; ret: JSONSchema7Definition; }; export type Schema = { /** The data's JSON schema, an object's: each of its properties a variable an expression can read, its $defs what $refs in it refer to */ data?: JSONSchema7; elements?: Record; functions?: Record; /** The element a template must return, like an image's canvas, if any */ root?: string; }; /** The names of the variables the data has */ export declare function getDataKeys(schema: Schema): ReadonlyArray; export declare function isElementAllowed(schema: Schema, tagName: string): boolean; export declare function getElementSchema(schema: Schema, tagName: string): ElementSchema | undefined; export declare function getAllowedAttributes(schema: Schema, tagName: string): ReadonlyArray; export declare function isAttributeAllowed(schema: Schema, tagName: string, attributeName: string): boolean; export declare function getAllowedChildren(schema: Schema, tagName: string): Array | undefined; export declare function canHaveChildren(schema: Schema, tagName: string): boolean; export declare function isSelfClosing(schema: Schema, tagName: string): boolean; export declare function isChildAllowed(schema: Schema, parentTag: string, childTag: string): boolean; export declare function getAllElements(schema: Schema): Array; export declare function getRequiredAttributes(schema: Schema, tagName: string): ReadonlyArray; /** The values an attribute allows, if its schema lists them */ export declare function getAttributeEnumValues(schema: Schema, tagName: string, attributeName: string): ReadonlyArray | undefined; /** The types an attribute's value can have, none if it can have any */ export declare function getAttributeTypes(schema: Schema, tagName: string, attributeName: string): ReadonlySet; /** A value's JSON Schema type, or its JavaScript type if it has none, like a function's */ export declare function typeOf(value: unknown): string; /** Whether a value has one of the types, any if there are none, an integer being a whole number */ export declare function isOfTypes(value: unknown, valueTypes: ReadonlySet): boolean; //# sourceMappingURL=schema.d.ts.map