@atlaskit/adf-schema
Version:
Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs
28 lines (27 loc) • 927 B
TypeScript
import type { NodeSpec, MarkSpec } from '@atlaskit/editor-prosemirror/model';
import { Schema } from '@atlaskit/editor-prosemirror/model';
export declare function getNodesAndMarksMap(): {
nodes: Record<string, NodeSpec>;
marks: Record<string, MarkSpec>;
};
/**
* 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 interface SchemaConfig<N = string, M = string> {
customMarkSpecs?: SchemaCustomMarkSpecs;
customNodeSpecs?: SchemaCustomNodeSpecs;
marks?: M[];
nodes: N[];
}
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;