editate 0.6.8 → 0.6.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/doc/node.d.ts +3 -0
- package/lib/doc/{edit.d.ts → operation.d.ts} +1 -3
- package/lib/editor.d.ts +1 -1
- package/lib/index.cjs +628 -605
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/index.js +463 -440
- package/lib/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment, Path, Range } from './types.js';
|
|
2
2
|
declare const OP_DELETE = "delete";
|
|
3
3
|
type DeleteOperation = Readonly<{
|
|
4
4
|
type: typeof OP_DELETE;
|
|
@@ -31,7 +31,5 @@ type SetNodeAttrOperation = Readonly<{
|
|
|
31
31
|
value: unknown;
|
|
32
32
|
}>;
|
|
33
33
|
export type Operation = DeleteOperation | InsertTextOperation | InsertNodeOperation | FormatOperation | SetNodeAttrOperation;
|
|
34
|
-
export declare const getNodeSize: (node: Node) => number;
|
|
35
|
-
export declare const offsetToPosition: (node: DocNode | BlockNode, offset: number) => DomPosition;
|
|
36
34
|
export declare const rebase: (position: number, ops: readonly Operation[]) => number;
|
|
37
35
|
export {};
|
package/lib/editor.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StandardSchemaV1 } from '@standard-schema/spec';
|
|
2
2
|
import { DocNode, Fragment, Selection } from './doc/types.js';
|
|
3
|
-
import { Operation } from './doc/
|
|
3
|
+
import { Operation } from './doc/operation.js';
|
|
4
4
|
import { Parser } from './dom/parser.js';
|
|
5
5
|
type EditorCommandOrPlugin<A extends unknown[], T extends DocNode = DocNode> = (editor: Editor<T>, ...args: A) => void | undefined;
|
|
6
6
|
type EditorQuery<A extends unknown[], V, T extends DocNode = DocNode> = (editor: Editor<T>, ...args: A) => V;
|