@examind/block-types 0.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +40 -0
- package/package.json +21 -0
- package/types/examind/index.d.ts +12 -0
- package/types/examind/nodes/EssayQuestionNode.ts +16 -0
- package/types/examind/nodes/FillInTheBlankQuestionNode.ts +14 -0
- package/types/examind/nodes/FillInTheBlankSpaceNode.ts +21 -0
- package/types/examind/nodes/FinancialStatementQuestionNode.ts +46 -0
- package/types/examind/nodes/HorizontalRuleNode.ts +3 -0
- package/types/examind/nodes/ImageNode.ts +18 -0
- package/types/examind/nodes/JournalEntryQuestionNode.ts +32 -0
- package/types/examind/nodes/MatchingQuestionNode.ts +21 -0
- package/types/examind/nodes/MultipleOptionQuestionNode.ts +29 -0
- package/types/examind/nodes/ShortAnswerQuestionNode.ts +15 -0
- package/types/examind/nodes/SimulationQuestionNode.ts +15 -0
- package/types/examind/nodes/VariableNode.ts +24 -0
- package/types/index.ts +2 -0
- package/types/lexical/LexicalCommands.ts +159 -0
- package/types/lexical/LexicalConstants.ts +51 -0
- package/types/lexical/LexicalEditor.ts +597 -0
- package/types/lexical/LexicalEditorState.ts +30 -0
- package/types/lexical/LexicalEvents.ts +13 -0
- package/types/lexical/LexicalGC.ts +13 -0
- package/types/lexical/LexicalMutations.ts +10 -0
- package/types/lexical/LexicalNode.ts +460 -0
- package/types/lexical/LexicalNodeState.ts +379 -0
- package/types/lexical/LexicalNormalization.ts +9 -0
- package/types/lexical/LexicalReconciler.ts +13 -0
- package/types/lexical/LexicalSelection.ts +295 -0
- package/types/lexical/LexicalUpdateTags.ts +51 -0
- package/types/lexical/LexicalUpdates.ts +31 -0
- package/types/lexical/LexicalUtils.ts +304 -0
- package/types/lexical/index.ts +35 -0
- package/types/lexical/link/index.ts +125 -0
- package/types/lexical/list/LexicalListItemNode.ts +65 -0
- package/types/lexical/list/LexicalListNode.ts +56 -0
- package/types/lexical/list/checkList.ts +9 -0
- package/types/lexical/list/formatList.ts +69 -0
- package/types/lexical/list/index.ts +11 -0
- package/types/lexical/list/utils.ts +64 -0
- package/types/lexical/nodes/ArtificialNode.ts +12 -0
- package/types/lexical/nodes/LexicalDecoratorNode.ts +26 -0
- package/types/lexical/nodes/LexicalElementNode.ts +207 -0
- package/types/lexical/nodes/LexicalLineBreakNode.ts +25 -0
- package/types/lexical/nodes/LexicalParagraphNode.ts +31 -0
- package/types/lexical/nodes/LexicalRootNode.ts +30 -0
- package/types/lexical/nodes/LexicalTabNode.ts +28 -0
- package/types/lexical/nodes/LexicalTextNode.ts +288 -0
- package/types/lexical/rich-text/index.ts +53 -0
- package/types/lexical/table/LexicalTableCellNode.ts +72 -0
- package/types/lexical/table/LexicalTableCommands.ts +17 -0
- package/types/lexical/table/LexicalTableNode.ts +65 -0
- package/types/lexical/table/LexicalTableObserver.ts +108 -0
- package/types/lexical/table/LexicalTablePluginHelpers.ts +25 -0
- package/types/lexical/table/LexicalTableRowNode.ts +34 -0
- package/types/lexical/table/LexicalTableSelection.ts +74 -0
- package/types/lexical/table/LexicalTableSelectionHelpers.ts +40 -0
- package/types/lexical/table/LexicalTableUtils.ts +112 -0
- package/types/lexical/table/constants.ts +8 -0
- package/types/lexical/table/index.ts +16 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// THIS FILE IS AUTO-GENERATED
|
|
2
|
+
// To regenerate, run: pnpm build (from the root of the project)
|
|
3
|
+
|
|
4
|
+
// Type definitions based on Lexical
|
|
5
|
+
// Original copyright: Meta Platforms, Inc. and affiliates.
|
|
6
|
+
|
|
7
|
+
export * from './LexicalListItemNode';
|
|
8
|
+
export * from './LexicalListNode';
|
|
9
|
+
export * from './checkList';
|
|
10
|
+
export * from './formatList';
|
|
11
|
+
export * from './utils';
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// THIS FILE IS AUTO-GENERATED
|
|
2
|
+
// To regenerate, run: pnpm build (from the root of the project)
|
|
3
|
+
|
|
4
|
+
// Type definitions based on Lexical
|
|
5
|
+
// Original copyright: Meta Platforms, Inc. and affiliates.
|
|
6
|
+
|
|
7
|
+
import type { LexicalNode, Spread } from './../';
|
|
8
|
+
import { ListItemNode, ListNode } from './';
|
|
9
|
+
/**
|
|
10
|
+
* Checks the depth of listNode from the root node.
|
|
11
|
+
* @param listNode - The ListNode to be checked.
|
|
12
|
+
* @returns The depth of the ListNode.
|
|
13
|
+
*/
|
|
14
|
+
export declare function $getListDepth(listNode: ListNode): number;
|
|
15
|
+
/**
|
|
16
|
+
* Finds the nearest ancestral ListNode and returns it, throws an invariant if listItem is not a ListItemNode.
|
|
17
|
+
* @param listItem - The node to be checked.
|
|
18
|
+
* @returns The ListNode found.
|
|
19
|
+
*/
|
|
20
|
+
export declare function $getTopListNode(listItem: LexicalNode): ListNode;
|
|
21
|
+
/**
|
|
22
|
+
* Checks if listItem has no child ListNodes and has no ListItemNode ancestors with siblings.
|
|
23
|
+
* @param listItem - the ListItemNode to be checked.
|
|
24
|
+
* @returns true if listItem has no child ListNode and no ListItemNode ancestors with siblings, false otherwise.
|
|
25
|
+
*/
|
|
26
|
+
export declare function $isLastItemInList(listItem: ListItemNode): boolean;
|
|
27
|
+
/**
|
|
28
|
+
* A recursive Depth-First Search (Postorder Traversal) that finds all of a node's children
|
|
29
|
+
* that are of type ListItemNode and returns them in an array.
|
|
30
|
+
* @param node - The ListNode to start the search.
|
|
31
|
+
* @returns An array containing all nodes of type ListItemNode found.
|
|
32
|
+
*/
|
|
33
|
+
export declare function $getAllListItems(node: ListNode): Array<ListItemNode>;
|
|
34
|
+
declare const NestedListNodeBrand: unique symbol;
|
|
35
|
+
/**
|
|
36
|
+
* Checks to see if the passed node is a ListItemNode and has a ListNode as a child.
|
|
37
|
+
* @param node - The node to be checked.
|
|
38
|
+
* @returns true if the node is a ListItemNode and has a ListNode child, false otherwise.
|
|
39
|
+
*/
|
|
40
|
+
export declare function isNestedListNode(node: LexicalNode | null | undefined): node is Spread<{
|
|
41
|
+
getFirstChild(): ListNode;
|
|
42
|
+
[NestedListNodeBrand]: never;
|
|
43
|
+
}, ListItemNode>;
|
|
44
|
+
/**
|
|
45
|
+
* Traverses up the tree and returns the first ListItemNode found.
|
|
46
|
+
* @param node - Node to start the search.
|
|
47
|
+
* @returns The first ListItemNode found, or null if none exist.
|
|
48
|
+
*/
|
|
49
|
+
export declare function $findNearestListItemNode(node: LexicalNode): ListItemNode | null;
|
|
50
|
+
/**
|
|
51
|
+
* Takes a deeply nested ListNode or ListItemNode and traverses up the branch to delete the first
|
|
52
|
+
* ancestral ListNode (which could be the root ListNode) or ListItemNode with siblings, essentially
|
|
53
|
+
* bringing the deeply nested node up the branch once. Would remove sublist if it has siblings.
|
|
54
|
+
* Should not break ListItem -> List -> ListItem chain as empty List/ItemNodes should be removed on .remove().
|
|
55
|
+
* @param sublist - The nested ListNode or ListItemNode to be brought up the branch.
|
|
56
|
+
*/
|
|
57
|
+
export declare function $removeHighestEmptyListParent(sublist: ListItemNode | ListNode): void;
|
|
58
|
+
/**
|
|
59
|
+
* Wraps a node into a ListItemNode.
|
|
60
|
+
* @param node - The node to be wrapped into a ListItemNode
|
|
61
|
+
* @returns The ListItemNode which the passed node is wrapped in.
|
|
62
|
+
*/
|
|
63
|
+
export declare function $wrapInListItem(node: LexicalNode): ListItemNode;
|
|
64
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// THIS FILE IS AUTO-GENERATED
|
|
2
|
+
// To regenerate, run: pnpm build (from the root of the project)
|
|
3
|
+
|
|
4
|
+
// Type definitions based on Lexical
|
|
5
|
+
// Original copyright: Meta Platforms, Inc. and affiliates.
|
|
6
|
+
|
|
7
|
+
import type { EditorConfig } from '../';
|
|
8
|
+
import { ElementNode } from './LexicalElementNode';
|
|
9
|
+
export declare class ArtificialNode__DO_NOT_USE extends ElementNode {
|
|
10
|
+
static getType(): string;
|
|
11
|
+
createDOM(config: EditorConfig): HTMLElement;
|
|
12
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// THIS FILE IS AUTO-GENERATED
|
|
2
|
+
// To regenerate, run: pnpm build (from the root of the project)
|
|
3
|
+
|
|
4
|
+
// Type definitions based on Lexical
|
|
5
|
+
// Original copyright: Meta Platforms, Inc. and affiliates.
|
|
6
|
+
|
|
7
|
+
import type { KlassConstructor, LexicalEditor } from '../LexicalEditor';
|
|
8
|
+
import type { ElementNode } from './LexicalElementNode';
|
|
9
|
+
import type { EditorConfig } from '../';
|
|
10
|
+
import { LexicalNode } from '../LexicalNode';
|
|
11
|
+
export interface DecoratorNode<T> {
|
|
12
|
+
getTopLevelElement(): ElementNode | this | null;
|
|
13
|
+
getTopLevelElementOrThrow(): ElementNode | this;
|
|
14
|
+
}
|
|
15
|
+
/** @noInheritDoc */
|
|
16
|
+
export declare class DecoratorNode<T> extends LexicalNode {
|
|
17
|
+
['constructor']: KlassConstructor<typeof DecoratorNode<T>>;
|
|
18
|
+
/**
|
|
19
|
+
* The returned value is added to the LexicalEditor._decorators
|
|
20
|
+
*/
|
|
21
|
+
decorate(editor: LexicalEditor, config: EditorConfig): T;
|
|
22
|
+
isIsolated(): boolean;
|
|
23
|
+
isInline(): boolean;
|
|
24
|
+
isKeyboardSelectable(): boolean;
|
|
25
|
+
}
|
|
26
|
+
export declare function $isDecoratorNode<T>(node: LexicalNode | null | undefined): node is DecoratorNode<T>;
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
// THIS FILE IS AUTO-GENERATED
|
|
2
|
+
// To regenerate, run: pnpm build (from the root of the project)
|
|
3
|
+
|
|
4
|
+
// Type definitions based on Lexical
|
|
5
|
+
// Original copyright: Meta Platforms, Inc. and affiliates.
|
|
6
|
+
|
|
7
|
+
import type { DOMExportOutput, LexicalPrivateDOM, NodeKey, SerializedLexicalNode } from '../LexicalNode';
|
|
8
|
+
import type { BaseSelection, RangeSelection } from '../LexicalSelection';
|
|
9
|
+
import type { KlassConstructor, LexicalEditor, LexicalUpdateJSON, Spread, TextFormatType } from '../';
|
|
10
|
+
import { TextNode } from '../index';
|
|
11
|
+
import { LexicalNode } from '../LexicalNode';
|
|
12
|
+
export type SerializedElementNode<T extends SerializedLexicalNode = SerializedLexicalNode> = Spread<{
|
|
13
|
+
children: Array<T>;
|
|
14
|
+
direction: 'ltr' | 'rtl' | null;
|
|
15
|
+
format: ElementFormatType;
|
|
16
|
+
indent: number;
|
|
17
|
+
textFormat?: number;
|
|
18
|
+
textStyle?: string;
|
|
19
|
+
}, SerializedLexicalNode>;
|
|
20
|
+
export type ElementFormatType = 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';
|
|
21
|
+
export interface ElementNode {
|
|
22
|
+
getTopLevelElement(): ElementNode | null;
|
|
23
|
+
getTopLevelElementOrThrow(): ElementNode;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A utility class for managing the DOM children of an ElementNode
|
|
27
|
+
*/
|
|
28
|
+
export declare class ElementDOMSlot<T extends HTMLElement = HTMLElement> {
|
|
29
|
+
readonly element: T;
|
|
30
|
+
readonly before: Node | null;
|
|
31
|
+
readonly after: Node | null;
|
|
32
|
+
constructor(
|
|
33
|
+
/** The element returned by createDOM */
|
|
34
|
+
element: T,
|
|
35
|
+
/** All managed children will be inserted before this node, if defined */
|
|
36
|
+
before?: Node | undefined | null,
|
|
37
|
+
/** All managed children will be inserted after this node, if defined */
|
|
38
|
+
after?: Node | undefined | null);
|
|
39
|
+
/**
|
|
40
|
+
* Return a new ElementDOMSlot where all managed children will be inserted before this node
|
|
41
|
+
*/
|
|
42
|
+
withBefore(before: Node | undefined | null): ElementDOMSlot<T>;
|
|
43
|
+
/**
|
|
44
|
+
* Return a new ElementDOMSlot where all managed children will be inserted after this node
|
|
45
|
+
*/
|
|
46
|
+
withAfter(after: Node | undefined | null): ElementDOMSlot<T>;
|
|
47
|
+
/**
|
|
48
|
+
* Return a new ElementDOMSlot with an updated root element
|
|
49
|
+
*/
|
|
50
|
+
withElement<ElementType extends HTMLElement>(element: ElementType): ElementDOMSlot<ElementType>;
|
|
51
|
+
/**
|
|
52
|
+
* Insert the given child before this.before and any reconciler managed line break node,
|
|
53
|
+
* or append it if this.before is not defined
|
|
54
|
+
*/
|
|
55
|
+
insertChild(dom: Node): this;
|
|
56
|
+
/**
|
|
57
|
+
* Remove the managed child from this container, will throw if it was not already there
|
|
58
|
+
*/
|
|
59
|
+
removeChild(dom: Node): this;
|
|
60
|
+
/**
|
|
61
|
+
* Replace managed child prevDom with dom. Will throw if prevDom is not a child
|
|
62
|
+
*
|
|
63
|
+
* @param dom The new node to replace prevDom
|
|
64
|
+
* @param prevDom the node that will be replaced
|
|
65
|
+
*/
|
|
66
|
+
replaceChild(dom: Node, prevDom: Node): this;
|
|
67
|
+
/**
|
|
68
|
+
* Returns the first managed child of this node,
|
|
69
|
+
* which will either be this.after.nextSibling or this.element.firstChild,
|
|
70
|
+
* and will never be this.before if it is defined.
|
|
71
|
+
*/
|
|
72
|
+
getFirstChild(): ChildNode | null;
|
|
73
|
+
/**
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
76
|
+
getManagedLineBreak(): Exclude<LexicalPrivateDOM['__lexicalLineBreak'], undefined>;
|
|
77
|
+
/** @internal */
|
|
78
|
+
setManagedLineBreak(lineBreakType: null | 'empty' | 'line-break' | 'decorator'): void;
|
|
79
|
+
/** @internal */
|
|
80
|
+
removeManagedLineBreak(): void;
|
|
81
|
+
/** @internal */
|
|
82
|
+
insertManagedLineBreak(webkitHack: boolean): void;
|
|
83
|
+
/**
|
|
84
|
+
* @internal
|
|
85
|
+
*
|
|
86
|
+
* Returns the offset of the first child
|
|
87
|
+
*/
|
|
88
|
+
getFirstChildOffset(): number;
|
|
89
|
+
/**
|
|
90
|
+
* @internal
|
|
91
|
+
*/
|
|
92
|
+
resolveChildIndex(element: ElementNode, elementDOM: HTMLElement, initialDOM: Node, initialOffset: number): [node: ElementNode, idx: number];
|
|
93
|
+
}
|
|
94
|
+
export declare function indexPath(root: HTMLElement, child: Node): number[];
|
|
95
|
+
/** @noInheritDoc */
|
|
96
|
+
export declare class ElementNode extends LexicalNode {
|
|
97
|
+
['constructor']: KlassConstructor<typeof ElementNode>;
|
|
98
|
+
/** @internal */
|
|
99
|
+
__first: null | NodeKey;
|
|
100
|
+
/** @internal */
|
|
101
|
+
__last: null | NodeKey;
|
|
102
|
+
/** @internal */
|
|
103
|
+
__size: number;
|
|
104
|
+
/** @internal */
|
|
105
|
+
__format: number;
|
|
106
|
+
/** @internal */
|
|
107
|
+
__style: string;
|
|
108
|
+
/** @internal */
|
|
109
|
+
__indent: number;
|
|
110
|
+
/** @internal */
|
|
111
|
+
__dir: 'ltr' | 'rtl' | null;
|
|
112
|
+
/** @internal */
|
|
113
|
+
__textFormat: number;
|
|
114
|
+
/** @internal */
|
|
115
|
+
__textStyle: string;
|
|
116
|
+
constructor(key?: NodeKey);
|
|
117
|
+
afterCloneFrom(prevNode: this): void;
|
|
118
|
+
getFormat(): number;
|
|
119
|
+
getFormatType(): ElementFormatType;
|
|
120
|
+
getStyle(): string;
|
|
121
|
+
getIndent(): number;
|
|
122
|
+
getChildren<T extends LexicalNode>(): Array<T>;
|
|
123
|
+
getChildrenKeys(): Array<NodeKey>;
|
|
124
|
+
getChildrenSize(): number;
|
|
125
|
+
isEmpty(): boolean;
|
|
126
|
+
isDirty(): boolean;
|
|
127
|
+
isLastChild(): boolean;
|
|
128
|
+
getAllTextNodes(): Array<TextNode>;
|
|
129
|
+
getFirstDescendant<T extends LexicalNode>(): null | T;
|
|
130
|
+
getLastDescendant<T extends LexicalNode>(): null | T;
|
|
131
|
+
getDescendantByIndex<T extends LexicalNode>(index: number): null | T;
|
|
132
|
+
getFirstChild<T extends LexicalNode>(): null | T;
|
|
133
|
+
getFirstChildOrThrow<T extends LexicalNode>(): T;
|
|
134
|
+
getLastChild<T extends LexicalNode>(): null | T;
|
|
135
|
+
getLastChildOrThrow<T extends LexicalNode>(): T;
|
|
136
|
+
getChildAtIndex<T extends LexicalNode>(index: number): null | T;
|
|
137
|
+
getTextContent(): string;
|
|
138
|
+
getTextContentSize(): number;
|
|
139
|
+
getDirection(): 'ltr' | 'rtl' | null;
|
|
140
|
+
getTextFormat(): number;
|
|
141
|
+
hasFormat(type: ElementFormatType): boolean;
|
|
142
|
+
hasTextFormat(type: TextFormatType): boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Returns the format flags applied to the node as a 32-bit integer.
|
|
145
|
+
*
|
|
146
|
+
* @returns a number representing the TextFormatTypes applied to the node.
|
|
147
|
+
*/
|
|
148
|
+
getFormatFlags(type: TextFormatType, alignWithFormat: null | number): number;
|
|
149
|
+
getTextStyle(): string;
|
|
150
|
+
select(_anchorOffset?: number, _focusOffset?: number): RangeSelection;
|
|
151
|
+
selectStart(): RangeSelection;
|
|
152
|
+
selectEnd(): RangeSelection;
|
|
153
|
+
clear(): this;
|
|
154
|
+
append(...nodesToAppend: LexicalNode[]): this;
|
|
155
|
+
setDirection(direction: 'ltr' | 'rtl' | null): this;
|
|
156
|
+
setFormat(type: ElementFormatType): this;
|
|
157
|
+
setStyle(style: string): this;
|
|
158
|
+
setTextFormat(type: number): this;
|
|
159
|
+
setTextStyle(style: string): this;
|
|
160
|
+
setIndent(indentLevel: number): this;
|
|
161
|
+
splice(start: number, deleteCount: number, nodesToInsert: Array<LexicalNode>): this;
|
|
162
|
+
/**
|
|
163
|
+
* @internal
|
|
164
|
+
*
|
|
165
|
+
* An experimental API that an ElementNode can override to control where its
|
|
166
|
+
* children are inserted into the DOM, this is useful to add a wrapping node
|
|
167
|
+
* or accessory nodes before or after the children. The root of the node returned
|
|
168
|
+
* by createDOM must still be exactly one HTMLElement.
|
|
169
|
+
*/
|
|
170
|
+
getDOMSlot(element: HTMLElement): ElementDOMSlot<HTMLElement>;
|
|
171
|
+
exportDOM(editor: LexicalEditor): DOMExportOutput;
|
|
172
|
+
exportJSON(): SerializedElementNode;
|
|
173
|
+
updateFromJSON(serializedNode: LexicalUpdateJSON<SerializedElementNode>): this;
|
|
174
|
+
insertNewAfter(selection: RangeSelection, restoreSelection?: boolean): null | LexicalNode;
|
|
175
|
+
canIndent(): boolean;
|
|
176
|
+
collapseAtStart(selection: RangeSelection): boolean;
|
|
177
|
+
excludeFromCopy(destination?: 'clone' | 'html'): boolean;
|
|
178
|
+
/** @deprecated @internal */
|
|
179
|
+
canReplaceWith(replacement: LexicalNode): boolean;
|
|
180
|
+
/** @deprecated @internal */
|
|
181
|
+
canInsertAfter(node: LexicalNode): boolean;
|
|
182
|
+
canBeEmpty(): boolean;
|
|
183
|
+
canInsertTextBefore(): boolean;
|
|
184
|
+
canInsertTextAfter(): boolean;
|
|
185
|
+
isInline(): boolean;
|
|
186
|
+
isShadowRoot(): boolean;
|
|
187
|
+
/** @deprecated @internal */
|
|
188
|
+
canMergeWith(node: ElementNode): boolean;
|
|
189
|
+
extractWithChild(child: LexicalNode, selection: BaseSelection | null, destination: 'clone' | 'html'): boolean;
|
|
190
|
+
/**
|
|
191
|
+
* Determines whether this node, when empty, can merge with a first block
|
|
192
|
+
* of nodes being inserted.
|
|
193
|
+
*
|
|
194
|
+
* This method is specifically called in {@link RangeSelection.insertNodes}
|
|
195
|
+
* to determine merging behavior during nodes insertion.
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* // In a ListItemNode or QuoteNode implementation:
|
|
199
|
+
* canMergeWhenEmpty(): true {
|
|
200
|
+
* return true;
|
|
201
|
+
* }
|
|
202
|
+
*/
|
|
203
|
+
canMergeWhenEmpty(): boolean;
|
|
204
|
+
/** @internal */
|
|
205
|
+
reconcileObservedMutation(dom: HTMLElement, editor: LexicalEditor): void;
|
|
206
|
+
}
|
|
207
|
+
export declare function $isElementNode(node: LexicalNode | null | undefined): node is ElementNode;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// THIS FILE IS AUTO-GENERATED
|
|
2
|
+
// To regenerate, run: pnpm build (from the root of the project)
|
|
3
|
+
|
|
4
|
+
// Type definitions based on Lexical
|
|
5
|
+
// Original copyright: Meta Platforms, Inc. and affiliates.
|
|
6
|
+
|
|
7
|
+
import type { KlassConstructor } from '../LexicalEditor';
|
|
8
|
+
import type { DOMConversionMap, NodeKey, SerializedLexicalNode } from '../LexicalNode';
|
|
9
|
+
import { LexicalNode } from '../LexicalNode';
|
|
10
|
+
export type SerializedLineBreakNode = SerializedLexicalNode;
|
|
11
|
+
/** @noInheritDoc */
|
|
12
|
+
export declare class LineBreakNode extends LexicalNode {
|
|
13
|
+
['constructor']: KlassConstructor<typeof LineBreakNode>;
|
|
14
|
+
static getType(): string;
|
|
15
|
+
static clone(node: LineBreakNode): LineBreakNode;
|
|
16
|
+
constructor(key?: NodeKey);
|
|
17
|
+
getTextContent(): '\n';
|
|
18
|
+
createDOM(): HTMLElement;
|
|
19
|
+
updateDOM(): false;
|
|
20
|
+
isInline(): true;
|
|
21
|
+
static importDOM(): DOMConversionMap | null;
|
|
22
|
+
static importJSON(serializedLineBreakNode: SerializedLineBreakNode): LineBreakNode;
|
|
23
|
+
}
|
|
24
|
+
export declare function $createLineBreakNode(): LineBreakNode;
|
|
25
|
+
export declare function $isLineBreakNode(node: LexicalNode | null | undefined): node is LineBreakNode;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// THIS FILE IS AUTO-GENERATED
|
|
2
|
+
// To regenerate, run: pnpm build (from the root of the project)
|
|
3
|
+
|
|
4
|
+
// Type definitions based on Lexical
|
|
5
|
+
// Original copyright: Meta Platforms, Inc. and affiliates.
|
|
6
|
+
|
|
7
|
+
import type { EditorConfig, KlassConstructor, LexicalEditor, Spread } from '../LexicalEditor';
|
|
8
|
+
import type { DOMConversionMap, DOMExportOutput, LexicalNode } from '../LexicalNode';
|
|
9
|
+
import type { RangeSelection } from '../LexicalSelection';
|
|
10
|
+
import type { SerializedElementNode } from './LexicalElementNode';
|
|
11
|
+
import { ElementNode } from './LexicalElementNode';
|
|
12
|
+
export type SerializedParagraphNode = Spread<{
|
|
13
|
+
textFormat: number;
|
|
14
|
+
textStyle: string;
|
|
15
|
+
}, SerializedElementNode>;
|
|
16
|
+
/** @noInheritDoc */
|
|
17
|
+
export declare class ParagraphNode extends ElementNode {
|
|
18
|
+
['constructor']: KlassConstructor<typeof ParagraphNode>;
|
|
19
|
+
static getType(): string;
|
|
20
|
+
static clone(node: ParagraphNode): ParagraphNode;
|
|
21
|
+
createDOM(config: EditorConfig): HTMLElement;
|
|
22
|
+
updateDOM(prevNode: ParagraphNode, dom: HTMLElement, config: EditorConfig): boolean;
|
|
23
|
+
static importDOM(): DOMConversionMap | null;
|
|
24
|
+
exportDOM(editor: LexicalEditor): DOMExportOutput;
|
|
25
|
+
static importJSON(serializedNode: SerializedParagraphNode): ParagraphNode;
|
|
26
|
+
exportJSON(): SerializedParagraphNode;
|
|
27
|
+
insertNewAfter(rangeSelection: RangeSelection, restoreSelection: boolean): ParagraphNode;
|
|
28
|
+
collapseAtStart(): boolean;
|
|
29
|
+
}
|
|
30
|
+
export declare function $createParagraphNode(): ParagraphNode;
|
|
31
|
+
export declare function $isParagraphNode(node: LexicalNode | null | undefined): node is ParagraphNode;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// THIS FILE IS AUTO-GENERATED
|
|
2
|
+
// To regenerate, run: pnpm build (from the root of the project)
|
|
3
|
+
|
|
4
|
+
// Type definitions based on Lexical
|
|
5
|
+
// Original copyright: Meta Platforms, Inc. and affiliates.
|
|
6
|
+
|
|
7
|
+
import type { LexicalNode, SerializedLexicalNode } from '../LexicalNode';
|
|
8
|
+
import type { SerializedElementNode } from './LexicalElementNode';
|
|
9
|
+
import { ElementNode } from './LexicalElementNode';
|
|
10
|
+
export type SerializedRootNode<T extends SerializedLexicalNode = SerializedLexicalNode> = SerializedElementNode<T>;
|
|
11
|
+
/** @noInheritDoc */
|
|
12
|
+
export declare class RootNode extends ElementNode {
|
|
13
|
+
/** @internal */
|
|
14
|
+
__cachedText: null | string;
|
|
15
|
+
static getType(): string;
|
|
16
|
+
static clone(): RootNode;
|
|
17
|
+
constructor();
|
|
18
|
+
getTopLevelElementOrThrow(): never;
|
|
19
|
+
getTextContent(): string;
|
|
20
|
+
remove(): never;
|
|
21
|
+
replace<N = LexicalNode>(node: N): never;
|
|
22
|
+
insertBefore(nodeToInsert: LexicalNode): LexicalNode;
|
|
23
|
+
insertAfter(nodeToInsert: LexicalNode): LexicalNode;
|
|
24
|
+
updateDOM(prevNode: this, dom: HTMLElement): false;
|
|
25
|
+
splice(start: number, deleteCount: number, nodesToInsert: LexicalNode[]): this;
|
|
26
|
+
static importJSON(serializedNode: SerializedRootNode): RootNode;
|
|
27
|
+
collapseAtStart(): true;
|
|
28
|
+
}
|
|
29
|
+
export declare function $createRootNode(): RootNode;
|
|
30
|
+
export declare function $isRootNode(node: RootNode | LexicalNode | null | undefined): node is RootNode;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
// THIS FILE IS AUTO-GENERATED
|
|
2
|
+
// To regenerate, run: pnpm build (from the root of the project)
|
|
3
|
+
|
|
4
|
+
// Type definitions based on Lexical
|
|
5
|
+
// Original copyright: Meta Platforms, Inc. and affiliates.
|
|
6
|
+
|
|
7
|
+
import type { DOMConversionMap, NodeKey } from '../LexicalNode';
|
|
8
|
+
import { EditorConfig } from '../LexicalEditor';
|
|
9
|
+
import { LexicalNode } from '../LexicalNode';
|
|
10
|
+
import { SerializedTextNode, TextDetailType, TextModeType, TextNode } from './LexicalTextNode';
|
|
11
|
+
export type SerializedTabNode = SerializedTextNode;
|
|
12
|
+
/** @noInheritDoc */
|
|
13
|
+
export declare class TabNode extends TextNode {
|
|
14
|
+
static getType(): string;
|
|
15
|
+
static clone(node: TabNode): TabNode;
|
|
16
|
+
constructor(key?: NodeKey);
|
|
17
|
+
static importDOM(): DOMConversionMap | null;
|
|
18
|
+
createDOM(config: EditorConfig): HTMLElement;
|
|
19
|
+
static importJSON(serializedTabNode: SerializedTabNode): TabNode;
|
|
20
|
+
setTextContent(text: string): this;
|
|
21
|
+
spliceText(offset: number, delCount: number, newText: string, moveSelection?: boolean): TextNode;
|
|
22
|
+
setDetail(detail: TextDetailType | number): this;
|
|
23
|
+
setMode(type: TextModeType): this;
|
|
24
|
+
canInsertTextBefore(): boolean;
|
|
25
|
+
canInsertTextAfter(): boolean;
|
|
26
|
+
}
|
|
27
|
+
export declare function $createTabNode(): TabNode;
|
|
28
|
+
export declare function $isTabNode(node: LexicalNode | null | undefined): node is TabNode;
|