UNPKG

939 BTypeScriptView Raw
1import { NodeSpec, Node as PMNode } from 'prosemirror-model';
2import { TextDefinition as Text } from './text';
3import { BreakoutMarkDefinition } from '../marks/breakout';
4import { MarksObject, NoMark } from './types/mark';
5/**
6 * @name codeBlock_node
7 */
8export declare type CodeBlockBaseDefinition = {
9 type: 'codeBlock';
10 /**
11 * @allowUnsupportedInline true
12 */
13 content?: Array<Text & NoMark>;
14 marks?: Array<any>;
15 attrs?: CodeBlockAttrs;
16};
17export declare type CodeBlockAttrs = {
18 language?: string;
19};
20/**
21 * @name codeBlock_with_no_marks_node
22 */
23export declare type CodeBlockDefinition = CodeBlockBaseDefinition & NoMark;
24/**
25 * @name codeBlock_with_marks_node
26 */
27export declare type CodeBlockWithMarksDefinition = CodeBlockBaseDefinition & MarksObject<BreakoutMarkDefinition>;
28export declare const codeBlock: NodeSpec;
29export declare const toJSON: (node: PMNode) => {
30 attrs: Record<string, any>;
31};