Skip to content

Commit

Permalink
fix docs
Browse files Browse the repository at this point in the history
  • Loading branch information
etrepum committed Jan 16, 2025
1 parent 29302a2 commit 32aa889
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions packages/lexical/src/LexicalCaret.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const FLIP_DIRECTION = {
previous: 'next',
} as const;

/** @noInheritDoc */
export interface BaseNodeCaret<
T extends LexicalNode,
D extends CaretDirection,
Expand Down Expand Up @@ -544,14 +545,14 @@ export function $getTextSliceCaret<
* @returns null if origin is null or not an ElementNode, otherwise a DepthNodeCaret for this origin and direction
*/
export function $getDepthCaret<T extends ElementNode, D extends CaretDirection>(
node: T,
origin: T,
direction: D,
): DepthNodeCaret<T, D>;
export function $getDepthCaret(
node: LexicalNode | null,
origin: null | LexicalNode,
direction: CaretDirection,
): null | DepthNodeCaret<ElementNode, CaretDirection> {
return $isElementNode(node) ? new DEPTH_CTOR[direction](node) : null;
return $isElementNode(origin) ? new DEPTH_CTOR[direction](origin) : null;
}

/**
Expand All @@ -572,9 +573,9 @@ export function $getChildCaretOrSelf<
* @param caret The caret to start at
*/
export function $getAdjacentDepthCaret<D extends CaretDirection>(
origin: null | NodeCaret<D>,
caret: null | NodeCaret<D>,
): null | NodeCaret<D> {
return origin && $getChildCaretOrSelf(origin.getAdjacentCaret());
return caret && $getChildCaretOrSelf(caret.getAdjacentCaret());
}

/**
Expand Down

0 comments on commit 32aa889

Please sign in to comment.