@croct/content-model
Version:
A library for modeling, validating and interpolating structured content.
46 lines (45 loc) • 1.36 kB
TypeScript
import { JSONSchema } from 'json-schema-typed/draft-2020-12';
import { TemplateDefinition } from '../definition';
/**
* A rich text definition template.
*/
export declare const richTextTemplate: TemplateDefinition<'richText'>;
/**
* A schema for validating the properties of a rich text definition template.
*/
export declare const richTextSchema: JSONSchema.Object;
/**
* The options for the rich text schema.
*/
export type RichTextSchemaOptions = {
/**
* The list of allowed formats.
*/
allowedFormats?: string[];
};
/**
* Creates a schema for validating the properties of a rich text definition template.
*
* @param options The options for the schema.
*/
export declare function createRichTextSchema(options?: RichTextSchemaOptions): JSONSchema.Object;
declare module '../definition' {
interface LogicalDefinitionMap {
/**
* A rich text, represented as a string in a specific format, such as HTML or Markdown.
*
* It is distinct from a regular text in how it is interpreted and
* displayed by the user interface.
*/
richText: {
/**
* The underlying type.
*/
type: 'text';
/**
* The format in which the text is represented.
*/
format: 'string';
};
}
}