Skip to content

Commit

Permalink
Export isModelEmptyFast and let it accept block group
Browse files Browse the repository at this point in the history
  • Loading branch information
JiuqingSong committed Nov 21, 2024
1 parent 486ea52 commit 29225c7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/roosterjs-content-model-plugins/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export { ShortcutKeyDefinition, ShortcutCommand } from './shortcut/ShortcutComma
export { ContextMenuPluginBase, ContextMenuOptions } from './contextMenuBase/ContextMenuPluginBase';
export { WatermarkPlugin } from './watermark/WatermarkPlugin';
export { WatermarkFormat } from './watermark/WatermarkFormat';
export { isModelEmptyFast } from './watermark/isModelEmptyFast';
export { MarkdownPlugin, MarkdownOptions } from './markdown/MarkdownPlugin';
export { HyperlinkPlugin } from './hyperlink/HyperlinkPlugin';
export { HyperlinkToolTip } from './hyperlink/HyperlinkToolTip';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
import type { ReadonlyContentModelDocument } from 'roosterjs-content-model-types';
import type { ReadonlyContentModelBlockGroup } from 'roosterjs-content-model-types';

/**
* @internal
* A fast way to check if content model is empty
*/
export function isModelEmptyFast(model: ReadonlyContentModelDocument): boolean {
export function isModelEmptyFast(model: ReadonlyContentModelBlockGroup): boolean {
const firstBlock = model.blocks[0];

if (model.blocks.length > 1) {
Expand Down

0 comments on commit 29225c7

Please sign in to comment.