@warp-drive-mirror/experiments 0.0.1-alpha.99 → 0.0.1-beta.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/README.md +2 -1
- package/dist/data-worker.js +124 -31
- package/dist/data-worker.js.map +1 -1
- package/dist/document-storage.js +1 -243
- package/dist/document-storage.js.map +1 -1
- package/dist/image-fetch.js +78 -0
- package/dist/image-fetch.js.map +1 -0
- package/dist/image-worker.js +98 -0
- package/dist/image-worker.js.map +1 -0
- package/dist/index-Cn3o840t.js +349 -0
- package/dist/index-Cn3o840t.js.map +1 -0
- package/dist/persisted-cache.js +19 -19
- package/dist/persisted-cache.js.map +1 -1
- package/dist/worker-fetch.js +24 -11
- package/dist/worker-fetch.js.map +1 -1
- package/package.json +37 -21
- package/unstable-preview-types/data-worker/cache-handler.d.ts.map +1 -1
- package/unstable-preview-types/data-worker/fetch.d.ts.map +1 -1
- package/unstable-preview-types/data-worker/worker.d.ts +11 -1
- package/unstable-preview-types/data-worker/worker.d.ts.map +1 -1
- package/unstable-preview-types/document-storage/index.d.ts +4 -1
- package/unstable-preview-types/document-storage/index.d.ts.map +1 -1
- package/unstable-preview-types/image-fetch.d.ts +4 -0
- package/unstable-preview-types/image-fetch.d.ts.map +1 -0
- package/unstable-preview-types/image-worker/fetch.d.ts +21 -0
- package/unstable-preview-types/image-worker/fetch.d.ts.map +1 -0
- package/unstable-preview-types/image-worker/types.d.ts +24 -0
- package/unstable-preview-types/image-worker/types.d.ts.map +1 -0
- package/unstable-preview-types/image-worker/worker.d.ts +20 -0
- package/unstable-preview-types/image-worker/worker.d.ts.map +1 -0
- package/unstable-preview-types/image-worker.d.ts +4 -0
- package/unstable-preview-types/image-worker.d.ts.map +1 -0
- package/unstable-preview-types/index.d.ts +13 -8
- package/unstable-preview-types/persisted-cache/cache.d.ts +19 -19
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
declare module '@warp-drive-mirror/experiments/data-worker/worker' {
|
|
2
2
|
import type { Future } from '@ember-data-mirror/request';
|
|
3
3
|
import type Store from '@ember-data-mirror/store';
|
|
4
|
+
import { DocumentStorage } from '@warp-drive-mirror/experiments/document-storage';
|
|
4
5
|
import type { AbortEventData, RequestEventData } from '@warp-drive-mirror/experiments/data-worker/types';
|
|
5
6
|
export class DataWorker {
|
|
6
7
|
store: Store;
|
|
7
8
|
threads: Map<string, MessagePort>;
|
|
8
9
|
pending: Map<string, Map<number, Future<unknown>>>;
|
|
9
|
-
|
|
10
|
+
isSharedWorker: boolean;
|
|
11
|
+
options: {
|
|
12
|
+
persisted: boolean;
|
|
13
|
+
scope?: string;
|
|
14
|
+
};
|
|
15
|
+
storage: DocumentStorage;
|
|
16
|
+
constructor(UserStore: typeof Store, options?: {
|
|
17
|
+
persisted: boolean;
|
|
18
|
+
scope?: string;
|
|
19
|
+
});
|
|
10
20
|
initialize(): void;
|
|
11
21
|
setupThread(thread: string, port: MessagePort): void;
|
|
12
22
|
abortRequest(event: AbortEventData): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../src/data-worker/worker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAwC,MAAM,qBAAqB,CAAC;AACxF,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAA0C,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../src/data-worker/worker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAwC,MAAM,qBAAqB,CAAC;AACxF,OAAO,KAAK,KAAK,MAAM,mBAAmB,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACtD,OAAO,KAAK,EAAE,cAAc,EAAE,gBAAgB,EAA0C,MAAM,SAAS,CAAC;AAIxG,qBAAa,UAAU;IACb,KAAK,EAAE,KAAK,CAAC;IACb,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAClC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACnD,cAAc,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAChD,OAAO,EAAE,eAAe,CAAC;gBAErB,SAAS,EAAE,OAAO,KAAK,EAAE,OAAO,CAAC,EAAE;QAAE,SAAS,EAAE,OAAO,CAAC;QAAC,KAAK,CAAC,EAAE,MAAM,CAAA;KAAE;IAarF,UAAU;IAkCV,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW;IAqB7C,YAAY,CAAC,KAAK,EAAE,cAAc;IAU5B,OAAO,CAAC,KAAK,EAAE,gBAAgB;CAkBtC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare module '@warp-drive-mirror/experiments/document-storage' {
|
|
2
2
|
import type { StructuredDocument } from '@ember-data-mirror/request';
|
|
3
3
|
import type { ExistingRecordIdentifier } from '@warp-drive-mirror/core-types/identifier';
|
|
4
|
-
import type { ResourceDocument } from '@warp-drive-mirror/core-types/spec/document';
|
|
4
|
+
import type { ResourceDataDocument, ResourceDocument } from '@warp-drive-mirror/core-types/spec/document';
|
|
5
5
|
import type { ExistingResourceObject } from '@warp-drive-mirror/core-types/spec/json-api-raw';
|
|
6
6
|
export const WARP_DRIVE_STORAGE_FILE_NAME = "warp-drive_document-storage";
|
|
7
7
|
export const WARP_DRIVE_STORAGE_VERSION = 1;
|
|
@@ -58,6 +58,8 @@ declare module '@warp-drive-mirror/experiments/document-storage' {
|
|
|
58
58
|
_patch(documentKey: string, document: CacheFileDocument, updatedResources: Map<string, ExistingResourceObject>): Promise<void>;
|
|
59
59
|
getDocument(key: DocumentIdentifier): Promise<CacheDocument | null>;
|
|
60
60
|
putDocument(document: CacheFileDocument, resourceCollector: (resourceIdentifier: ExistingRecordIdentifier) => ExistingResourceObject): Promise<void>;
|
|
61
|
+
_getResources(document: ResourceDataDocument<ExistingRecordIdentifier>, resourceCollector: (resourceIdentifier: ExistingRecordIdentifier) => ExistingResourceObject, resources?: Map<string, ExistingResourceObject>): Map<string, ExistingResourceObject>;
|
|
62
|
+
putResources(document: ResourceDataDocument<ExistingRecordIdentifier>, resourceCollector: (resourceIdentifier: ExistingRecordIdentifier) => ExistingResourceObject): Promise<void>;
|
|
61
63
|
clear(reset?: boolean): Promise<void>;
|
|
62
64
|
}
|
|
63
65
|
/**
|
|
@@ -83,6 +85,7 @@ declare module '@warp-drive-mirror/experiments/document-storage' {
|
|
|
83
85
|
constructor(options?: Partial<DocumentStorageOptions>);
|
|
84
86
|
getDocument(key: DocumentIdentifier): Promise<CacheDocument | null>;
|
|
85
87
|
putDocument(document: CacheFileDocument, resourceCollector: (resourceIdentifier: ExistingRecordIdentifier) => ExistingResourceObject): Promise<void>;
|
|
88
|
+
putResources(document: ResourceDataDocument<ExistingRecordIdentifier>, resourceCollector: (resourceIdentifier: ExistingRecordIdentifier) => ExistingResourceObject): Promise<void>;
|
|
86
89
|
clear(reset?: boolean): Promise<void>;
|
|
87
90
|
}
|
|
88
91
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/document-storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/document-storage/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAA6B,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAGzF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAClF,OAAO,KAAK,EAAE,oBAAoB,EAAE,gBAAgB,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}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-fetch.d.ts","sourceRoot":"","sources":["../src/image-fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
declare module '@warp-drive-mirror/experiments/image-worker/fetch' {
|
|
2
|
+
import type { Deferred } from '@ember-data-mirror/request/-private/types';
|
|
3
|
+
import type { RequestEventData } from '@warp-drive-mirror/experiments/image-worker/types';
|
|
4
|
+
export interface FastBoot {
|
|
5
|
+
require(moduleName: string): unknown;
|
|
6
|
+
isFastBoot: boolean;
|
|
7
|
+
request: Request;
|
|
8
|
+
}
|
|
9
|
+
export class ImageFetch {
|
|
10
|
+
worker: Worker | SharedWorker;
|
|
11
|
+
threadId: string;
|
|
12
|
+
pending: Map<string, Deferred<string>>;
|
|
13
|
+
channel: MessageChannel;
|
|
14
|
+
cache: Map<string, string>;
|
|
15
|
+
constructor(worker: Worker | SharedWorker | null);
|
|
16
|
+
cleanupRequest(url: string): Deferred<string> | undefined;
|
|
17
|
+
_send(event: RequestEventData): void;
|
|
18
|
+
load(url: string): Promise<string>;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
//# sourceMappingURL=fetch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/image-worker/fetch.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,oCAAoC,CAAC;AAInE,OAAO,KAAK,EAAmB,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAEjE,MAAM,WAAW,QAAQ;IACvB,OAAO,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC;IACrC,UAAU,EAAE,OAAO,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;CAClB;AAID,qBAAa,UAAU;IACb,MAAM,EAAE,MAAM,GAAG,YAAY,CAAC;IAC9B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IACvC,OAAO,EAAE,cAAc,CAAC;IACxB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAEvB,MAAM,EAAE,MAAM,GAAG,YAAY,GAAG,IAAI;IAwChD,cAAc,CAAC,GAAG,EAAE,MAAM;IAO1B,KAAK,CAAC,KAAK,EAAE,gBAAgB;IAK7B,IAAI,CAAC,GAAG,EAAE,MAAM;CAejB"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare module '@warp-drive-mirror/experiments/image-worker/types' {
|
|
2
|
+
export type SuccessResponseEventData = {
|
|
3
|
+
type: 'success-response';
|
|
4
|
+
thread: string;
|
|
5
|
+
url: string;
|
|
6
|
+
};
|
|
7
|
+
export type ErrorResponseEventData = {
|
|
8
|
+
type: 'error-response';
|
|
9
|
+
thread: string;
|
|
10
|
+
url: string;
|
|
11
|
+
};
|
|
12
|
+
export type RequestEventData = {
|
|
13
|
+
type: 'load';
|
|
14
|
+
thread: string;
|
|
15
|
+
url: string;
|
|
16
|
+
};
|
|
17
|
+
export type ThreadInitEventData = {
|
|
18
|
+
type: 'connect';
|
|
19
|
+
thread: string;
|
|
20
|
+
};
|
|
21
|
+
export type MainThreadEvent = MessageEvent<SuccessResponseEventData | ErrorResponseEventData>;
|
|
22
|
+
export type WorkerThreadEvent = MessageEvent<RequestEventData> | MessageEvent<ThreadInitEventData>;
|
|
23
|
+
}
|
|
24
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/image-worker/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,wBAAwB,GAAG;IACrC,IAAI,EAAE,kBAAkB,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AACF,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,gBAAgB,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,YAAY,CAAC,wBAAwB,GAAG,sBAAsB,CAAC,CAAC;AAC9F,MAAM,MAAM,iBAAiB,GAAG,YAAY,CAAC,gBAAgB,CAAC,GAAG,YAAY,CAAC,mBAAmB,CAAC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare module '@warp-drive-mirror/experiments/image-worker/worker' {
|
|
2
|
+
import type { RequestEventData } from '@warp-drive-mirror/experiments/image-worker/types';
|
|
3
|
+
export class ImageWorker {
|
|
4
|
+
threads: Map<string, MessagePort>;
|
|
5
|
+
pendingImages: Map<string, Promise<string>>;
|
|
6
|
+
options: {
|
|
7
|
+
persisted: boolean;
|
|
8
|
+
};
|
|
9
|
+
isSharedWorker: boolean;
|
|
10
|
+
cache: Map<string, string>;
|
|
11
|
+
constructor(options?: {
|
|
12
|
+
persisted: boolean;
|
|
13
|
+
});
|
|
14
|
+
fetch(url: string): Promise<string>;
|
|
15
|
+
initialize(): void;
|
|
16
|
+
setupThread(thread: string, port: MessagePort): void;
|
|
17
|
+
request(event: RequestEventData): Promise<void>;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=worker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"worker.d.ts","sourceRoot":"","sources":["../../src/image-worker/worker.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAA0C,MAAM,SAAS,CAAC;AAUxF,qBAAa,WAAW;IACd,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,WAAW,CAAC,CAAC;IAClC,aAAa,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC;IAC5C,OAAO,EAAE;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE,CAAC;IAChC,cAAc,EAAE,OAAO,CAAC;IACxB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;gBAEvB,OAAO,CAAC,EAAE;QAAE,SAAS,EAAE,OAAO,CAAA;KAAE;IAa5C,KAAK,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAmBnC,UAAU;IA4BV,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW;IAiBvC,OAAO,CAAC,KAAK,EAAE,gBAAgB;CAOtC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image-worker.d.ts","sourceRoot":"","sources":["../src/image-worker.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC"}
|
|
@@ -1,13 +1,18 @@
|
|
|
1
|
-
/// <reference path="./
|
|
1
|
+
/// <reference path="./image-fetch.d.ts" />
|
|
2
2
|
/// <reference path="./data-worker.d.ts" />
|
|
3
|
-
/// <reference path="./
|
|
3
|
+
/// <reference path="./image-worker.d.ts" />
|
|
4
4
|
/// <reference path="./worker-fetch.d.ts" />
|
|
5
|
+
/// <reference path="./document-storage.d.ts" />
|
|
6
|
+
/// <reference path="./persisted-cache.d.ts" />
|
|
7
|
+
/// <reference path="./persisted-cache/db.d.ts" />
|
|
8
|
+
/// <reference path="./persisted-cache/cache.d.ts" />
|
|
9
|
+
/// <reference path="./persisted-cache/fetch.d.ts" />
|
|
10
|
+
/// <reference path="./document-storage/index.d.ts" />
|
|
5
11
|
/// <reference path="./data-worker/worker.d.ts" />
|
|
6
|
-
/// <reference path="./data-worker/fetch.d.ts" />
|
|
7
|
-
/// <reference path="./data-worker/types.d.ts" />
|
|
8
12
|
/// <reference path="./data-worker/cache-handler.d.ts" />
|
|
9
13
|
/// <reference path="./data-worker/utils.d.ts" />
|
|
10
|
-
/// <reference path="./
|
|
11
|
-
/// <reference path="./
|
|
12
|
-
/// <reference path="./
|
|
13
|
-
/// <reference path="./
|
|
14
|
+
/// <reference path="./data-worker/types.d.ts" />
|
|
15
|
+
/// <reference path="./data-worker/fetch.d.ts" />
|
|
16
|
+
/// <reference path="./image-worker/worker.d.ts" />
|
|
17
|
+
/// <reference path="./image-worker/types.d.ts" />
|
|
18
|
+
/// <reference path="./image-worker/fetch.d.ts" />
|
|
@@ -44,7 +44,7 @@ declare module '@warp-drive-mirror/experiments/persisted-cache/cache' {
|
|
|
44
44
|
*
|
|
45
45
|
* @method put
|
|
46
46
|
* @param {StructuredDocument} doc
|
|
47
|
-
* @
|
|
47
|
+
* @return {ResourceDocument}
|
|
48
48
|
* @internal
|
|
49
49
|
*/
|
|
50
50
|
put<T>(doc: StructuredDocument<T> | {
|
|
@@ -59,7 +59,7 @@ declare module '@warp-drive-mirror/experiments/persisted-cache/cache' {
|
|
|
59
59
|
* @method patch
|
|
60
60
|
* @internal
|
|
61
61
|
* @param op the operation to perform
|
|
62
|
-
* @
|
|
62
|
+
* @return {void}
|
|
63
63
|
*/
|
|
64
64
|
patch(op: Operation): void;
|
|
65
65
|
/**
|
|
@@ -101,7 +101,7 @@ declare module '@warp-drive-mirror/experiments/persisted-cache/cache' {
|
|
|
101
101
|
* @method peek
|
|
102
102
|
* @internal
|
|
103
103
|
* @param {StableRecordIdentifier | StableDocumentIdentifier} identifier
|
|
104
|
-
* @
|
|
104
|
+
* @return {ResourceDocument | ResourceBlob | null} the known resource data
|
|
105
105
|
*/
|
|
106
106
|
peek<T = unknown>(identifier: StableRecordIdentifier<TypeFromInstanceOrString<T>>): T | null;
|
|
107
107
|
peek(identifier: StableDocumentIdentifier): ResourceDocument | null;
|
|
@@ -111,7 +111,7 @@ declare module '@warp-drive-mirror/experiments/persisted-cache/cache' {
|
|
|
111
111
|
*
|
|
112
112
|
* @method peekRequest
|
|
113
113
|
* @param {StableDocumentIdentifier}
|
|
114
|
-
* @
|
|
114
|
+
* @return {StableDocumentIdentifier | null}
|
|
115
115
|
* @internal
|
|
116
116
|
*/
|
|
117
117
|
peekRequest(identifier: StableDocumentIdentifier): StructuredDocument<ResourceDocument> | null;
|
|
@@ -123,7 +123,7 @@ declare module '@warp-drive-mirror/experiments/persisted-cache/cache' {
|
|
|
123
123
|
* @param identifier
|
|
124
124
|
* @param data
|
|
125
125
|
* @param hasRecord
|
|
126
|
-
* @
|
|
126
|
+
* @return {void | string[]} if `hasRecord` is true then calculated key changes should be returned
|
|
127
127
|
*/
|
|
128
128
|
upsert(identifier: StableRecordIdentifier, data: ResourceBlob, hasRecord: boolean): void | string[];
|
|
129
129
|
/**
|
|
@@ -135,7 +135,7 @@ declare module '@warp-drive-mirror/experiments/persisted-cache/cache' {
|
|
|
135
135
|
*
|
|
136
136
|
* @method fork
|
|
137
137
|
* @internal
|
|
138
|
-
* @
|
|
138
|
+
* @return Promise<Cache>
|
|
139
139
|
*/
|
|
140
140
|
fork(): Promise<Cache>;
|
|
141
141
|
/**
|
|
@@ -148,7 +148,7 @@ declare module '@warp-drive-mirror/experiments/persisted-cache/cache' {
|
|
|
148
148
|
* @method merge
|
|
149
149
|
* @param {Cache} cache
|
|
150
150
|
* @internal
|
|
151
|
-
* @
|
|
151
|
+
* @return Promise<void>
|
|
152
152
|
*/
|
|
153
153
|
merge(cache: Cache): Promise<void>;
|
|
154
154
|
/**
|
|
@@ -191,7 +191,7 @@ declare module '@warp-drive-mirror/experiments/persisted-cache/cache' {
|
|
|
191
191
|
* via `cache.hydrate`.
|
|
192
192
|
*
|
|
193
193
|
* @method dump
|
|
194
|
-
* @
|
|
194
|
+
* @return {Promise<ReadableStream>}
|
|
195
195
|
* @internal
|
|
196
196
|
*/
|
|
197
197
|
dump(): Promise<ReadableStream<unknown>>;
|
|
@@ -209,7 +209,7 @@ declare module '@warp-drive-mirror/experiments/persisted-cache/cache' {
|
|
|
209
209
|
*
|
|
210
210
|
* @method hydrate
|
|
211
211
|
* @param {ReadableStream} stream
|
|
212
|
-
* @
|
|
212
|
+
* @return {Promise<void>}
|
|
213
213
|
* @internal
|
|
214
214
|
*/
|
|
215
215
|
hydrate(stream: ReadableStream<unknown>): Promise<void>;
|
|
@@ -270,7 +270,7 @@ declare module '@warp-drive-mirror/experiments/persisted-cache/cache' {
|
|
|
270
270
|
* @internal
|
|
271
271
|
* @param identifier
|
|
272
272
|
* @param propertyName
|
|
273
|
-
* @
|
|
273
|
+
* @return {unknown}
|
|
274
274
|
*/
|
|
275
275
|
getAttr(identifier: StableRecordIdentifier, field: string): Value | undefined;
|
|
276
276
|
/**
|
|
@@ -289,7 +289,7 @@ declare module '@warp-drive-mirror/experiments/persisted-cache/cache' {
|
|
|
289
289
|
* @method changedAttrs
|
|
290
290
|
* @internal
|
|
291
291
|
* @param identifier
|
|
292
|
-
* @
|
|
292
|
+
* @return
|
|
293
293
|
*/
|
|
294
294
|
changedAttrs(identifier: StableRecordIdentifier): ChangedAttributesHash;
|
|
295
295
|
/**
|
|
@@ -298,7 +298,7 @@ declare module '@warp-drive-mirror/experiments/persisted-cache/cache' {
|
|
|
298
298
|
* @method hasChangedAttrs
|
|
299
299
|
* @internal
|
|
300
300
|
* @param identifier
|
|
301
|
-
* @
|
|
301
|
+
* @return {boolean}
|
|
302
302
|
*/
|
|
303
303
|
hasChangedAttrs(identifier: StableRecordIdentifier): boolean;
|
|
304
304
|
/**
|
|
@@ -307,7 +307,7 @@ declare module '@warp-drive-mirror/experiments/persisted-cache/cache' {
|
|
|
307
307
|
* @method rollbackAttrs
|
|
308
308
|
* @internal
|
|
309
309
|
* @param identifier
|
|
310
|
-
* @
|
|
310
|
+
* @return the names of attributes that were restored
|
|
311
311
|
*/
|
|
312
312
|
rollbackAttrs(identifier: StableRecordIdentifier): string[];
|
|
313
313
|
/**
|
|
@@ -367,7 +367,7 @@ declare module '@warp-drive-mirror/experiments/persisted-cache/cache' {
|
|
|
367
367
|
* @internal
|
|
368
368
|
* @param identifier
|
|
369
369
|
* @param propertyName
|
|
370
|
-
* @
|
|
370
|
+
* @return resource relationship object
|
|
371
371
|
*/
|
|
372
372
|
getRelationship(identifier: StableRecordIdentifier, field: string, isCollection?: boolean): ResourceRelationship | CollectionRelationship;
|
|
373
373
|
/**
|
|
@@ -386,7 +386,7 @@ declare module '@warp-drive-mirror/experiments/persisted-cache/cache' {
|
|
|
386
386
|
* @method getErrors
|
|
387
387
|
* @internal
|
|
388
388
|
* @param identifier
|
|
389
|
-
* @
|
|
389
|
+
* @return
|
|
390
390
|
*/
|
|
391
391
|
getErrors(identifier: StableRecordIdentifier): ApiError[];
|
|
392
392
|
/**
|
|
@@ -395,7 +395,7 @@ declare module '@warp-drive-mirror/experiments/persisted-cache/cache' {
|
|
|
395
395
|
* @method isEmpty
|
|
396
396
|
* @internal
|
|
397
397
|
* @param identifier
|
|
398
|
-
* @
|
|
398
|
+
* @return {boolean}
|
|
399
399
|
*/
|
|
400
400
|
isEmpty(identifier: StableRecordIdentifier): boolean;
|
|
401
401
|
/**
|
|
@@ -405,7 +405,7 @@ declare module '@warp-drive-mirror/experiments/persisted-cache/cache' {
|
|
|
405
405
|
* @method isNew
|
|
406
406
|
* @internal
|
|
407
407
|
* @param identifier
|
|
408
|
-
* @
|
|
408
|
+
* @return {boolean}
|
|
409
409
|
*/
|
|
410
410
|
isNew(identifier: StableRecordIdentifier): boolean;
|
|
411
411
|
/**
|
|
@@ -415,7 +415,7 @@ declare module '@warp-drive-mirror/experiments/persisted-cache/cache' {
|
|
|
415
415
|
* @method isDeleted
|
|
416
416
|
* @internal
|
|
417
417
|
* @param identifier
|
|
418
|
-
* @
|
|
418
|
+
* @return {boolean}
|
|
419
419
|
*/
|
|
420
420
|
isDeleted(identifier: StableRecordIdentifier): boolean;
|
|
421
421
|
/**
|
|
@@ -425,7 +425,7 @@ declare module '@warp-drive-mirror/experiments/persisted-cache/cache' {
|
|
|
425
425
|
* @method isDeletionCommitted
|
|
426
426
|
* @internal
|
|
427
427
|
* @param identifier
|
|
428
|
-
* @
|
|
428
|
+
* @return {boolean}
|
|
429
429
|
*/
|
|
430
430
|
isDeletionCommitted(identifier: StableRecordIdentifier): boolean;
|
|
431
431
|
}
|