@stencila/jesta
Version:
Stencila plugin for executable documents using JavaScript
28 lines (27 loc) • 1.11 kB
TypeScript
import * as schema from '@stencila/schema';
import { JsonSchema } from '@stencila/schema';
import { DataValidationCxt } from 'ajv/dist/types';
import { Jesta } from '.';
import { MethodSchema } from './manifest';
export declare const methodSchema: MethodSchema;
export declare function validate(this: Jesta, node: schema.Node, force?: boolean): Promise<schema.Node>;
export declare namespace validate {
var schema: MethodSchema;
}
/**
* Get the default value for a JSON schema type
*
* @param type The JSON Schema type
* @returns A default value for the type
*/
export declare function defaultForType(type: JsonSchema['type']): unknown;
/**
* Parse a string value
*
* Used for the custom `parser` JSON Schema keyword.
*/
export declare function parse(schema: string, data: string, parentSchema?: unknown, dataCxt?: DataValidationCxt): boolean;
export declare const parseCsi: (data: string) => string[];
export declare const parseSsi: (data: string) => string[];
export declare const parseDate: (data: string) => schema.Date;
export declare const parsePerson: (data: string) => schema.Person;