UNPKG

@atlaskit/adf-schema

Version:

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

32 lines (31 loc) 939 B
import { NodeSpec, Node as PMNode } from 'prosemirror-model'; import { TextDefinition as Text } from './text'; import { BreakoutMarkDefinition } from '../marks/breakout'; import { MarksObject, NoMark } from './types/mark'; /** * @name codeBlock_node */ export declare type CodeBlockBaseDefinition = { type: 'codeBlock'; /** * @allowUnsupportedInline true */ content?: Array<Text & NoMark>; marks?: Array<any>; attrs?: CodeBlockAttrs; }; export declare type CodeBlockAttrs = { language?: string; }; /** * @name codeBlock_with_no_marks_node */ export declare type CodeBlockDefinition = CodeBlockBaseDefinition & NoMark; /** * @name codeBlock_with_marks_node */ export declare type CodeBlockWithMarksDefinition = CodeBlockBaseDefinition & MarksObject<BreakoutMarkDefinition>; export declare const codeBlock: NodeSpec; export declare const toJSON: (node: PMNode) => { attrs: Record<string, any>; };