Skip to content

Commit

Permalink
Expose Bounds type for getBounds()
Browse files Browse the repository at this point in the history
  • Loading branch information
luin committed Apr 4, 2024
1 parent d5ac335 commit 91a7346
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

- **Clipboard** Add support for Quill v1 list attributes
- Fix overload declarations for `quill.formatText()` and other methods
- Expose Bounds type for getBounds()

# 2.0.0-rc.4

Expand Down
9 changes: 8 additions & 1 deletion packages/quill/src/core.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Quill, { Parchment, Range } from './core/quill.js';
import type {
Bounds,
DebugLevel,
EmitterSource,
ExpandedQuillOptions,
Expand All @@ -24,7 +25,13 @@ import Input from './modules/input.js';
import UINode from './modules/uiNode.js';

export { Delta, Op, OpIterator, AttributeMap, Parchment, Range };
export type { DebugLevel, EmitterSource, ExpandedQuillOptions, QuillOptions };
export type {
Bounds,
DebugLevel,
EmitterSource,
ExpandedQuillOptions,
QuillOptions,
};

Quill.register({
'blots/block': Block,
Expand Down
2 changes: 1 addition & 1 deletion packages/quill/src/core/quill.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1033,7 +1033,7 @@ function shiftRange(
return new Range(start, end - start);
}

export type { DebugLevel, EmitterSource };
export type { Bounds, DebugLevel, EmitterSource };
export { Parchment, Range };

export { globalRegistry, expandConfig, overload, Quill as default };
9 changes: 8 additions & 1 deletion packages/quill/src/quill.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import Quill, { Parchment, Range } from './core.js';
import type {
Bounds,
DebugLevel,
EmitterSource,
ExpandedQuillOptions,
Expand Down Expand Up @@ -114,7 +115,13 @@ Quill.register(
true,
);

export type { DebugLevel, EmitterSource, ExpandedQuillOptions, QuillOptions };
export type {
Bounds,
DebugLevel,
EmitterSource,
ExpandedQuillOptions,
QuillOptions,
};
export { Parchment, Range };

export default Quill;
3 changes: 3 additions & 0 deletions packages/quill/test/types/quill.test-d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,9 @@ const quill = new Quill('#editor');

{
quill.scrollRectIntoView({ left: 0, right: 0, top: 0, bottom: 0 });
quill.scrollRectIntoView(
document.createElement('div').getBoundingClientRect(),
);
}

{
Expand Down

0 comments on commit 91a7346

Please sign in to comment.