vestjs-runtime 1.0.6 → 1.2.0

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.
Files changed (43) hide show
  1. package/dist/cjs/IsolateSerializer.development.js +12 -13
  2. package/dist/cjs/IsolateSerializer.development.js.map +1 -1
  3. package/dist/cjs/IsolateSerializer.production.js +1 -1
  4. package/dist/cjs/IsolateSerializer.production.js.map +1 -1
  5. package/dist/cjs/test-utils.development.js +43 -18
  6. package/dist/cjs/test-utils.development.js.map +1 -1
  7. package/dist/cjs/test-utils.production.js +1 -1
  8. package/dist/cjs/test-utils.production.js.map +1 -1
  9. package/dist/cjs/vestjs-runtime.development.js +43 -51
  10. package/dist/cjs/vestjs-runtime.development.js.map +1 -1
  11. package/dist/cjs/vestjs-runtime.production.js +1 -1
  12. package/dist/cjs/vestjs-runtime.production.js.map +1 -1
  13. package/dist/es/IsolateSerializer.development.js +12 -13
  14. package/dist/es/IsolateSerializer.development.js.map +1 -1
  15. package/dist/es/IsolateSerializer.production.js +1 -1
  16. package/dist/es/IsolateSerializer.production.js.map +1 -1
  17. package/dist/es/test-utils.development.js +43 -18
  18. package/dist/es/test-utils.development.js.map +1 -1
  19. package/dist/es/test-utils.production.js +1 -1
  20. package/dist/es/test-utils.production.js.map +1 -1
  21. package/dist/es/vestjs-runtime.development.js +43 -52
  22. package/dist/es/vestjs-runtime.development.js.map +1 -1
  23. package/dist/es/vestjs-runtime.production.js +1 -1
  24. package/dist/es/vestjs-runtime.production.js.map +1 -1
  25. package/dist/umd/IsolateSerializer.development.js +12 -13
  26. package/dist/umd/IsolateSerializer.development.js.map +1 -1
  27. package/dist/umd/IsolateSerializer.production.js +1 -1
  28. package/dist/umd/IsolateSerializer.production.js.map +1 -1
  29. package/dist/umd/test-utils.development.js +86 -61
  30. package/dist/umd/test-utils.development.js.map +1 -1
  31. package/dist/umd/test-utils.production.js +1 -1
  32. package/dist/umd/test-utils.production.js.map +1 -1
  33. package/dist/umd/vestjs-runtime.development.js +702 -710
  34. package/dist/umd/vestjs-runtime.development.js.map +1 -1
  35. package/dist/umd/vestjs-runtime.production.js +1 -1
  36. package/dist/umd/vestjs-runtime.production.js.map +1 -1
  37. package/package.json +3 -3
  38. package/types/IsolateSerializer.d.ts +6 -7
  39. package/types/IsolateSerializer.d.ts.map +1 -1
  40. package/types/test-utils.d.ts +7 -8
  41. package/types/test-utils.d.ts.map +1 -1
  42. package/types/vestjs-runtime.d.ts +29 -24
  43. package/types/vestjs-runtime.d.ts.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../src/exports/test-utils.ts","../src/errors/ErrorStrings.ts","../src/Isolate/IsolateInspector.ts","../src/Isolate/IsolateStatus.ts","../src/Isolate/IsolateMutator.ts","../src/Isolate/IsolateKeys.ts","../src/Isolate/IsolateSelectors.ts","../src/Reconciler.ts","../src/VestRuntime.ts","../src/Bus.ts","../src/RuntimeEvents.ts","../src/Isolate/Isolate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,iBAAgB,cAAc,CAAC,IAAI,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAAG,QAAQ,CAWvE"}
1
+ {"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["../src/exports/test-utils.ts","../src/errors/ErrorStrings.ts","../src/Isolate/IsolateInspector.ts","../src/Isolate/IsolateMutator.ts","../src/Isolate/IsolateKeys.ts","../src/Isolate/IsolateSelectors.ts","../src/Reconciler.ts","../src/VestRuntime.ts","../src/Bus.ts","../src/RuntimeEvents.ts","../src/Isolate/Isolate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGA,iBAAgB,cAAc,CAAC,OAAO,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAAG,QAAQ,CAY1E"}
@@ -1,4 +1,10 @@
1
+ /// <reference types="node" />
1
2
  import { CB, Maybe, Nullable, TinyState, BusType, DynamicValue } from "vest-utils";
3
+ declare const RuntimeEvents: {
4
+ ISOLATE_ENTER: string;
5
+ ISOLATE_PENDING: string;
6
+ ISOLATE_DONE: string;
7
+ };
2
8
  declare enum IsolateKeys {
3
9
  Type = "$type",
4
10
  Keys = "keys",
@@ -6,7 +12,8 @@ declare enum IsolateKeys {
6
12
  Parent = "parent",
7
13
  Data = "data",
8
14
  AllowReorder = "allowReorder",
9
- Status = "status"
15
+ Status = "status",
16
+ AbortController = "abortController"
10
17
  }
11
18
  declare enum MinifiedKeys {
12
19
  Type = "$",
@@ -17,11 +24,6 @@ declare enum MinifiedKeys {
17
24
  AllowReorder = "aR",
18
25
  Status = "S"
19
26
  }
20
- declare enum IsolateStatus {
21
- PENDING = "PENDING",
22
- DONE = "DONE",
23
- INITIAL = "INITIAL"
24
- }
25
27
  type IsolateKey = Nullable<string>;
26
28
  type TIsolate<P extends IsolatePayload = IsolatePayload> = {
27
29
  [IsolateKeys.AllowReorder]?: boolean;
@@ -29,7 +31,8 @@ type TIsolate<P extends IsolatePayload = IsolatePayload> = {
29
31
  [IsolateKeys.Type]: string;
30
32
  [IsolateKeys.Keys]: Nullable<Record<string, TIsolate>>;
31
33
  [IsolateKeys.Data]: DataOnly<P>;
32
- [IsolateKeys.Status]: IsolateStatus;
34
+ [IsolateKeys.Status]?: string;
35
+ [IsolateKeys.AbortController]: AbortController;
33
36
  children: Nullable<TIsolate[]>;
34
37
  key: IsolateKey;
35
38
  output: any;
@@ -44,6 +47,7 @@ type IsolateData = Record<string, any>;
44
47
  type IsolatePayload = IsolateData & IsolateFeatures;
45
48
  type IsolateFeatures = {
46
49
  [IsolateKeys.AllowReorder]?: boolean;
50
+ [IsolateKeys.Status]?: string;
47
51
  };
48
52
  // import { isSameIsolateType } from 'IsolateSelectors';
49
53
  // I would rather not use `any` here, but instead use `Isolate`.
@@ -75,7 +79,8 @@ declare namespace Walker {
75
79
  Parent = "parent",
76
80
  Data = "data",
77
81
  AllowReorder = "allowReorder",
78
- Status = "status"
82
+ Status = "status",
83
+ AbortController = "abortController"
79
84
  }
80
85
  enum MinifiedKeys {
81
86
  Type = "$",
@@ -103,11 +108,7 @@ declare namespace Walker {
103
108
  // ...
104
109
  // }
105
110
  const MinifiedToKey: Record<string, IsolateKeys>;
106
- enum IsolateStatus {
107
- PENDING = "PENDING",
108
- DONE = "DONE",
109
- INITIAL = "INITIAL"
110
- }
111
+ const ExcludedFromDump: IsolateKeys[];
111
112
  type IsolateKey = Nullable<string>;
112
113
  type TIsolate<P extends IsolatePayload = IsolatePayload> = {
113
114
  [IsolateKeys.AllowReorder]?: boolean;
@@ -115,7 +116,8 @@ declare namespace Walker {
115
116
  [IsolateKeys.Type]: string;
116
117
  [IsolateKeys.Keys]: Nullable<Record<string, TIsolate>>;
117
118
  [IsolateKeys.Data]: DataOnly<P>;
118
- [IsolateKeys.Status]: IsolateStatus;
119
+ [IsolateKeys.Status]?: string;
120
+ [IsolateKeys.AbortController]: AbortController;
119
121
  children: Nullable<TIsolate[]>;
120
122
  key: IsolateKey;
121
123
  output: any;
@@ -130,6 +132,7 @@ declare namespace Walker {
130
132
  type IsolatePayload = IsolateData & IsolateFeatures;
131
133
  type IsolateFeatures = {
132
134
  [IsolateKeys.AllowReorder]?: boolean;
135
+ [IsolateKeys.Status]?: string;
133
136
  };
134
137
  type VisitOnlyPredicate = (isolate: TIsolate) => boolean;
135
138
  // eslint-disable-next-line
@@ -192,20 +195,24 @@ declare function useHistoryRoot(): [
192
195
  [x: string]: any;
193
196
  } & {
194
197
  allowReorder?: boolean | undefined;
198
+ status?: string | undefined;
195
199
  }>>,
196
200
  setValue: (next: Nullable<TIsolate<{
197
201
  [x: string]: any;
198
202
  } & {
199
203
  allowReorder?: boolean | undefined;
204
+ status?: string | undefined;
200
205
  }>> | import("vest-utils").CB<Nullable<TIsolate<{
201
206
  [x: string]: any;
202
207
  } & {
203
208
  allowReorder?: boolean | undefined;
209
+ status?: string | undefined;
204
210
  }>>, [
205
211
  prev: Nullable<TIsolate<{
206
212
  [x: string]: any;
207
213
  } & {
208
214
  allowReorder?: boolean | undefined;
215
+ status?: string | undefined;
209
216
  }>>
210
217
  ]>) => void,
211
218
  resetValue: () => void
@@ -232,8 +239,7 @@ declare class IsolateMutator {
232
239
  static addChildKey(isolate: TIsolate, key: string, node: TIsolate): void;
233
240
  static slice(isolate: TIsolate, at: number): void;
234
241
  static setData(isolate: TIsolate, data: any): void;
235
- static setPending(isolate: TIsolate): void;
236
- static setDone(isolate: TIsolate): void;
242
+ static abort(isolate: TIsolate, reason?: string): void;
237
243
  }
238
244
  declare namespace Bus {
239
245
  function useBus(): import("vest-utils").BusType;
@@ -252,7 +258,8 @@ declare namespace IsolateSelectors {
252
258
  Parent = "parent",
253
259
  Data = "data",
254
260
  AllowReorder = "allowReorder",
255
- Status = "status"
261
+ Status = "status",
262
+ AbortController = "abortController"
256
263
  }
257
264
  enum MinifiedKeys {
258
265
  Type = "$",
@@ -280,11 +287,7 @@ declare namespace IsolateSelectors {
280
287
  // ...
281
288
  // }
282
289
  const MinifiedToKey: Record<string, IsolateKeys>;
283
- enum IsolateStatus {
284
- PENDING = "PENDING",
285
- DONE = "DONE",
286
- INITIAL = "INITIAL"
287
- }
290
+ const ExcludedFromDump: IsolateKeys[];
288
291
  type IsolateKey = Nullable<string>;
289
292
  type TIsolate<P extends IsolatePayload = IsolatePayload> = {
290
293
  [IsolateKeys.AllowReorder]?: boolean;
@@ -292,7 +295,8 @@ declare namespace IsolateSelectors {
292
295
  [IsolateKeys.Type]: string;
293
296
  [IsolateKeys.Keys]: Nullable<Record<string, TIsolate>>;
294
297
  [IsolateKeys.Data]: DataOnly<P>;
295
- [IsolateKeys.Status]: IsolateStatus;
298
+ [IsolateKeys.Status]?: string;
299
+ [IsolateKeys.AbortController]: AbortController;
296
300
  children: Nullable<TIsolate[]>;
297
301
  key: IsolateKey;
298
302
  output: any;
@@ -307,6 +311,7 @@ declare namespace IsolateSelectors {
307
311
  type IsolatePayload = IsolateData & IsolateFeatures;
308
312
  type IsolateFeatures = {
309
313
  [IsolateKeys.AllowReorder]?: boolean;
314
+ [IsolateKeys.Status]?: string;
310
315
  };
311
316
  function isIsolateType<I extends TIsolate>(node: Maybe<TIsolate>, type: string): node is I;
312
317
  function isSameIsolateType<A extends TIsolate, B extends TIsolate>(a: A, b: B): boolean;
@@ -319,5 +324,5 @@ declare class IsolateSerializer {
319
324
  static getChildren(node: TIsolate): Nullable<TIsolate[]>;
320
325
  static validateIsolate(node: Record<string, any> | TIsolate): void;
321
326
  }
322
- export { IsolateKey, TIsolate, Isolate, IsolateStatus, Reconciler, IRecociler, Walker, RuntimeApi as VestRuntime, IsolateInspector, IsolateMutator, Bus, IsolateSelectors, IsolateSerializer };
327
+ export { RuntimeEvents, IsolateKey, TIsolate, Isolate, Reconciler, IRecociler, Walker, RuntimeApi as VestRuntime, IsolateInspector, IsolateMutator, Bus, IsolateSelectors, IsolateSerializer };
323
328
  //# sourceMappingURL=vestjs-runtime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"vestjs-runtime.d.ts","sourceRoot":"","sources":["../src/vestjs-runtime.ts","../src/errors/ErrorStrings.ts","../src/Isolate/IsolateInspector.ts","../src/Isolate/IsolateStatus.ts","../src/Isolate/IsolateMutator.ts","../src/Isolate/IsolateKeys.ts","../src/Isolate/IsolateSelectors.ts","../src/Reconciler.ts","../src/VestRuntime.ts","../src/Bus.ts","../src/RuntimeEvents.ts","../src/Isolate/Isolate.ts","../src/IsolateWalker.ts","../src/exports/IsolateSerializer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,uLAAiC,CAAgB"}
1
+ {"version":3,"file":"vestjs-runtime.d.ts","sourceRoot":"","sources":["../src/vestjs-runtime.ts","../src/RuntimeEvents.ts","../src/errors/ErrorStrings.ts","../src/Isolate/IsolateInspector.ts","../src/Isolate/IsolateMutator.ts","../src/Isolate/IsolateKeys.ts","../src/Isolate/IsolateSelectors.ts","../src/Reconciler.ts","../src/VestRuntime.ts","../src/Bus.ts","../src/Isolate/Isolate.ts","../src/IsolateWalker.ts","../src/exports/IsolateSerializer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,uLAAiB,CAAsB"}