Fix auto-generated typedefs (#1585)

This commit is contained in:
Maksim Horbachevsky
2022-04-01 09:09:56 -04:00
committed by acywatson
parent c8817a53a5
commit 235907f716
5 changed files with 23 additions and 7 deletions

View File

@ -36,7 +36,9 @@ declare export class LinkNode extends ElementNode {
isInline(): true;
}
declare export function $createLinkNode(url: string): LinkNode;
declare export function $isLinkNode(node: ?LexicalNode): boolean;
declare export function $isLinkNode(
node: ?LexicalNode,
): boolean %checks(node instanceof LinkNode);
declare export class AutoLinkNode extends LinkNode {
static getType(): string;
// $FlowFixMe clone method inheritance
@ -44,4 +46,6 @@ declare export class AutoLinkNode extends LinkNode {
insertNewAfter(selection: RangeSelection): null | ElementNode;
}
declare export function $createAutoLinkNode(url: string): AutoLinkNode;
declare export function $isAutoLinkNode(node: ?LexicalNode): boolean;
declare export function $isAutoLinkNode(
node: ?LexicalNode,
): boolean %checks(node instanceof AutoLinkNode);

View File

@ -18,4 +18,6 @@ declare export class OverflowNode extends ElementNode {
excludeFromCopy(): boolean;
}
declare export function $createOverflowNode(): OverflowNode;
declare export function $isOverflowNode(node: ?LexicalNode): boolean;
declare export function $isOverflowNode(
node: ?LexicalNode,
): boolean %checks(node instanceof OverflowNode);

View File

@ -22,4 +22,6 @@ declare export class HorizontalRuleNode extends DecoratorNode<React$Node> {
}
declare export function $createHorizontalRuleNode(): HorizontalRuleNode;
declare export function $isHorizontalRuleNode(node: ?LexicalNode): boolean;
declare export function $isHorizontalRuleNode(
node: ?LexicalNode,
): boolean %checks(node instanceof HorizontalRuleNode);

View File

@ -28,7 +28,9 @@ declare export class QuoteNode extends ElementNode {
collapseAtStart(): true;
}
declare export function $createQuoteNode(): QuoteNode;
declare export function $isQuoteNode(node: ?LexicalNode): boolean;
declare export function $isQuoteNode(
node: ?LexicalNode,
): boolean %checks(node instanceof QuoteNode);
export type HeadingTagType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5';
declare export class HeadingNode extends ElementNode {
__tag: HeadingTagType;
@ -45,7 +47,9 @@ declare export class HeadingNode extends ElementNode {
declare export function $createHeadingNode(
headingTag: HeadingTagType,
): HeadingNode;
declare export function $isHeadingNode(node: ?LexicalNode): boolean;
declare export function $isHeadingNode(
node: ?LexicalNode,
): boolean %checks(node instanceof HeadingNode);
declare export function registerRichText(
editor: LexicalEditor,
initialEditorState?: InitialEditorStateType,

View File

@ -60,7 +60,11 @@ declare export class TableCellNode extends ElementNode {
collapseAtStart(): true;
canBeEmpty(): false;
}
declare export function $createTableCellNode(): TableCellNode;
declare export function $createTableCellNode(
headerState: TableCellHeaderState,
colSpan?: number,
width?: ?number,
): TableCellNode;
declare export function $isTableCellNode(
node: ?LexicalNode,
): boolean %checks(node instanceof TableCellNode);