document-model 1.0.51 → 1.0.53
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/dist/browser/cjs/document-model.js +1 -1
- package/dist/browser/cjs/document.js +1 -1
- package/dist/browser/cjs/index.js +1 -1
- package/dist/{node/cjs/internal/index-CRjFLQNR.js → browser/cjs/internal/index-BAk-LH-1.js} +1 -1
- package/dist/browser/cjs/internal/{index-CPJM383s.js → index-Cb6Xq42D.js} +1 -1
- package/dist/browser/cjs/internal/object-D1n8rS0m.js +25 -0
- package/dist/browser/es/document-model.js +2 -2
- package/dist/browser/es/document.js +2 -2
- package/dist/browser/es/index.js +3 -3
- package/dist/browser/es/internal/{index-BzIVYv7p.js → index-DeOZH3b_.js} +1 -1
- package/dist/browser/es/internal/{index-tEH7iGUj.js → index-DwxnEmzI.js} +1 -1
- package/dist/browser/es/internal/{object-Dev4WFVH.js → object-DsqsdDFj.js} +767 -771
- package/dist/browser/src/document/object.d.ts +35 -0
- package/dist/browser/src/document/types.d.ts +2 -0
- package/dist/node/cjs/document-model.js +1 -1
- package/dist/node/cjs/document.js +1 -1
- package/dist/node/cjs/index.js +1 -1
- package/dist/{browser/cjs/internal/index-REU04m7f.js → node/cjs/internal/index-CpjKrifV.js} +1 -1
- package/dist/node/cjs/internal/{index-BX95XaQ_.js → index-DzXcygIJ.js} +1 -1
- package/dist/node/cjs/internal/object-Cx_c54j_.js +20 -0
- package/dist/node/es/document-model.js +2 -2
- package/dist/node/es/document.js +2 -2
- package/dist/node/es/index.js +3 -3
- package/dist/node/es/internal/{index-BzNCX_-9.js → index-CUitPgxf.js} +1 -1
- package/dist/node/es/internal/{index-DpH4_29z.js → index-V-nmqbyU.js} +1 -1
- package/dist/node/es/internal/{object-BFkXGmt6.js → object-C0WcyLCx.js} +500 -504
- package/dist/node/src/document/object.d.ts +35 -0
- package/dist/node/src/document/types.d.ts +2 -0
- package/package.json +1 -1
- package/dist/browser/cjs/internal/object-DkoS83BB.js +0 -25
- package/dist/node/cjs/internal/object-CGt7Qacd.js +0 -20
- package/dist/src/document/actions/creators.d.ts +0 -47
- package/dist/src/document/actions/index.d.ts +0 -14
- package/dist/src/document/actions/types.d.ts +0 -15
- package/dist/src/document/index.d.ts +0 -6
- package/dist/src/document/object.d.ts +0 -1140
- package/dist/src/document/reducer.d.ts +0 -32
- package/dist/src/document/schema/index.d.ts +0 -2
- package/dist/src/document/schema/types.d.ts +0 -176
- package/dist/src/document/schema/zod.d.ts +0 -113
- package/dist/src/document/signal.d.ts +0 -29
- package/dist/src/document/types.d.ts +0 -247
- package/dist/src/document/utils/base.d.ts +0 -85
- package/dist/src/document/utils/file.d.ts +0 -48
- package/dist/src/document/utils/index.d.ts +0 -4
- package/dist/src/document/utils/node.d.ts +0 -9
- package/dist/src/document/utils/validation.d.ts +0 -2
- package/dist/src/document-model/custom/reducers/header.d.ts +0 -2
- package/dist/src/document-model/custom/reducers/module.d.ts +0 -2
- package/dist/src/document-model/custom/reducers/operation-error.d.ts +0 -2
- package/dist/src/document-model/custom/reducers/operation-example.d.ts +0 -2
- package/dist/src/document-model/custom/reducers/operation.d.ts +0 -2
- package/dist/src/document-model/custom/reducers/state.d.ts +0 -2
- package/dist/src/document-model/custom/reducers/versioning.d.ts +0 -7
- package/dist/src/document-model/custom/utils.d.ts +0 -7
- package/dist/src/document-model/gen/actions.d.ts +0 -15
- package/dist/src/document-model/gen/creators.d.ts +0 -7
- package/dist/src/document-model/gen/document-model.d.ts +0 -2
- package/dist/src/document-model/gen/header/actions.d.ts +0 -9
- package/dist/src/document-model/gen/header/creators.d.ts +0 -8
- package/dist/src/document-model/gen/header/object.d.ts +0 -12
- package/dist/src/document-model/gen/header/operations.d.ts +0 -10
- package/dist/src/document-model/gen/index.d.ts +0 -5
- package/dist/src/document-model/gen/module/actions.d.ts +0 -8
- package/dist/src/document-model/gen/module/creators.d.ts +0 -7
- package/dist/src/document-model/gen/module/object.d.ts +0 -11
- package/dist/src/document-model/gen/module/operations.d.ts +0 -9
- package/dist/src/document-model/gen/object.d.ts +0 -28
- package/dist/src/document-model/gen/operation/actions.d.ts +0 -13
- package/dist/src/document-model/gen/operation/creators.d.ts +0 -12
- package/dist/src/document-model/gen/operation/object.d.ts +0 -16
- package/dist/src/document-model/gen/operation/operations.d.ts +0 -14
- package/dist/src/document-model/gen/operation-error/actions.d.ts +0 -10
- package/dist/src/document-model/gen/operation-error/creators.d.ts +0 -9
- package/dist/src/document-model/gen/operation-error/object.d.ts +0 -13
- package/dist/src/document-model/gen/operation-error/operations.d.ts +0 -11
- package/dist/src/document-model/gen/operation-example/actions.d.ts +0 -7
- package/dist/src/document-model/gen/operation-example/creators.d.ts +0 -6
- package/dist/src/document-model/gen/operation-example/object.d.ts +0 -10
- package/dist/src/document-model/gen/operation-example/operations.d.ts +0 -8
- package/dist/src/document-model/gen/reducer.d.ts +0 -5
- package/dist/src/document-model/gen/schema/index.d.ts +0 -2
- package/dist/src/document-model/gen/schema/types.d.ts +0 -453
- package/dist/src/document-model/gen/schema/zod.d.ts +0 -453
- package/dist/src/document-model/gen/state/actions.d.ts +0 -9
- package/dist/src/document-model/gen/state/creators.d.ts +0 -8
- package/dist/src/document-model/gen/state/object.d.ts +0 -12
- package/dist/src/document-model/gen/state/operations.d.ts +0 -10
- package/dist/src/document-model/gen/types.d.ts +0 -8
- package/dist/src/document-model/gen/utils.d.ts +0 -6
- package/dist/src/document-model/gen/versioning/actions.d.ts +0 -8
- package/dist/src/document-model/gen/versioning/creators.d.ts +0 -7
- package/dist/src/document-model/gen/versioning/object.d.ts +0 -11
- package/dist/src/document-model/gen/versioning/operations.d.ts +0 -9
- package/dist/src/document-model/index.d.ts +0 -80
- package/dist/src/index.d.ts +0 -25
- package/dist/vite.config.d.ts +0 -2
- package/dist/vitest.config.d.ts +0 -2
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { ExtendedState, OperationScope } from '../types';
|
|
2
|
-
import { LoadStateAction, PruneAction, RedoAction, SetNameAction, UndoAction, NOOPAction } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Changes the name of the document.
|
|
5
|
-
*
|
|
6
|
-
* @param name - The name to be set in the document.
|
|
7
|
-
* @category Actions
|
|
8
|
-
*/
|
|
9
|
-
export declare const setName: (name: string) => SetNameAction;
|
|
10
|
-
/**
|
|
11
|
-
* Cancels the last `count` operations.
|
|
12
|
-
*
|
|
13
|
-
* @param count - Number of operations to cancel
|
|
14
|
-
* @category Actions
|
|
15
|
-
*/
|
|
16
|
-
export declare const undo: (skip?: number, scope?: OperationScope) => UndoAction;
|
|
17
|
-
/**
|
|
18
|
-
* Cancels the last `count` {@link undo | UNDO} operations.
|
|
19
|
-
*
|
|
20
|
-
* @param count - Number of UNDO operations to cancel
|
|
21
|
-
* @category Actions
|
|
22
|
-
*/
|
|
23
|
-
export declare const redo: (count?: number, scope?: OperationScope) => RedoAction;
|
|
24
|
-
/**
|
|
25
|
-
* Joins multiple operations into a single {@link loadState | LOAD_STATE} operation.
|
|
26
|
-
*
|
|
27
|
-
* @remarks
|
|
28
|
-
* Useful to keep operations history smaller. Operations to prune are selected by index,
|
|
29
|
-
* similar to the {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/slice | slice} method in Arrays.
|
|
30
|
-
*
|
|
31
|
-
* @param start - Index of the first operation to prune
|
|
32
|
-
* @param end - Index of the last operation to prune
|
|
33
|
-
* @category Actions
|
|
34
|
-
*/
|
|
35
|
-
export declare const prune: (start?: number | undefined, end?: number | undefined, scope?: OperationScope) => PruneAction;
|
|
36
|
-
/**
|
|
37
|
-
* Replaces the state of the document.
|
|
38
|
-
*
|
|
39
|
-
* @remarks
|
|
40
|
-
* This action shouldn't be used directly. It is dispatched by the {@link prune} action.
|
|
41
|
-
*
|
|
42
|
-
* @param state - State to be set in the document.
|
|
43
|
-
* @param operations - Number of operations that were removed from the previous state.
|
|
44
|
-
* @category Actions
|
|
45
|
-
*/
|
|
46
|
-
export declare const loadState: <S, T>(state: Pick<ExtendedState<S, T>, "name" | "state">, operations: number) => LoadStateAction;
|
|
47
|
-
export declare const noop: (scope?: OperationScope) => NOOPAction;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Action, Document, ImmutableStateReducer, Operation, PruneAction, RedoAction, State, UndoAction, UndoRedoProcessResult } from '../types';
|
|
2
|
-
export declare function setNameOperation<T>(document: T, name: string): T;
|
|
3
|
-
export declare function noopOperation<T, A extends Action, L>(document: Document<T, A, L>, action: Partial<Operation>, skip: number): {
|
|
4
|
-
skip: number;
|
|
5
|
-
document: Document<T, A, L>;
|
|
6
|
-
};
|
|
7
|
-
export declare function undoOperation<T, A extends Action, L>(document: Document<T, A, L>, action: UndoAction, skip: number): UndoRedoProcessResult<T, A, L>;
|
|
8
|
-
export declare function redoOperation<T, A extends Action, L>(document: Document<T, A, L>, action: RedoAction, skip: number): UndoRedoProcessResult<T, A, L>;
|
|
9
|
-
export declare function pruneOperation<T, A extends Action, L>(document: Document<T, A, L>, action: PruneAction, wrappedReducer: ImmutableStateReducer<T, A, L>): Document<T, A, L>;
|
|
10
|
-
export declare function loadStateOperation<T, A extends Action, L>(oldDocument: Document<T, A, L>, newDocument: {
|
|
11
|
-
name: string;
|
|
12
|
-
state?: State<T, L>;
|
|
13
|
-
}): Document<T, A, L>;
|
|
14
|
-
export * from './creators';
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { Action } from '../types';
|
|
2
|
-
import type { LoadStateActionInput, PruneActionInput, RedoAction as _RedoAction, SetNameAction as _SetNameAction, UndoAction as _UndoAction } from '../schema/types';
|
|
3
|
-
export declare const SET_NAME = "SET_NAME";
|
|
4
|
-
export declare const UNDO = "UNDO";
|
|
5
|
-
export declare const REDO = "REDO";
|
|
6
|
-
export declare const PRUNE = "PRUNE";
|
|
7
|
-
export declare const LOAD_STATE = "LOAD_STATE";
|
|
8
|
-
export declare const NOOP = "NOOP";
|
|
9
|
-
export type LoadStateAction = Action<'LOAD_STATE', LoadStateActionInput>;
|
|
10
|
-
export type PruneAction = Action<'PRUNE', PruneActionInput>;
|
|
11
|
-
export type RedoAction = Action<'REDO', _RedoAction['input']>;
|
|
12
|
-
export type SetNameAction = Action<'SET_NAME', _SetNameAction['input']>;
|
|
13
|
-
export type UndoAction = Action<'UNDO', _UndoAction['input']>;
|
|
14
|
-
export type NOOPAction = Action<'NOOP'>;
|
|
15
|
-
export type BaseAction = LoadStateAction | PruneAction | RedoAction | SetNameAction | UndoAction | NOOPAction;
|