@inditextech/weave-sdk 0.2.0 → 0.2.1

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/sdk.d.cts CHANGED
@@ -2,7 +2,7 @@ import Emittery from "emittery";
2
2
  import Konva from "konva";
3
3
  import { Vector2d } from "konva/lib/types";
4
4
  import pino, { Logger } from "pino";
5
- import { MappedTypeDescription } from "@syncedstore/core/types/doc";
5
+ import * as Y from "yjs";
6
6
  import { Doc } from "yjs";
7
7
  import { StageConfig } from "konva/lib/Stage";
8
8
 
@@ -155,7 +155,11 @@ type WeaveCallbacks = {
155
155
  onStateChange?: (state: WeaveState) => void;
156
156
  onUndoManagerStatusChange?: (undoManagerStatus: WeaveUndoRedoChange) => void;
157
157
  };
158
-
158
+ declare type docElementTypeDescription = "xml" | "text" | Array<any> | object;
159
+ declare type DocTypeDescription = {
160
+ [key: string]: docElementTypeDescription;
161
+ };
162
+ declare type MappedTypeDescription<T extends DocTypeDescription> = { readonly [P in keyof T]: T[P] extends "xml" ? Y.XmlFragment : T[P] extends "text" ? Y.Text : T[P] extends Array<any> ? T[P] : T[P] extends object ? Partial<T[P]> : never };
159
163
  //#endregion
160
164
  //#region src/base/node.d.ts
161
165
  interface WeaveNodeBase {
package/dist/sdk.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import Konva from "konva";
2
2
  import { Vector2d } from "konva/lib/types";
3
- import { MappedTypeDescription } from "@syncedstore/core/types/doc";
3
+ import * as Y from "yjs";
4
4
  import { Doc } from "yjs";
5
5
  import Emittery from "emittery";
6
6
  import pino, { Logger } from "pino";
@@ -155,7 +155,11 @@ type WeaveCallbacks = {
155
155
  onStateChange?: (state: WeaveState) => void;
156
156
  onUndoManagerStatusChange?: (undoManagerStatus: WeaveUndoRedoChange) => void;
157
157
  };
158
-
158
+ declare type docElementTypeDescription = "xml" | "text" | Array<any> | object;
159
+ declare type DocTypeDescription = {
160
+ [key: string]: docElementTypeDescription;
161
+ };
162
+ declare type MappedTypeDescription<T extends DocTypeDescription> = { readonly [P in keyof T]: T[P] extends "xml" ? Y.XmlFragment : T[P] extends "text" ? Y.Text : T[P] extends Array<any> ? T[P] : T[P] extends object ? Partial<T[P]> : never };
159
163
  //#endregion
160
164
  //#region src/base/node.d.ts
161
165
  interface WeaveNodeBase {