Skip to content

Commit

Permalink
Merge pull request #3354 from yf-yang/slate-5295
Browse files Browse the repository at this point in the history
feat: add option parameter to normalizeNode following slate#5295
  • Loading branch information
zbeyens authored Jul 12, 2024
2 parents d51b7cc + eee24fc commit eb4088a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/plenty-students-collect.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@udecode/slate": patch
---

feat: add option parameter to normalizeNode following slate#5295
10 changes: 8 additions & 2 deletions packages/slate/src/interfaces/editor/TEditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ export type TEditor<V extends Value = Value> = Modify<
isVoid: <N extends TElement>(element: N) => boolean;
markableVoid: <N extends TElement>(element: N) => boolean;
marks: Record<string, any> | null;
normalizeNode: <N extends TNode>(entry: TNodeEntry<N>) => void;
normalizeNode: <N extends TNode>(
entry: TNodeEntry<N>,
options?: { operation?: TOperation }
) => void;
operations: TOperation[];
}
> &
Expand All @@ -56,7 +59,10 @@ export const getTEditor = <V extends Value, E extends TEditor<V> = TEditor<V>>(
// Schema-specific node behaviors.
isInline: (element: EElement<V>) => boolean;
isVoid: (element: EElement<V>) => boolean;
normalizeNode: (entry: TNodeEntry<ENode<V>>) => void;
normalizeNode: (
entry: TNodeEntry<ENode<V>>,
options?: { operation?: TOperation }
) => void;
operations: TOperation<EElementOrText<V>>[];
}
>;

0 comments on commit eb4088a

Please sign in to comment.