import { EditorSchema, SchemaProps } from '@remirror/core'; import { Mark, Node as ProsemirrorNode, Slice } from '@remirror/pm/model'; import { BaseFactoryProps, TaggedContent, TaggedContentItem, TaggedContentWithText, TaggedProsemirrorNode, Tags } from './jest-remirror-types'; /** * Create a text node. * * Special markers called `tags` can be put in the text. Tags provide a way to * declaratively describe a position within some text, and then access the * position in the resulting node. */ export declare function text(value: string, schema: EditorSchema): TaggedContentItem; /** * Offset tag position values by some amount. */ export declare function offsetTags(tags: Tags, offset: number): Tags; interface SequenceReturn { nodes: TaggedProsemirrorNode[]; tags: Tags; } /** * Given a collection of nodes, sequence them in an array and return the result * along with the updated tags. * * @param content[] - the spread of tagged content */ export declare function sequence(...content: TaggedContentItem[]): SequenceReturn; interface CoerceProps extends SchemaProps { /** * Content that will be transformed into taggedNodes */ content: TaggedContentWithText[]; } /** * Coerce builder content into tagged nodes. * * Checks if the content item is a string and runs the text transformer * otherwise passes a flattened structure through to the `sequence` function */ export declare function coerce(props: CoerceProps): SequenceReturn; interface NodeFactoryProps extends BaseFactoryProps { /** * The marks which wrap this node. */ marks?: Mark[]; } type NodeFactory = (...content: TaggedContentWithText[]) => TaggedProsemirrorNode; /** * Create a builder function for nodes. */ export declare function nodeFactory(props: NodeFactoryProps): NodeFactory; interface MarkFactoryProps extends BaseFactoryProps { allowDupes?: boolean; } type MarkFactory = (...content: TaggedContentWithText[]) => TaggedProsemirrorNode[]; /** * Create a builder for marks. */ export declare function markFactory(props: MarkFactoryProps): MarkFactory; /** * Flattens all content. * * @param content[] - spread parameter for tagged content with text */ export declare function fragment(...content: TaggedContentWithText[]): TaggedContentWithText[]; export declare function slice(schema: EditorSchema): (...content: TaggedContentWithText[]) => Slice; interface CleanProps extends SchemaProps { /** * The tagged content which will be replaced with a clean Prosemirror node */ content: TaggedContent; } /** * Builds a 'clean' version of the nodes, without Tags or TagTrackers. */ export declare function clean(props: CleanProps): ProsemirrorNode[] | ProsemirrorNode | undefined; export {};