UNPKG

@stencila/schema

Version:

Extensions to schema.org to support semantic, composable, parameterize-able and executable documents

52 lines (51 loc) 1.41 kB
/** * Utility functions for runtime inspection of JSON Schemas * in this repository. * * As with the other utility modules it * avoids using non-builtin modules so that this package has * no production dependencies. */ import { JsonSchema } from '../JsonSchema'; declare let SCHEMAS: Record<string, JsonSchema>; export interface Property { /** * Name of the property */ name: string; /** * Id of the property */ id: string; /** * Types that this property exists on. * * @see https://schema.org/domainIncludes */ domainIncludes: string[]; /** * Is the property an array? */ isArray: boolean; /** * Is the property name pluralized (ends in `s`). */ isPlural: boolean; } /** * Get all Stencila Schema's JSON Schemas. */ export declare function jsonSchemas(): Promise<typeof SCHEMAS>; /** * Get all the names of all types in the Stencila Schema. */ export declare function jsonSchemaTypes(): Promise<string[]>; /** * Get all the properties in all types in the Stencila Schema. * * Returns a alphabetically sorted `Record` with information on * each property, including the types that it occurs on, * and whether or not it is an array property. */ export declare function jsonSchemaProperties(): Promise<Record<string, Property>>; export {};