UNPKG

@atlaskit/adf-utils

Version:

Set of utilities to traverse, modify and create ADF documents.

25 lines (24 loc) 607 B
export interface ADFEntityMark { attrs?: { [name: string]: any; }; type: string; } export interface ADFEntity { [key: string]: any; attrs?: { [name: string]: any; }; content?: Array<ADFEntity | undefined>; marks?: Array<ADFEntityMark>; text?: string; type: string; } export type Visitor = (node: ADFEntity, parent: EntityParent, index: number, depth: number) => ADFEntity | false | undefined | void; export type VisitorCollection = { [nodeType: string]: Visitor; }; export type EntityParent = { node?: ADFEntity; parent?: EntityParent; };