1 | import { createAnchor, createCursor, createElement, createFocus, createFragment, createSelection, createText } from './creators';
|
2 |
|
3 |
|
4 |
|
5 |
|
6 | type HyperscriptCreators<T = any> = Record<string, (tagName: string, attributes: {
|
7 | [key: string]: any;
|
8 | }, children: any[]) => T>;
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | type HyperscriptShorthands = Record<string, Record<string, any>>;
|
15 |
|
16 |
|
17 |
|
18 | declare const createHyperscript: (options?: {
|
19 | creators?: HyperscriptCreators;
|
20 | elements?: HyperscriptShorthands;
|
21 | }) => <S extends "anchor" | "cursor" | "editor" | "element" | "focus" | "fragment" | "selection" | "text">(tagName: S, attributes?: Object, ...children: any[]) => ReturnType<{
|
22 | anchor: typeof createAnchor;
|
23 | cursor: typeof createCursor;
|
24 | editor: (tagName: string, attributes: {
|
25 | [key: string]: any;
|
26 | }, children: any[]) => import("slate").BaseEditor;
|
27 | element: typeof createElement;
|
28 | focus: typeof createFocus;
|
29 | fragment: typeof createFragment;
|
30 | selection: typeof createSelection;
|
31 | text: typeof createText;
|
32 | }[S]>;
|
33 | export { createHyperscript, HyperscriptCreators, HyperscriptShorthands };
|
34 |
|
\ | No newline at end of file |