@dabble/patches 0.2.0 → 0.2.2

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.
@@ -1,3 +1,4 @@
1
+ import type { JSONPatch } from '../json-patch/JSONPatch.js';
1
2
  import type { Change, PatchesSnapshot } from '../types.js';
2
3
  /**
3
4
  * Represents a document synchronized using JSON patches.
@@ -55,7 +56,7 @@ export declare class PatchesDoc<T extends object> {
55
56
  * @param mutator Function modifying a draft state.
56
57
  * @returns The generated Change object or null if no changes occurred.
57
58
  */
58
- change(mutator: (draft: T) => void): Change | null;
59
+ change(mutator: (draft: T, patch: JSONPatch) => void): Change | null;
59
60
  /**
60
61
  * Retrieves pending changes and marks them as sending.
61
62
  * @returns Array of changes ready to be sent to the server.
@@ -1,2 +1,3 @@
1
- export { PatchesDoc } from './PatchesDoc.js';
2
- export type { Change, PatchesSnapshot as PatchSnapshot, VersionMetadata } from '../types.js';
1
+ export * from './Patches.js';
2
+ export * from './PatchesDoc.js';
3
+ export * from './PatchesHistoryClient.js';
@@ -1 +1,3 @@
1
- export { PatchesDoc } from './PatchesDoc.js';
1
+ export * from './Patches.js';
2
+ export * from './PatchesDoc.js';
3
+ export * from './PatchesHistoryClient.js';
package/dist/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { Patches } from './client/Patches.js';
2
2
  export { PatchesDoc } from './client/PatchesDoc.js';
3
- export type { Change, PatchesSnapshot as PatchSnapshot, PatchesState as PatchState, VersionMetadata } from './types';
3
+ export type * from './types';
@@ -1,11 +1,9 @@
1
- export { Patches } from '../client/Patches.js';
2
- export { PatchesSync } from './PatchesSync.js';
3
- export { JSONRPCClient } from './protocol/JSONRPCClient.js';
4
- export { PatchesWebSocket } from './websocket/PatchesWebSocket.js';
5
- export { WebSocketTransport } from './websocket/WebSocketTransport.js';
6
- export type { PatchesOptions } from './Patches.js';
7
- export type { PatchesSyncOptions, PatchesSyncState } from './PatchesSync.js';
8
- export type { ConnectionState, ListOptions, PatchesAPI, PatchesNotificationParams, SignalNotificationParams, } from './protocol/types.js';
9
- export type { WebSocketOptions } from './websocket/WebSocketTransport.js';
1
+ export * from './AbstractTransport.js';
2
+ export * from './PatchesSync.js';
3
+ export * from './protocol/JSONRPCClient.js';
4
+ export type * from './protocol/types';
5
+ export type * from './types';
10
6
  export * from './webrtc/WebRTCAwareness.js';
11
7
  export * from './webrtc/WebRTCTransport.js';
8
+ export * from './websocket/PatchesWebSocket.js';
9
+ export * from './websocket/WebSocketTransport.js';
package/dist/net/index.js CHANGED
@@ -1,10 +1,7 @@
1
- // Core client and sync mechanism
2
- export { Patches } from '../client/Patches.js';
3
- export { PatchesSync } from './PatchesSync.js';
4
- // Underlying protocol and transport
5
- export { JSONRPCClient } from './protocol/JSONRPCClient.js';
6
- export { PatchesWebSocket } from './websocket/PatchesWebSocket.js';
7
- export { WebSocketTransport } from './websocket/WebSocketTransport.js';
8
- // Optional WebRTC Awareness (if kept)
1
+ export * from './AbstractTransport.js';
2
+ export * from './PatchesSync.js';
3
+ export * from './protocol/JSONRPCClient.js';
9
4
  export * from './webrtc/WebRTCAwareness.js';
10
5
  export * from './webrtc/WebRTCTransport.js';
6
+ export * from './websocket/PatchesWebSocket.js';
7
+ export * from './websocket/WebSocketTransport.js';
@@ -1,4 +1,3 @@
1
1
  export * from './IndexedDBStore.js';
2
2
  export * from './InMemoryStore.js';
3
3
  export * from './PatchesStore.js';
4
- export type { Change, PatchesSnapshot as PatchSnapshot, VersionMetadata } from '../types';
@@ -1,4 +1,3 @@
1
1
  export { PatchesBranchManager } from './PatchesBranchManager';
2
2
  export { PatchesHistoryManager } from './PatchesHistoryManager';
3
3
  export { PatchesServer } from './PatchesServer';
4
- export type { Change, PatchesSnapshot as PatchSnapshot, PatchesState as PatchState, VersionMetadata } from '../types';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dabble/patches",
3
- "version": "0.2.0",
3
+ "version": "0.2.2",
4
4
  "description": "Immutable JSON Patch implementation based on RFC 6902 supporting operational transformation and last-writer-wins",
5
5
  "author": "Jacob Wright <jacwright@gmail.com>",
6
6
  "bugs": {