@atlaskit/adf-schema
Version:
Shared package that contains the ADF-schema (json) and ProseMirror node/mark specs
37 lines (36 loc) • 1.25 kB
TypeScript
import type { NodeSpec, Node as PMNode, Attrs } from '@atlaskit/editor-prosemirror/model';
import type { BreakoutMarkDefinition } from '../marks';
import type { MarksObject, NoMark } from './types/mark';
import type { NonNestableBlockContent } from './types/non-nestable-block-content';
import type { NestedExpandDefinition } from './nested-expand';
/**
* @name expand_node
*/
export interface ExpandBaseDefinition {
attrs: {
__expanded?: boolean;
localId?: string;
title?: string;
};
/**
// eslint-disable-next-line eslint-plugin-jsdoc/check-tag-names
* @minItems 1
// eslint-disable-next-line eslint-plugin-jsdoc/check-tag-names
* @allowUnsupportedBlock true
*/
content: Array<NonNestableBlockContent | NestedExpandDefinition>;
type: 'expand';
}
/**
* @name expand_with_no_mark_node
*/
export type ExpandDefinition = ExpandBaseDefinition & NoMark;
/**
* @name expand_root_only_node
*/
export type ExpandRootOnlyDefinition = ExpandBaseDefinition & MarksObject<BreakoutMarkDefinition>;
export declare const expandWithNestedExpand: NodeSpec;
export declare const expandWithNestedExpandLocalId: NodeSpec;
export declare const toJSON: (node: PMNode) => {
attrs: Attrs;
};