@atlaskit/adf-schema
Version:
Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs
44 lines (43 loc) • 1.47 kB
TypeScript
import { AlignmentMarkDefinition, IndentationMarkDefinition } from '../marks';
import { MarksObject, NoMark } from './types/mark';
import { Inline } from './types/inline-content';
export interface ParagraphAttributes {
/**
* An optional UUID for unique identification of the node
*/
localId?: string;
}
/**
* @name paragraph_node
*/
export interface ParagraphBaseDefinition {
type: 'paragraph';
/**
* @allowUnsupportedInline true
*/
content?: Array<Inline>;
attrs?: ParagraphAttributes;
marks?: Array<any>;
}
/**
* @name paragraph_with_no_marks_node
*/
export type ParagraphDefinition = ParagraphBaseDefinition & NoMark;
/**
* NOTE: Need this because TS is too smart and inline everything.
* So we need to give them separate identity.
* Probably there's a way to solve it but that will need time and exploration.
* // http://bit.ly/2raXFX5
* type T1 = X | Y
* type T2 = A | T1 | B // T2 = A | X | Y | B
*/
/**
* @name paragraph_with_alignment_node
*/
export type ParagraphWithAlignmentDefinition = ParagraphBaseDefinition & MarksObject<AlignmentMarkDefinition>;
/**
* @name paragraph_with_indentation_node
*/
export type ParagraphWithIndentationDefinition = ParagraphBaseDefinition & MarksObject<IndentationMarkDefinition>;
export type ParagraphWithMarksDefinition = ParagraphWithAlignmentDefinition | ParagraphWithIndentationDefinition;
export declare const paragraph: import("prosemirror-model").NodeSpec;