Skip to content

Commit

Permalink
Link flow types (#6833)
Browse files Browse the repository at this point in the history
  • Loading branch information
zurfyx authored Nov 14, 2024
1 parent c14d676 commit 79a2e15
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion packages/lexical-link/flow/LexicalLink.js.flow
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,22 @@ import type {
NodeKey,
RangeSelection,
LexicalCommand,
SerializedElementNode,
} from 'lexical';
import {addClassNamesToElement} from '@lexical/utils';
import {$isElementNode, ElementNode} from 'lexical';
export type LinkAttributes = {
export type LinkAttributes = $ReadOnly<{
rel?: null | string,
target?: null | string,
title?: null | string,
}>;
export type SerializedLinkNode = {
...SerializedElementNode,
rel?: null | string,
target?: null | string,
title?: null | string,
url: string,
...
};
declare export class LinkNode extends ElementNode {
__url: string;
Expand All @@ -36,6 +45,7 @@ declare export class LinkNode extends ElementNode {
config: EditorConfig,
): boolean;
static importDOM(): DOMConversionMap | null;
exportJSON(): SerializedLinkNode;
getURL(): string;
setURL(url: string): void;
getTarget(): null | string;
Expand All @@ -60,6 +70,11 @@ declare export function $createLinkNode(
declare export function $isLinkNode(
node: ?LexicalNode,
): node is LinkNode;
export type SerializedAutoLinkNode = {
...SerializedLinkNode,
isUnlinked: boolean,
...
};
declare export class AutoLinkNode extends LinkNode {
static getType(): string;
// $FlowFixMe clone method inheritance
Expand Down

0 comments on commit 79a2e15

Please sign in to comment.