Skip to content

Commit

Permalink
Flow: add missing variables and functions
Browse files Browse the repository at this point in the history
- EditorThemeClasses
- BaseSelection
- NodeSelection
- RangeSelection
  • Loading branch information
lytion committed Dec 18, 2024
1 parent ad7187d commit 59b56f4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/lexical/flow/Lexical.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ export type EditorThemeClasses = {
ulDepth?: Array<EditorThemeClassName>,
ol?: EditorThemeClassName,
olDepth?: Array<EditorThemeClassName>,
checklist?: EditorThemeClassName,
listitem?: EditorThemeClassName,
listitemChecked?: EditorThemeClassName,
listitemUnchecked?: EditorThemeClassName,
Expand Down Expand Up @@ -451,13 +452,16 @@ declare export function $isBlockElementNode(
): node is ElementNode;

export interface BaseSelection {
clone(): BaseSelection;
dirty: boolean;
clone(): BaseSelection;
extract(): Array<LexicalNode>;
getNodes(): Array<LexicalNode>;
getStartEndPoints(): null | [PointType, PointType];
getTextContent(): string;
insertRawText(text: string): void;
is(selection: null | BaseSelection): boolean;
isBackward(): boolean;
isCollapsed(): boolean;
insertText(text: string): void;
insertNodes(nodes: Array<LexicalNode>): void;
getCachedNodes(): null | Array<LexicalNode>;
Expand All @@ -469,6 +473,8 @@ declare export class NodeSelection implements BaseSelection {
dirty: boolean;
constructor(objects: Set<NodeKey>): void;
is(selection: null | BaseSelection): boolean;
isBackward(): boolean;
isCollapsed(): boolean;
add(key: NodeKey): void;
delete(key: NodeKey): void;
clear(): void;
Expand All @@ -478,6 +484,7 @@ declare export class NodeSelection implements BaseSelection {
insertRawText(): void;
insertText(): void;
getNodes(): Array<LexicalNode>;
getStartEndPoints(): null;
getTextContent(): string;
insertNodes(nodes: Array<LexicalNode>): void;
getCachedNodes(): null | Array<LexicalNode>;
Expand All @@ -493,6 +500,7 @@ declare export class RangeSelection implements BaseSelection {
focus: PointType;
dirty: boolean;
format: number;
style: string;
constructor(anchor: PointType, focus: PointType, format: number): void;
is(selection: null | BaseSelection): boolean;
isBackward(): boolean;
Expand Down Expand Up @@ -530,6 +538,8 @@ declare export class RangeSelection implements BaseSelection {
insertNodes(nodes: Array<LexicalNode>): void;
getCachedNodes(): null | Array<LexicalNode>;
setCachedNodes(nodes: null | Array<LexicalNode>): void;
forwardDeletion(anchor: PointType, anchorNode: ElementNode | TextNode, isBackward: boolean): boolean;
getStartEndPoints(): null | [PointType, PointType];
}
export type TextPoint = TextPointType;
type TextPointType = {
Expand Down

0 comments on commit 59b56f4

Please sign in to comment.