Skip to content

Commit

Permalink
[lexical] Bug Fix: Flow is missing some variables and functions (#6977)
Browse files Browse the repository at this point in the history
  • Loading branch information
lytion authored Dec 26, 2024
1 parent e79c946 commit 05ddbcc
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions 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 @@ -361,7 +362,7 @@ export type DOMConversion = {
conversion: DOMConversionFn,
priority: 0 | 1 | 2 | 3 | 4,
};
export type DOMConversionFn = (element: Node) => DOMConversionOutput;
export type DOMConversionFn = (element: Node) => DOMConversionOutput | null;
export type DOMChildConversion = (
lexicalNode: LexicalNode,
parentLexicalNode: ?LexicalNode | null,
Expand Down Expand Up @@ -452,13 +453,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 @@ -470,6 +474,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 @@ -479,6 +485,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 @@ -494,6 +501,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 @@ -531,6 +539,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 05ddbcc

Please sign in to comment.