@dreamkit/app 0.0.45 → 0.0.47

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/EJSON.d.ts CHANGED
@@ -8,6 +8,10 @@ export type BlobRef = {
8
8
  size: number;
9
9
  };
10
10
  export type BlobRefs = Record<number, BlobRef>;
11
+ export type EJSONDecodeOptions = {
12
+ blobRefs?: BlobRefs;
13
+ onDecoded?: (input: any) => void;
14
+ };
11
15
  export declare class EJSON {
12
16
  #private;
13
17
  get serializers(): readonly Serializer[];
@@ -16,11 +20,8 @@ export declare class EJSON {
16
20
  remove(name: string): void;
17
21
  clear(): void;
18
22
  encode(input: any, blobs?: Blob[]): any;
19
- decode(input: any, options?: {
20
- blobRefs?: BlobRefs;
21
- onDecoded?: (input: any) => void;
22
- }): any;
23
- parse(input: string): any;
24
- stringify(value: any): string;
23
+ decode(input: any, options?: EJSONDecodeOptions): any;
24
+ parse(input: string, options?: EJSONDecodeOptions): any;
25
+ stringify(value: any, blobs?: Blob[]): string;
25
26
  }
26
27
  //# sourceMappingURL=EJSON.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EJSON.d.ts","sourceRoot":"","sources":["../src/EJSON.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAG7D,MAAM,MAAM,kBAAkB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,GAAG,CAAA;CAAE,CAAC;AACjE,MAAM,MAAM,OAAO,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AACrD,MAAM,MAAM,QAAQ,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAQ/C,qBAAa,KAAK;;IAGhB,IAAI,WAAW,IAAI,SAAS,UAAU,EAAE,CAMvC;gBACW,WAAW,EAAE,UAAU,EAAE;IAGrC,GAAG,CAA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IAAI,EAAO,GAAG,GAAG;IAqB3C,MAAM,CAAC,KAAK,EAAE,GAAG,EAAE,OAAO,GAAE,kBAAuB,GAAG,GAAG;IAwBzD,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,GAAE,kBAAuB,GAAG,GAAG;IAI3D,SAAS,CAAC,KAAK,EAAE,GAAG,EAAE,KAAK,GAAE,IAAI,EAAO,GAAG,MAAM;CAIlD"}
package/lib/EJSON.js CHANGED
@@ -30,12 +30,12 @@ export class EJSON {
30
30
  if (isPlainObject(input)) {
31
31
  const object = {};
32
32
  for (const key in input) {
33
- object[key] = this.encode(input[key]);
33
+ object[key] = this.encode(input[key], blobs);
34
34
  }
35
35
  return object;
36
36
  }
37
37
  else if (Array.isArray(input)) {
38
- return input.map((item) => this.encode(item));
38
+ return input.map((item) => this.encode(item, blobs));
39
39
  }
40
40
  else if (typeof input === "object" && input !== null) {
41
41
  for (const serializer of this.serializers) {
@@ -73,12 +73,12 @@ export class EJSON {
73
73
  return input;
74
74
  }
75
75
  }
76
- parse(input) {
76
+ parse(input, options = {}) {
77
77
  const json = JSON.parse(input);
78
- return this.decode(json);
78
+ return this.decode(json, options);
79
79
  }
80
- stringify(value) {
81
- const ejson = this.encode(value);
80
+ stringify(value, blobs = []) {
81
+ const ejson = this.encode(value, blobs);
82
82
  return JSON.stringify(ejson);
83
83
  }
84
84
  }
package/lib/LazyFile.d.ts CHANGED
@@ -4,7 +4,7 @@ export declare class LazyFile extends File {
4
4
  readonly ref: BlobRef;
5
5
  protected options: FilePropertyBag;
6
6
  protected handler?: StorageHandler | undefined;
7
- constructor(ref: BlobRef, name: string, options: FilePropertyBag, handler?: StorageHandler | undefined);
7
+ constructor(ref: BlobRef, name: string, options?: FilePropertyBag, handler?: StorageHandler | undefined);
8
8
  get size(): number;
9
9
  text(): Promise<string>;
10
10
  arrayBuffer(): Promise<ArrayBuffer>;
@@ -1 +1 @@
1
- {"version":3,"file":"LazyFile.d.ts","sourceRoot":"","sources":["../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MAAM,IAAI,cAAc,CAAC,UAAU,CAAC,WAAW,CAAC,CAAC;IAIjD,KAAK,IAAI,IAAI;IAItB,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC,IAAI,MAAM,CAEjC;CACF"}
package/lib/LazyFile.js CHANGED
@@ -6,7 +6,7 @@ export class LazyFile extends File {
6
6
  static {
7
7
  kindApp(this, "LazyFile");
8
8
  }
9
- constructor(ref, name, options, handler) {
9
+ constructor(ref, name, options = {}, handler) {
10
10
  super([], name, options);
11
11
  this.ref = ref;
12
12
  this.options = options;
@@ -4,6 +4,6 @@ export declare const kindStorageHandler: (input: object, name?: string) => void,
4
4
  export declare abstract class StorageHandler {
5
5
  abstract read(path: string): Promise<ArrayBuffer>;
6
6
  abstract stream(path: string): ReadableStream<Uint8Array>;
7
- abstract moveTo(path: string): Promise<void>;
7
+ abstract move(source: File | string, target: string): Promise<void>;
8
8
  }
9
9
  //# sourceMappingURL=StorageHandler.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"StorageHandler.d.ts","sourceRoot":"","sources":["../../src/handlers/StorageHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,MAAM,MAAM,yBAAyB,GAAG,WAAW,CAAC,cAAc,CAAC,CAAC;AAEpE,eAAO,MAAO,kBAAkB,0CAAE,gBAAgB,wDACqB,CAAC;AAExE,8BAAsB,cAAc;IAIlC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IACjD,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC;IACzD,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAC7C"}
1
+ {"version":3,"file":"StorageHandler.d.ts","sourceRoot":"","sources":["../../src/handlers/StorageHandler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAEpD,MAAM,MAAM,yBAAyB,GAAG,WAAW,CAAC,cAAc,CAAC,CAAC;AAEpE,eAAO,MAAO,kBAAkB,0CAAE,gBAAgB,wDACqB,CAAC;AAExE,8BAAsB,cAAc;IAIlC,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,CAAC;IACjD,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC;IACzD,QAAQ,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,GAAG,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CACpE"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dreamkit/app",
3
- "version": "0.0.45",
3
+ "version": "0.0.47",
4
4
  "description": "Set of utils to create applications.",
5
5
  "homepage": "https://dreamkit.dev",
6
6
  "repository": {
@@ -28,8 +28,8 @@
28
28
  ],
29
29
  "dependencies": {
30
30
  "debug": "^4.4.3",
31
- "@dreamkit/func": "0.0.29",
32
- "@dreamkit/ioc": "0.4.1",
31
+ "@dreamkit/func": "0.0.30",
32
+ "@dreamkit/ioc": "0.5.0",
33
33
  "@dreamkit/kind": "0.0.6",
34
34
  "@dreamkit/schema": "0.0.23",
35
35
  "@dreamkit/utils": "0.0.10"