-
Notifications
You must be signed in to change notification settings - Fork 1.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[lexical] Bug Fix: Flow is missing some variables and functions #6977
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -262,6 +262,7 @@ export type EditorThemeClasses = { | |
ulDepth?: Array<EditorThemeClassName>, | ||
ol?: EditorThemeClassName, | ||
olDepth?: Array<EditorThemeClassName>, | ||
checklist?: EditorThemeClassName, | ||
listitem?: EditorThemeClassName, | ||
listitemChecked?: EditorThemeClassName, | ||
listitemUnchecked?: EditorThemeClassName, | ||
|
@@ -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, | ||
|
@@ -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>; | ||
|
@@ -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; | ||
Comment on lines
+476
to
+477
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it useful to add this here, when it already declares that BaseSelection is implemented? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If I remove those 2 declarations,
|
||
add(key: NodeKey): void; | ||
delete(key: NodeKey): void; | ||
clear(): void; | ||
|
@@ -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>; | ||
|
@@ -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; | ||
|
@@ -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]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This also looks to be the same as BaseSelection There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as the other comment, if I remove those 2 declarations,
|
||
} | ||
export type TextPoint = TextPointType; | ||
type TextPointType = { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
curious about the use cases outside of meta for these added api
just a nit, rearranging clone to be after dirty would break the unenforced abc sorting for props
other then that lgtm