@drupflare/spool 0.3.0 → 1.0.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.
- package/README.md +279 -1607
- package/dist/angular/index.d.ts +13 -0
- package/dist/angular/index.js +25 -0
- package/dist/angular/pages.d.ts +28 -0
- package/dist/angular/pages.js +85 -0
- package/dist/cdn/client.js +1 -1
- package/dist/cdn/location.d.ts +6 -0
- package/dist/cdn/location.js +8 -0
- package/dist/cdn/manifest.json +7 -7
- package/dist/cdn/spool-sw.js +1 -1
- package/dist/client/bootstrap.d.ts +57 -0
- package/dist/client/bootstrap.js +307 -0
- package/dist/client/contact.d.ts +24 -0
- package/dist/client/contact.js +66 -0
- package/dist/client/declared.d.ts +23 -0
- package/dist/client/declared.js +68 -0
- package/dist/client/entry.js +123 -2
- package/dist/client/gate.d.ts +1 -0
- package/dist/client/gate.js +148 -0
- package/dist/client/index.d.ts +25 -0
- package/dist/client/index.js +1 -0
- package/dist/client/live.d.ts +66 -0
- package/dist/client/live.js +225 -0
- package/dist/client/navigate-entry.d.ts +1 -0
- package/dist/client/navigate-entry.js +4 -0
- package/dist/client/navigate.d.ts +54 -0
- package/dist/client/navigate.js +272 -0
- package/dist/client/persist.d.ts +2 -0
- package/dist/client/persist.js +9 -0
- package/dist/client/register.d.ts +34 -2
- package/dist/client/register.js +64 -7
- package/dist/express/index.d.ts +11 -0
- package/dist/express/index.js +209 -0
- package/dist/hono/index.d.ts +19 -0
- package/dist/hono/index.js +49 -0
- package/dist/next/index.d.ts +33 -0
- package/dist/next/index.js +41 -0
- package/dist/next/pages.d.ts +22 -0
- package/dist/next/pages.js +39 -0
- package/dist/node/listener.d.ts +3 -0
- package/dist/node/listener.js +57 -2
- package/dist/nuxt/index.d.ts +22 -0
- package/dist/nuxt/index.js +104 -0
- package/dist/nuxt/pages.d.ts +26 -0
- package/dist/nuxt/pages.js +48 -0
- package/dist/nuxt/runtime/index.d.ts +24 -0
- package/dist/nuxt/runtime/index.js +58 -0
- package/dist/plugins/coverage.d.ts +14 -0
- package/dist/plugins/coverage.js +27 -0
- package/dist/plugins/mode.d.ts +19 -0
- package/dist/plugins/mode.js +20 -0
- package/dist/plugins/path.d.ts +16 -0
- package/dist/plugins/path.js +139 -0
- package/dist/plugins/report.d.ts +22 -0
- package/dist/plugins/report.js +18 -0
- package/dist/plugins/routes.d.ts +38 -0
- package/dist/plugins/routes.js +52 -0
- package/dist/plugins/static.d.ts +42 -0
- package/dist/plugins/static.js +97 -0
- package/dist/protocol/bundle.d.ts +111 -0
- package/dist/protocol/bundle.js +428 -0
- package/dist/protocol/config.d.ts +80 -1
- package/dist/protocol/config.js +31 -1
- package/dist/protocol/dataset.d.ts +189 -0
- package/dist/protocol/dataset.js +212 -0
- package/dist/protocol/envelope.d.ts +34 -1
- package/dist/protocol/envelope.js +16 -1
- package/dist/protocol/errors.d.ts +1 -1
- package/dist/protocol/graph.d.ts +23 -4
- package/dist/protocol/graph.js +34 -3
- package/dist/protocol/index-rows.d.ts +22 -0
- package/dist/protocol/index-rows.js +53 -0
- package/dist/protocol/index.d.ts +5 -0
- package/dist/protocol/index.js +5 -0
- package/dist/protocol/normalise.d.ts +4 -4
- package/dist/protocol/normalise.js +9 -5
- package/dist/protocol/plan.d.ts +100 -0
- package/dist/protocol/plan.js +661 -0
- package/dist/protocol/provision.d.ts +46 -0
- package/dist/protocol/provision.js +38 -0
- package/dist/protocol/query.d.ts +66 -5
- package/dist/protocol/query.js +103 -4
- package/dist/protocol/ring.d.ts +58 -0
- package/dist/protocol/ring.js +6 -0
- package/dist/protocol/route.d.ts +63 -13
- package/dist/protocol/route.js +126 -6
- package/dist/protocol/tag.d.ts +22 -2
- package/dist/protocol/tag.js +25 -4
- package/dist/protocol/view.d.ts +2 -0
- package/dist/protocol/view.js +8 -2
- package/dist/protocol/views.d.ts +6 -0
- package/dist/protocol/views.js +15 -0
- package/dist/protocol/write.d.ts +234 -0
- package/dist/protocol/write.js +343 -0
- package/dist/proxy/eligible.d.ts +22 -1
- package/dist/proxy/eligible.js +62 -15
- package/dist/proxy/proxy.js +28 -18
- package/dist/react-router/index.d.ts +20 -0
- package/dist/react-router/index.js +60 -0
- package/dist/react-router/pages.d.ts +34 -0
- package/dist/react-router/pages.js +83 -0
- package/dist/report/dataset.d.ts +48 -0
- package/dist/report/dataset.js +93 -0
- package/dist/report/demand.d.ts +49 -0
- package/dist/report/demand.js +60 -0
- package/dist/report/derive.d.ts +285 -0
- package/dist/report/derive.js +676 -1
- package/dist/report/economics.d.ts +66 -1
- package/dist/report/economics.js +208 -1
- package/dist/report/headline.d.ts +158 -0
- package/dist/report/headline.js +473 -0
- package/dist/report/index.d.ts +4 -0
- package/dist/report/index.js +4 -0
- package/dist/report/inputs.d.ts +176 -0
- package/dist/report/inputs.js +248 -0
- package/dist/report/institution.d.ts +188 -1
- package/dist/report/institution.js +146 -0
- package/dist/report/loops.d.ts +73 -0
- package/dist/report/loops.js +101 -0
- package/dist/report/measurement.d.ts +1 -1
- package/dist/report/measurement.js +7 -1
- package/dist/report/model.d.ts +2 -0
- package/dist/report/model.js +4 -0
- package/dist/report/thirdparty.d.ts +57 -0
- package/dist/report/thirdparty.js +111 -0
- package/dist/report/traffic.d.ts +8 -0
- package/dist/report/traffic.js +7 -0
- package/dist/report/trim.d.ts +56 -0
- package/dist/report/trim.js +83 -1
- package/dist/server/bundle.d.ts +55 -0
- package/dist/server/bundle.js +172 -0
- package/dist/server/dataset.d.ts +54 -0
- package/dist/server/dataset.js +355 -0
- package/dist/server/embedded.d.ts +7 -3
- package/dist/server/embedded.js +7 -3
- package/dist/server/index.d.ts +6 -0
- package/dist/server/index.js +6 -0
- package/dist/server/live-sockets.d.ts +54 -0
- package/dist/server/live-sockets.js +131 -0
- package/dist/server/live.d.ts +146 -0
- package/dist/server/live.js +228 -0
- package/dist/server/ring.d.ts +77 -0
- package/dist/server/ring.js +311 -0
- package/dist/server/spool.d.ts +158 -3
- package/dist/server/spool.js +578 -41
- package/dist/server/static.d.ts +42 -0
- package/dist/server/static.js +29 -0
- package/dist/server/stub.d.ts +43 -5
- package/dist/server/stub.js +126 -8
- package/dist/server/write.d.ts +49 -0
- package/dist/server/write.js +223 -0
- package/dist/stores/durable-object.d.ts +46 -0
- package/dist/stores/durable-object.js +114 -0
- package/dist/sw/analytics.d.ts +7 -1
- package/dist/sw/analytics.js +16 -2
- package/dist/sw/coverage.d.ts +6 -0
- package/dist/sw/coverage.js +34 -0
- package/dist/sw/dataset-sync.d.ts +76 -0
- package/dist/sw/dataset-sync.js +149 -0
- package/dist/sw/dataset.d.ts +91 -0
- package/dist/sw/dataset.js +318 -0
- package/dist/sw/family.d.ts +15 -0
- package/dist/sw/family.js +48 -0
- package/dist/sw/graph/index.d.ts +31 -1
- package/dist/sw/graph/index.js +57 -5
- package/dist/sw/graph/invalidate.d.ts +15 -3
- package/dist/sw/graph/invalidate.js +42 -4
- package/dist/sw/idb.d.ts +2 -0
- package/dist/sw/idb.js +80 -11
- package/dist/sw/index.d.ts +2 -0
- package/dist/sw/index.js +1 -0
- package/dist/sw/pack/store.d.ts +128 -0
- package/dist/sw/pack/store.js +737 -0
- package/dist/sw/partition.d.ts +6 -1
- package/dist/sw/partition.js +21 -2
- package/dist/sw/policy.d.ts +2 -0
- package/dist/sw/policy.js +11 -0
- package/dist/sw/principal-dataset.d.ts +64 -0
- package/dist/sw/principal-dataset.js +254 -0
- package/dist/sw/probe.d.ts +16 -0
- package/dist/sw/probe.js +25 -0
- package/dist/sw/render.d.ts +7 -2
- package/dist/sw/render.js +19 -5
- package/dist/sw/replica.d.ts +12 -3
- package/dist/sw/replica.js +40 -5
- package/dist/sw/router.d.ts +3 -2
- package/dist/sw/router.js +15 -2
- package/dist/sw/runtime.d.ts +90 -2
- package/dist/sw/runtime.js +857 -61
- package/dist/sw/scheduler.d.ts +6 -1
- package/dist/sw/scheduler.js +22 -5
- package/dist/sw/seal.d.ts +13 -0
- package/dist/sw/seal.js +13 -4
- package/dist/sw/static.d.ts +18 -0
- package/dist/sw/static.js +84 -1
- package/dist/sw/storage.d.ts +51 -1
- package/dist/sw/storage.js +33 -1
- package/dist/sw/write.d.ts +147 -0
- package/dist/sw/write.js +625 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -2
- package/dist/vite/index.d.ts +26 -0
- package/dist/vite/index.js +66 -0
- package/dist/vue/index.d.ts +36 -0
- package/dist/vue/index.js +53 -0
- package/package.json +65 -4
package/dist/sw/idb.js
CHANGED
|
@@ -4,15 +4,17 @@ const META = 'meta';
|
|
|
4
4
|
const BEACONS = 'beacons';
|
|
5
5
|
const RECORDS = 'records';
|
|
6
6
|
const PROJECTIONS = 'projections';
|
|
7
|
+
const DATASET_ROWS = 'datasetRows';
|
|
8
|
+
const DATASET_META = 'datasetMeta';
|
|
7
9
|
const META_KEY = 'replica';
|
|
8
10
|
const FLUSH_KEY = 'flush';
|
|
9
|
-
function wrap(request) {
|
|
11
|
+
export function wrap(request) {
|
|
10
12
|
return new Promise((resolve, reject) => {
|
|
11
13
|
request.onsuccess = () => resolve(request.result);
|
|
12
14
|
request.onerror = () => reject(request.error);
|
|
13
15
|
});
|
|
14
16
|
}
|
|
15
|
-
function done(tx) {
|
|
17
|
+
export function done(tx) {
|
|
16
18
|
return new Promise((resolve, reject) => {
|
|
17
19
|
tx.oncomplete = () => resolve();
|
|
18
20
|
tx.onerror = () => reject(tx.error);
|
|
@@ -25,6 +27,7 @@ function done(tx) {
|
|
|
25
27
|
*/
|
|
26
28
|
export function idbStorage(factory = indexedDB, name = NAME) {
|
|
27
29
|
let opened;
|
|
30
|
+
let openedSets;
|
|
28
31
|
const open = () => (opened ??= new Promise((resolve, reject) => {
|
|
29
32
|
const request = factory.open(name, 2);
|
|
30
33
|
request.onupgradeneeded = () => {
|
|
@@ -51,8 +54,26 @@ export function idbStorage(factory = indexedDB, name = NAME) {
|
|
|
51
54
|
};
|
|
52
55
|
request.onerror = () => reject(request.error);
|
|
53
56
|
}));
|
|
54
|
-
|
|
55
|
-
|
|
57
|
+
// datasets get their own database: an older worker opens `name` at version 2 and fails on a higher one
|
|
58
|
+
const openSets = () => (openedSets ??= new Promise((resolve, reject) => {
|
|
59
|
+
const request = factory.open(`${name}-datasets`, 1);
|
|
60
|
+
request.onupgradeneeded = () => {
|
|
61
|
+
const db = request.result;
|
|
62
|
+
db.createObjectStore(DATASET_ROWS, { keyPath: ['name', 'key'] });
|
|
63
|
+
db.createObjectStore(DATASET_META, { keyPath: 'name' });
|
|
64
|
+
};
|
|
65
|
+
request.onsuccess = () => {
|
|
66
|
+
const db = request.result;
|
|
67
|
+
db.onversionchange = () => {
|
|
68
|
+
db.close();
|
|
69
|
+
openedSets = undefined;
|
|
70
|
+
};
|
|
71
|
+
resolve(db);
|
|
72
|
+
};
|
|
73
|
+
request.onerror = () => reject(request.error);
|
|
74
|
+
}));
|
|
75
|
+
async function tx(store, mode, run, from = open) {
|
|
76
|
+
const db = await from();
|
|
56
77
|
const transaction = db.transaction(store, mode);
|
|
57
78
|
const finished = done(transaction);
|
|
58
79
|
const result = await run(transaction.objectStore(store));
|
|
@@ -61,14 +82,18 @@ export function idbStorage(factory = indexedDB, name = NAME) {
|
|
|
61
82
|
}
|
|
62
83
|
return {
|
|
63
84
|
destroy: async () => {
|
|
64
|
-
const
|
|
65
|
-
db
|
|
85
|
+
const dbs = await Promise.all([opened, openedSets].map((p) => p?.catch(() => undefined)));
|
|
86
|
+
for (const db of dbs)
|
|
87
|
+
db?.close();
|
|
66
88
|
opened = undefined;
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
89
|
+
openedSets = undefined;
|
|
90
|
+
for (const dbName of [name, `${name}-datasets`]) {
|
|
91
|
+
await new Promise((resolve) => {
|
|
92
|
+
const request = factory.deleteDatabase(dbName);
|
|
93
|
+
request.onsuccess = () => resolve();
|
|
94
|
+
request.onerror = () => resolve();
|
|
95
|
+
});
|
|
96
|
+
}
|
|
72
97
|
},
|
|
73
98
|
getArtifact: (id) => tx(ARTIFACTS, 'readonly', (s) => wrap(s.get(id))),
|
|
74
99
|
putArtifact: (stored) => tx(ARTIFACTS, 'readwrite', async (s) => void (await wrap(s.put(stored)))),
|
|
@@ -112,6 +137,50 @@ export function idbStorage(factory = indexedDB, name = NAME) {
|
|
|
112
137
|
clearGraph: async () => {
|
|
113
138
|
await tx(RECORDS, 'readwrite', async (s) => void (await wrap(s.clear())));
|
|
114
139
|
await tx(PROJECTIONS, 'readwrite', async (s) => void (await wrap(s.clear())));
|
|
140
|
+
},
|
|
141
|
+
getDatasets: () => tx(DATASET_META, 'readonly', (s) => wrap(s.getAll()), openSets),
|
|
142
|
+
readDataset: (name) => tx(DATASET_ROWS, 'readonly', (s) => wrap(s.getAll(IDBKeyRange.bound([name], [name, []]))), openSets),
|
|
143
|
+
commitDataset: async (commit) => {
|
|
144
|
+
const db = await openSets();
|
|
145
|
+
// strict durability: the commit is reported only after the engine verified the write
|
|
146
|
+
const transaction = db.transaction([DATASET_ROWS, DATASET_META], 'readwrite', {
|
|
147
|
+
durability: 'strict'
|
|
148
|
+
});
|
|
149
|
+
const finished = done(transaction);
|
|
150
|
+
// a rejected commit has aborted its transaction; the caller learns it from `finished`
|
|
151
|
+
finished.catch(() => undefined);
|
|
152
|
+
try {
|
|
153
|
+
const rows = transaction.objectStore(DATASET_ROWS);
|
|
154
|
+
const metas = transaction.objectStore(DATASET_META);
|
|
155
|
+
if (commit.clear)
|
|
156
|
+
rows.delete(IDBKeyRange.bound([commit.name], [commit.name, []]));
|
|
157
|
+
for (const key of commit.deletes)
|
|
158
|
+
rows.delete([commit.name, key]);
|
|
159
|
+
for (const put of commit.puts)
|
|
160
|
+
rows.put(put);
|
|
161
|
+
if (commit.meta)
|
|
162
|
+
metas.put(commit.meta);
|
|
163
|
+
else
|
|
164
|
+
metas.delete(commit.name);
|
|
165
|
+
}
|
|
166
|
+
catch (error) {
|
|
167
|
+
try {
|
|
168
|
+
transaction.abort();
|
|
169
|
+
}
|
|
170
|
+
catch {
|
|
171
|
+
// already finished
|
|
172
|
+
}
|
|
173
|
+
throw error;
|
|
174
|
+
}
|
|
175
|
+
await finished;
|
|
176
|
+
},
|
|
177
|
+
clearDatasets: async () => {
|
|
178
|
+
const db = await openSets();
|
|
179
|
+
const transaction = db.transaction([DATASET_ROWS, DATASET_META], 'readwrite');
|
|
180
|
+
const finished = done(transaction);
|
|
181
|
+
transaction.objectStore(DATASET_ROWS).clear();
|
|
182
|
+
transaction.objectStore(DATASET_META).clear();
|
|
183
|
+
await finished;
|
|
115
184
|
}
|
|
116
185
|
};
|
|
117
186
|
}
|
package/dist/sw/index.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
export { QUOTA_MARGIN_BYTES, createPackStore } from './pack/store.js';
|
|
2
|
+
export type { FitOutcome, InstallOptions, InstallOutcome, PackCounters, PackHead, PackIndex, PackStore, PackStoreOptions, Predicted, RecordCounts, RingOutcome, StorageEstimate } from './pack/store.js';
|
|
1
3
|
export type { Renderer, Renderers } from './render.js';
|
|
2
4
|
export { MANIFEST_FILE, manifestConfig, serve } from './serve.js';
|
package/dist/sw/index.js
CHANGED
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { type BundleDelta, type BundleRows } from '../../protocol/bundle.js';
|
|
2
|
+
import type { DatasetRow } from '../../protocol/dataset.js';
|
|
3
|
+
import type { Ring } from '../../protocol/ring.js';
|
|
4
|
+
import type { SerializedRoute } from '../../protocol/route.js';
|
|
5
|
+
import type { CompiledTemplate } from '../../protocol/template/compile.js';
|
|
6
|
+
type Bytes = Uint8Array<ArrayBuffer>;
|
|
7
|
+
/**
|
|
8
|
+
* the active pack: version, set digest, generation (the key space of its records) and layout. A
|
|
9
|
+
* partial head is a ring: its rows sit in the overlay and it has no blocks, so a key it does not
|
|
10
|
+
* hold is a miss.
|
|
11
|
+
*/
|
|
12
|
+
export type PackHead = StoredHead & {
|
|
13
|
+
/** rows a write predicted and no verified delta has confirmed or dropped yet */
|
|
14
|
+
unconfirmed: number;
|
|
15
|
+
};
|
|
16
|
+
type StoredHead = {
|
|
17
|
+
version: number;
|
|
18
|
+
digest: string;
|
|
19
|
+
generation: number;
|
|
20
|
+
blockRows: number;
|
|
21
|
+
codec: 'gzip';
|
|
22
|
+
tables: string[];
|
|
23
|
+
partial?: true;
|
|
24
|
+
};
|
|
25
|
+
/** rows a write's answer predicts: a row to put, or a key to delete, per table */
|
|
26
|
+
export type Predicted = {
|
|
27
|
+
puts: Array<[table: string, key: string, row: DatasetRow]>;
|
|
28
|
+
deletes: Array<[table: string, key: string]>;
|
|
29
|
+
};
|
|
30
|
+
/** one table of one generation: its row count and, per block, first key, last key and hash */
|
|
31
|
+
export type PackIndex = {
|
|
32
|
+
rows: number;
|
|
33
|
+
first: string[];
|
|
34
|
+
last: string[];
|
|
35
|
+
hashes: string[];
|
|
36
|
+
};
|
|
37
|
+
export type PackCounters = {
|
|
38
|
+
blockReads: number;
|
|
39
|
+
blockInflates: number;
|
|
40
|
+
overlayReads: number;
|
|
41
|
+
};
|
|
42
|
+
export type RecordCounts = {
|
|
43
|
+
blocks: number;
|
|
44
|
+
index: number;
|
|
45
|
+
overlay: number;
|
|
46
|
+
head: number;
|
|
47
|
+
};
|
|
48
|
+
export type FitOutcome = {
|
|
49
|
+
checked: false;
|
|
50
|
+
fits: true;
|
|
51
|
+
} | {
|
|
52
|
+
checked: true;
|
|
53
|
+
fits: true;
|
|
54
|
+
} | {
|
|
55
|
+
checked: true;
|
|
56
|
+
fits: false;
|
|
57
|
+
bytes: number;
|
|
58
|
+
usage: number;
|
|
59
|
+
quota: number;
|
|
60
|
+
};
|
|
61
|
+
export type InstallOutcome = {
|
|
62
|
+
installed: true;
|
|
63
|
+
version: number;
|
|
64
|
+
tables: number;
|
|
65
|
+
rows: number;
|
|
66
|
+
blocks: number;
|
|
67
|
+
} | {
|
|
68
|
+
installed: false;
|
|
69
|
+
fit: Extract<FitOutcome, {
|
|
70
|
+
fits: false;
|
|
71
|
+
}>;
|
|
72
|
+
};
|
|
73
|
+
/** a ring is refused when it is older than the held pack, or names the complete pack already held */
|
|
74
|
+
export type RingOutcome = {
|
|
75
|
+
installed: true;
|
|
76
|
+
version: number;
|
|
77
|
+
rows: number;
|
|
78
|
+
complete: boolean;
|
|
79
|
+
} | {
|
|
80
|
+
installed: false;
|
|
81
|
+
reason: 'older' | 'held';
|
|
82
|
+
};
|
|
83
|
+
export type InstallOptions = {
|
|
84
|
+
/** the pack's size in bytes; when given, the install is refused if it would not fit */
|
|
85
|
+
bytes?: number;
|
|
86
|
+
};
|
|
87
|
+
export type StorageEstimate = {
|
|
88
|
+
usage?: number;
|
|
89
|
+
quota?: number;
|
|
90
|
+
};
|
|
91
|
+
export type PackStoreOptions = {
|
|
92
|
+
/** the database name; `spool-bundle` unless a test names its own */
|
|
93
|
+
name?: string;
|
|
94
|
+
/** the storage estimate; defaults to `navigator.storage.estimate` where the browser has it */
|
|
95
|
+
estimate?: () => Promise<StorageEstimate | undefined>;
|
|
96
|
+
};
|
|
97
|
+
export type PackStore = {
|
|
98
|
+
readonly counters: PackCounters;
|
|
99
|
+
head(): Promise<PackHead | undefined>;
|
|
100
|
+
recordCounts(): Promise<RecordCounts>;
|
|
101
|
+
installPack(source: AsyncIterable<Bytes>, options?: InstallOptions): Promise<InstallOutcome>;
|
|
102
|
+
/** holds a ring as a partial or a complete head; its routes and templates are replaced */
|
|
103
|
+
installRing(ring: Ring): Promise<RingOutcome>;
|
|
104
|
+
estimateBeforeInstall(bytes: number): Promise<FitOutcome>;
|
|
105
|
+
applyDelta(delta: BundleDelta): Promise<void>;
|
|
106
|
+
/** lays predicted rows over the pack without moving its version; a no-op when no pack is held */
|
|
107
|
+
applyPredicted(predicted: Predicted): Promise<void>;
|
|
108
|
+
/** moves to `to` with the predicted rows as the change; throws and keeps them when `digest` is not theirs */
|
|
109
|
+
confirmPredicted(to: number, digest: string): Promise<void>;
|
|
110
|
+
/** removes every predicted row and keeps the version */
|
|
111
|
+
dropPredicted(): Promise<void>;
|
|
112
|
+
getRow(table: string, key: string): Promise<DatasetRow | undefined>;
|
|
113
|
+
scanTable(table: string): Promise<BundleRows>;
|
|
114
|
+
compact(): Promise<boolean>;
|
|
115
|
+
/** replaces the held routes with `routes`, kept in the order given */
|
|
116
|
+
/** `templates` holds the compiled template of each route that has one, keyed by pattern */
|
|
117
|
+
putRoutes(routes: SerializedRoute[], templates?: Record<string, CompiledTemplate>): Promise<void>;
|
|
118
|
+
getRoutes(): Promise<SerializedRoute[]>;
|
|
119
|
+
getTemplates(): Promise<Record<string, CompiledTemplate>>;
|
|
120
|
+
};
|
|
121
|
+
/** bytes kept free past an install's own size; a default, not measured */
|
|
122
|
+
export declare const QUOTA_MARGIN_BYTES: number;
|
|
123
|
+
/**
|
|
124
|
+
* A device's site pack in IndexedDB `spool-bundle`: compressed blocks of sorted rows, an overlay of
|
|
125
|
+
* changed rows, and one head record that names the active pack. A read inflates at most one block.
|
|
126
|
+
*/
|
|
127
|
+
export declare function createPackStore(factory?: IDBFactory, options?: PackStoreOptions): PackStore;
|
|
128
|
+
export {};
|