UNPKG

@atlaskit/adf-schema

Version:

Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs

33 lines (32 loc) 1.01 kB
import { NodeSpec, MarkSpec, Schema } from 'prosemirror-model'; /** * Creates a schema preserving order of marks and nodes. */ export declare function createSchema<N extends string = string, M extends string = string>(config: SchemaConfig<N, M>): Schema<N, M>; export declare function sanitizeNodes(nodes: { [key: string]: NodeSpec; }, supportedMarks: { [key: string]: MarkSpec; }): { [key: string]: NodeSpec; }; export declare function sanitizeNodeSpecContent(nodes: { [key: string]: NodeSpec; }, rawContent: string): string; export interface SchemaConfig<N = string, M = string> { nodes: N[]; customNodeSpecs?: SchemaCustomNodeSpecs; marks?: M[]; customMarkSpecs?: SchemaCustomMarkSpecs; } export interface SchemaBuiltInItem { name: string; spec: NodeSpec | MarkSpec; } export interface SchemaCustomNodeSpecs { [name: string]: NodeSpec; } export interface SchemaCustomMarkSpecs { [name: string]: MarkSpec; } export declare const allowCustomPanel: boolean;