UNPKG

1.49 kBTypeScriptView Raw
1import { Element, Descendant, Range, Text, Editor } from 'slate';
2import { AnchorToken, FocusToken, Token } from './tokens';
3/**
4 * Create an anchor token.
5 */
6export declare function createAnchor(tagName: string, attributes: {
7 [key: string]: any;
8}, children: any[]): AnchorToken;
9/**
10 * Create an anchor and a focus token.
11 */
12export declare function createCursor(tagName: string, attributes: {
13 [key: string]: any;
14}, children: any[]): Token[];
15/**
16 * Create an `Element` object.
17 */
18export declare function createElement(tagName: string, attributes: {
19 [key: string]: any;
20}, children: any[]): Element;
21/**
22 * Create a focus token.
23 */
24export declare function createFocus(tagName: string, attributes: {
25 [key: string]: any;
26}, children: any[]): FocusToken;
27/**
28 * Create a fragment.
29 */
30export declare function createFragment(tagName: string, attributes: {
31 [key: string]: any;
32}, children: any[]): Descendant[];
33/**
34 * Create a `Selection` object.
35 */
36export declare function createSelection(tagName: string, attributes: {
37 [key: string]: any;
38}, children: any[]): Range;
39/**
40 * Create a `Text` object.
41 */
42export declare function createText(tagName: string, attributes: {
43 [key: string]: any;
44}, children: any[]): Text;
45/**
46 * Create a top-level `Editor` object.
47 */
48export declare const createEditor: (makeEditor: () => Editor) => (tagName: string, attributes: {
49 [key: string]: any;
50}, children: any[]) => Editor;
51//# sourceMappingURL=creators.d.ts.map
\No newline at end of file