@canonical/dataviews-core 0.45.0 → 0.47.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/LICENSE +166 -0
- package/package.json +4 -3
- package/dist/esm/lib/collection/createCollectionCoordinator.js +0 -202
- package/dist/esm/lib/collection/createCollectionCoordinator.js.map +0 -1
- package/dist/esm/lib/collection/createSaveSession.js +0 -103
- package/dist/esm/lib/collection/createSaveSession.js.map +0 -1
- package/dist/esm/lib/createIdentity.js +0 -22
- package/dist/esm/lib/createIdentity.js.map +0 -1
- package/dist/esm/lib/field/createFieldInteraction.js +0 -80
- package/dist/esm/lib/field/createFieldInteraction.js.map +0 -1
- package/dist/esm/lib/field/index.js +0 -2
- package/dist/esm/lib/field/index.js.map +0 -1
- package/dist/esm/lib/geometry/columnTemplate.js +0 -38
- package/dist/esm/lib/geometry/columnTemplate.js.map +0 -1
- package/dist/esm/lib/geometry/createPresentation.js +0 -79
- package/dist/esm/lib/geometry/createPresentation.js.map +0 -1
- package/dist/esm/lib/geometry/sizingEquals.js +0 -10
- package/dist/esm/lib/geometry/sizingEquals.js.map +0 -1
- package/dist/esm/lib/identityBrand.js +0 -3
- package/dist/esm/lib/identityBrand.js.map +0 -1
- package/dist/esm/lib/isIdentity.js +0 -15
- package/dist/esm/lib/isIdentity.js.map +0 -1
- package/dist/esm/lib/location/createLocationBinding.js +0 -214
- package/dist/esm/lib/location/createLocationBinding.js.map +0 -1
- package/dist/esm/lib/operation/createOperation.js +0 -83
- package/dist/esm/lib/operation/createOperation.js.map +0 -1
- package/dist/esm/lib/operation/index.js +0 -2
- package/dist/esm/lib/operation/index.js.map +0 -1
- package/dist/esm/lib/query/canonicalSlice.js +0 -64
- package/dist/esm/lib/query/canonicalSlice.js.map +0 -1
- package/dist/esm/lib/query/defaultWindow.js +0 -11
- package/dist/esm/lib/query/defaultWindow.js.map +0 -1
- package/dist/esm/lib/query/sliceEquals.js +0 -30
- package/dist/esm/lib/query/sliceEquals.js.map +0 -1
- package/dist/esm/lib/source/createSourceBinding.js +0 -192
- package/dist/esm/lib/source/createSourceBinding.js.map +0 -1
- package/dist/esm/lib/source/reasonOf.js +0 -11
- package/dist/esm/lib/source/reasonOf.js.map +0 -1
- package/dist/esm/lib/source/supportsSlice.js +0 -68
- package/dist/esm/lib/source/supportsSlice.js.map +0 -1
- package/dist/esm/lib/views/createIndexedDBViewStore.js +0 -513
- package/dist/esm/lib/views/createIndexedDBViewStore.js.map +0 -1
- package/dist/esm/lib/views/createProviderViews.js +0 -573
- package/dist/esm/lib/views/createProviderViews.js.map +0 -1
- package/dist/esm/lib/wire/wireGrammar.js +0 -59
- package/dist/esm/lib/wire/wireGrammar.js.map +0 -1
- package/dist/types/lib/collection/createCollectionCoordinator.d.ts +0 -115
- package/dist/types/lib/collection/createCollectionCoordinator.d.ts.map +0 -1
- package/dist/types/lib/collection/createSaveSession.d.ts +0 -64
- package/dist/types/lib/collection/createSaveSession.d.ts.map +0 -1
- package/dist/types/lib/createIdentity.d.ts +0 -20
- package/dist/types/lib/createIdentity.d.ts.map +0 -1
- package/dist/types/lib/field/createFieldInteraction.d.ts +0 -77
- package/dist/types/lib/field/createFieldInteraction.d.ts.map +0 -1
- package/dist/types/lib/field/index.d.ts +0 -3
- package/dist/types/lib/field/index.d.ts.map +0 -1
- package/dist/types/lib/geometry/columnTemplate.d.ts +0 -21
- package/dist/types/lib/geometry/columnTemplate.d.ts.map +0 -1
- package/dist/types/lib/geometry/createPresentation.d.ts +0 -32
- package/dist/types/lib/geometry/createPresentation.d.ts.map +0 -1
- package/dist/types/lib/geometry/sizingEquals.d.ts +0 -4
- package/dist/types/lib/geometry/sizingEquals.d.ts.map +0 -1
- package/dist/types/lib/identityBrand.d.ts +0 -3
- package/dist/types/lib/identityBrand.d.ts.map +0 -1
- package/dist/types/lib/isIdentity.d.ts +0 -11
- package/dist/types/lib/isIdentity.d.ts.map +0 -1
- package/dist/types/lib/location/createLocationBinding.d.ts +0 -77
- package/dist/types/lib/location/createLocationBinding.d.ts.map +0 -1
- package/dist/types/lib/operation/createOperation.d.ts +0 -62
- package/dist/types/lib/operation/createOperation.d.ts.map +0 -1
- package/dist/types/lib/operation/index.d.ts +0 -3
- package/dist/types/lib/operation/index.d.ts.map +0 -1
- package/dist/types/lib/query/canonicalSlice.d.ts +0 -17
- package/dist/types/lib/query/canonicalSlice.d.ts.map +0 -1
- package/dist/types/lib/query/defaultWindow.d.ts +0 -9
- package/dist/types/lib/query/defaultWindow.d.ts.map +0 -1
- package/dist/types/lib/query/sliceEquals.d.ts +0 -7
- package/dist/types/lib/query/sliceEquals.d.ts.map +0 -1
- package/dist/types/lib/source/createSourceBinding.d.ts +0 -66
- package/dist/types/lib/source/createSourceBinding.d.ts.map +0 -1
- package/dist/types/lib/source/reasonOf.d.ts +0 -3
- package/dist/types/lib/source/reasonOf.d.ts.map +0 -1
- package/dist/types/lib/source/supportsSlice.d.ts +0 -9
- package/dist/types/lib/source/supportsSlice.d.ts.map +0 -1
- package/dist/types/lib/views/createIndexedDBViewStore.d.ts +0 -90
- package/dist/types/lib/views/createIndexedDBViewStore.d.ts.map +0 -1
- package/dist/types/lib/views/createProviderViews.d.ts +0 -53
- package/dist/types/lib/views/createProviderViews.d.ts.map +0 -1
- package/dist/types/lib/wire/wireGrammar.d.ts +0 -31
- package/dist/types/lib/wire/wireGrammar.d.ts.map +0 -1
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import type { CollectionCoordinatorState, CompletionResult } from "../collection/createCollectionCoordinator.js";
|
|
2
|
-
import type { Channel } from "../observable/createChannel.js";
|
|
3
|
-
import type { Operation } from "../operation/createOperation.js";
|
|
4
|
-
import type { Slice } from "../query/types.js";
|
|
5
|
-
import type { Selection } from "../selection/createSelection.js";
|
|
6
|
-
import type { SourceAdapter, SourceCapabilities, SourceSupport } from "./types.js";
|
|
7
|
-
/**
|
|
8
|
-
* The structural host surface the binding drives. The handle
|
|
9
|
-
* `createDataViewsProvider` returns satisfies it, and so can a narrower
|
|
10
|
-
* host.
|
|
11
|
-
*/
|
|
12
|
-
export type SourceHost = {
|
|
13
|
-
/**
|
|
14
|
-
* What the host's source declares it can execute, or null when the host
|
|
15
|
-
* was not told. Non-null, it must be the adapter's own declaration.
|
|
16
|
-
*/
|
|
17
|
-
readonly capabilities: SourceCapabilities | null;
|
|
18
|
-
/** The coordinator snapshot channel: query, window and pending request. */
|
|
19
|
-
readonly result: Channel<CollectionCoordinatorState>;
|
|
20
|
-
readonly selection: Selection;
|
|
21
|
-
readonly refresh: () => string | null;
|
|
22
|
-
readonly complete: (requestId: string, result: CompletionResult) => boolean;
|
|
23
|
-
readonly invokeAction: (targets: readonly string[], payload?: unknown) => Operation;
|
|
24
|
-
};
|
|
25
|
-
/** Configuration of one source binding. */
|
|
26
|
-
export type SourceBindingConfig = {
|
|
27
|
-
readonly host: SourceHost;
|
|
28
|
-
readonly adapter: SourceAdapter;
|
|
29
|
-
};
|
|
30
|
-
/** Handle of one source binding. */
|
|
31
|
-
export type SourceBinding = {
|
|
32
|
-
/**
|
|
33
|
-
* What the bound source declares it can execute. Connected parts read the
|
|
34
|
-
* host's copy instead; this is for code holding the binding.
|
|
35
|
-
*/
|
|
36
|
-
readonly capabilities: SourceCapabilities;
|
|
37
|
-
/**
|
|
38
|
-
* Whether the source can execute a query in hand, with structured
|
|
39
|
-
* refusals. The refusals a request is rejected with reach the result
|
|
40
|
-
* state only as their joined text.
|
|
41
|
-
*/
|
|
42
|
-
readonly supports: (slice: Slice) => SourceSupport;
|
|
43
|
-
/**
|
|
44
|
-
* Run one row operation over explicitly captured targets. Resolves with
|
|
45
|
-
* the operation record once every captured target has an outcome — a
|
|
46
|
-
* target the source reports nothing for fails rather than staying
|
|
47
|
-
* pending. Successful targets leave the selection; failures stay for
|
|
48
|
-
* review and retry. Rejects when the source has no row operations.
|
|
49
|
-
*/
|
|
50
|
-
readonly runAction: (action: string, targets: readonly string[], payload?: unknown) => Promise<Operation>;
|
|
51
|
-
/** Detach: releases the live request and stops observing the host. */
|
|
52
|
-
readonly dispose: () => void;
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Bind a source adapter to a host's request lifecycle. The host issues
|
|
56
|
-
* request identities; the binding executes exactly the newest one, drops
|
|
57
|
-
* completions from released or superseded executions, refuses a query the
|
|
58
|
-
* source has not declared support for, and republishes a later delivery of
|
|
59
|
-
* the same query under a fresh identity so retained rows never carry
|
|
60
|
-
* another request's provenance. Cache and retry stay the adapter's.
|
|
61
|
-
*
|
|
62
|
-
* One binding owns one host: two bindings on the same host both execute
|
|
63
|
-
* every request and race to complete it.
|
|
64
|
-
*/
|
|
65
|
-
export default function createSourceBinding(config: SourceBindingConfig): SourceBinding;
|
|
66
|
-
//# sourceMappingURL=createSourceBinding.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createSourceBinding.d.ts","sourceRoot":"","sources":["../../../../src/lib/source/createSourceBinding.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,0BAA0B,EAC1B,gBAAgB,EACjB,MAAM,8CAA8C,CAAC;AACtD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAGjE,OAAO,KAAK,EACV,aAAa,EACb,kBAAkB,EAClB,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB;;;OAGG;IACH,QAAQ,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACjD,2EAA2E;IAC3E,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,0BAA0B,CAAC,CAAC;IACrD,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC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@
|
|
|
1
|
-
import type { Slice } from "../query/types.js";
|
|
2
|
-
import type { SourceCapabilities, SourceSupport } from "./types.js";
|
|
3
|
-
/**
|
|
4
|
-
* Decide whether a source can execute a query, collecting one structured
|
|
5
|
-
* refusal per unexecutable term. Sort is all-or-nothing: an ordering
|
|
6
|
-
* carrying one unsupported term is refused whole, never truncated.
|
|
7
|
-
*/
|
|
8
|
-
export default function supportsSlice(capabilities: SourceCapabilities, slice: Slice): SourceSupport;
|
|
9
|
-
//# sourceMappingURL=supportsSlice.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"supportsSlice.d.ts","sourceRoot":"","sources":["../../../../src/lib/source/supportsSlice.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC/C,OAAO,KAAK,EACV,kBAAkB,EAElB,aAAa,EACd,MAAM,YAAY,CAAC;AAEpB;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,aAAa,CACnC,YAAY,EAAE,kBAAkB,EAChC,KAAK,EAAE,KAAK,GACX,aAAa,CAiEf"}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import type { ViewStore } from "./types.js";
|
|
2
|
-
/**
|
|
3
|
-
* An event-handler slot. The parameter is `never` so the platform's own
|
|
4
|
-
* typed handlers fill it; this store never reads the event.
|
|
5
|
-
*/
|
|
6
|
-
type Handler = ((event: never) => void) | null;
|
|
7
|
-
/** One request; keys and values are the platform's own. */
|
|
8
|
-
type IndexedDBRequest<TResult> = {
|
|
9
|
-
readonly result: TResult;
|
|
10
|
-
onsuccess: Handler;
|
|
11
|
-
};
|
|
12
|
-
type IndexedDBObjectStore = {
|
|
13
|
-
get(key: unknown): IndexedDBRequest<unknown>;
|
|
14
|
-
put(value: unknown): IndexedDBRequest<unknown>;
|
|
15
|
-
delete(key: unknown): IndexedDBRequest<unknown>;
|
|
16
|
-
createIndex(name: string, keyPath: string | string[]): unknown;
|
|
17
|
-
index(name: string): {
|
|
18
|
-
getAll(key: unknown): IndexedDBRequest<readonly unknown[]>;
|
|
19
|
-
getAllKeys(key: unknown): IndexedDBRequest<readonly unknown[]>;
|
|
20
|
-
};
|
|
21
|
-
};
|
|
22
|
-
type IndexedDBTransaction = {
|
|
23
|
-
readonly error: unknown;
|
|
24
|
-
objectStore(name: string): IndexedDBObjectStore;
|
|
25
|
-
abort(): void;
|
|
26
|
-
oncomplete: Handler;
|
|
27
|
-
onabort: Handler;
|
|
28
|
-
};
|
|
29
|
-
type IndexedDBDatabase = {
|
|
30
|
-
createObjectStore(name: string, options: {
|
|
31
|
-
keyPath: string[];
|
|
32
|
-
}): IndexedDBObjectStore;
|
|
33
|
-
transaction(names: string[], mode: "readonly" | "readwrite"): IndexedDBTransaction;
|
|
34
|
-
close(): void;
|
|
35
|
-
onversionchange: Handler;
|
|
36
|
-
onclose: Handler;
|
|
37
|
-
};
|
|
38
|
-
type IndexedDBOpenRequest = IndexedDBRequest<IndexedDBDatabase> & {
|
|
39
|
-
readonly error: unknown;
|
|
40
|
-
onerror: Handler;
|
|
41
|
-
onupgradeneeded: Handler;
|
|
42
|
-
};
|
|
43
|
-
/**
|
|
44
|
-
* The structural IndexedDB surface the store drives. The platform's
|
|
45
|
-
* `indexedDB` satisfies it by shape; the members are methods, so its
|
|
46
|
-
* narrower parameter types still do.
|
|
47
|
-
*/
|
|
48
|
-
export type IndexedDBFactory = {
|
|
49
|
-
open(name: string, version: number): IndexedDBOpenRequest;
|
|
50
|
-
};
|
|
51
|
-
/** Configuration of one IndexedDB view store: its storage and its scope. */
|
|
52
|
-
export type IndexedDBViewStoreConfig = {
|
|
53
|
-
/** The platform's IndexedDB, supplied explicitly: `window.indexedDB`. */
|
|
54
|
-
readonly indexedDB: IndexedDBFactory;
|
|
55
|
-
/**
|
|
56
|
-
* A database of the store's own, named by the application —
|
|
57
|
-
* `operations-console-views` — and never one it uses for anything else:
|
|
58
|
-
* a database already holding other stores is not upgraded to hold these.
|
|
59
|
-
*/
|
|
60
|
-
readonly database: string;
|
|
61
|
-
/** A stable key of the collection whose views these are. */
|
|
62
|
-
readonly collection: string;
|
|
63
|
-
/**
|
|
64
|
-
* An opaque partition — account, tenant — so one identity never sees
|
|
65
|
-
* another's views, or null for an application with one identity only.
|
|
66
|
-
* Never a credential.
|
|
67
|
-
*/
|
|
68
|
-
readonly partition: string | null;
|
|
69
|
-
};
|
|
70
|
-
/**
|
|
71
|
-
* Create a local-first view store over IndexedDB, scoped at construction
|
|
72
|
-
* to one collection and one partition of one application's database.
|
|
73
|
-
*
|
|
74
|
-
* View edits are transactional: an update or removal names the revision it
|
|
75
|
-
* was made against, and a stale one is an explicit conflict rather than a
|
|
76
|
-
* silent overwrite — so two tabs editing one view conflict. Presentation
|
|
77
|
-
* preferences are stored one record per key and patched atomically, so two
|
|
78
|
-
* tabs changing different keys both keep their change. Records in a format
|
|
79
|
-
* this store does not know are reported and left untouched, so an older
|
|
80
|
-
* client never destroys a newer one's data.
|
|
81
|
-
*
|
|
82
|
-
* Storage the browser blocks, has no room in, or cannot open rejects with
|
|
83
|
-
* the platform's error as the cause; nothing falls back to memory and
|
|
84
|
-
* claims to persist. Other tabs' writes reach `subscribe` through a
|
|
85
|
-
* BroadcastChannel where the platform has one. Import it explicitly from
|
|
86
|
-
* `@canonical/dataviews-core/views`.
|
|
87
|
-
*/
|
|
88
|
-
export default function createIndexedDBViewStore(config: IndexedDBViewStoreConfig): ViewStore;
|
|
89
|
-
export {};
|
|
90
|
-
//# sourceMappingURL=createIndexedDBViewStore.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createIndexedDBViewStore.d.ts","sourceRoot":"","sources":["../../../../src/lib/views/createIndexedDBViewStore.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAUV,SAAS,EAEV,MAAM,YAAY,CAAC;AAEpB;;;GAGG;AACH,KAAK,OAAO,GAAG,CAAC,CAAC,KAAK,EAAE,KAAK,KAAK,I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;IACxB,KAAK,IAAI,IAAI,CAAC;IACd,eAAe,EAAE,OAAO,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,KAAK,oBAAoB,GAAG,gBAAgB,CAAC,iBAAiB,CAAC,GAAG;IAChE,QAAQ,CAAC,KAAK,EAAE,OAAO,CAAC;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,EAAE,OAAO,CAAC;CAC1B,CAAC;AAEF;;;;GAIG;AACH,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,oBAAoB,CAAC;CAC3D,CAAC;AAEF,4EAA4E;AAC5E,MAAM,MAAM,wBAAwB,GAAG;IACrC,yEAAyE;IACzE,QAAQ,CAAC,SAAS,EAAE,gBAAgB,CAAC;IACrC;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,4DAA4D;IAC5D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CACnC,CAAC;AAwGF;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,OAAO,UAAU,wBAAwB,CAC9C,MAAM,EAAE,wBAAwB,GAC/B,SAAS,CA8fX"}
|
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
import type { CollectionCoordinatorState } from "../collection/createCollectionCoordinator.js";
|
|
2
|
-
import type { ReadonlyChannel } from "../observable/createChannel.js";
|
|
3
|
-
import type { ResultWindow, Slice } from "../query/types.js";
|
|
4
|
-
import type { Schema } from "../schema/createSchema.js";
|
|
5
|
-
import type { SchemaFieldDefinition } from "../schema/types.js";
|
|
6
|
-
import type { SourceCapabilities } from "../source/types.js";
|
|
7
|
-
import type { ProviderViews, ViewStore } from "./types.js";
|
|
8
|
-
/** The query authority the views read and drive: their provider's. */
|
|
9
|
-
export type ViewsHost = {
|
|
10
|
-
/** The schema a stored query is read against. */
|
|
11
|
-
readonly schema: Schema<readonly SchemaFieldDefinition[]>;
|
|
12
|
-
/** What the source can execute; a stored clause outside it is refused. */
|
|
13
|
-
readonly capabilities: SourceCapabilities | null;
|
|
14
|
-
/** The live query and window, which "modified" is derived from. */
|
|
15
|
-
readonly result: ReadonlyChannel<CollectionCoordinatorState<object>>;
|
|
16
|
-
/** Adopt a view's query and window together. */
|
|
17
|
-
readonly adopt: (slice: Slice, window: ResultWindow) => void;
|
|
18
|
-
};
|
|
19
|
-
/** Configuration of one provider's views. */
|
|
20
|
-
export type ProviderViewsConfig = {
|
|
21
|
-
readonly host: ViewsHost;
|
|
22
|
-
readonly store: ViewStore;
|
|
23
|
-
};
|
|
24
|
-
/** The provider's views, with what only the provider calls. */
|
|
25
|
-
export type OwnedViews = ProviderViews & {
|
|
26
|
-
/** Forget the open view, as a scope rotation resets the query. */
|
|
27
|
-
readonly forget: () => void;
|
|
28
|
-
/** Detach from the store and the host for good. */
|
|
29
|
-
readonly dispose: () => void;
|
|
30
|
-
};
|
|
31
|
-
/**
|
|
32
|
-
* Create a provider's saved views over the store the application gave it.
|
|
33
|
-
*
|
|
34
|
-
* The open view's identity lives here and its query in the provider: opening
|
|
35
|
-
* a view adopts its query, and "modified" compares the live query with the
|
|
36
|
-
* one the view was opened or saved at. Edits to a view name the revision
|
|
37
|
-
* they were read at, so a view changed in another tab conflicts instead of
|
|
38
|
-
* being overwritten; after a conflict the stored view is the open one, and
|
|
39
|
-
* the user chooses to overwrite it, save a new view or discard the changes.
|
|
40
|
-
* An operation still in flight when the scope rotates answers its caller
|
|
41
|
-
* and changes nothing.
|
|
42
|
-
*
|
|
43
|
-
* Presentation is layered: the viewer's default arrangement, then the open
|
|
44
|
-
* view's saved presentation, then the viewer's own changes to that view.
|
|
45
|
-
* Each target's preferences are read when the views are observed and when
|
|
46
|
-
* the store changes; a change not yet sent when a read began, or whose
|
|
47
|
-
* write failed, wins over it.
|
|
48
|
-
*
|
|
49
|
-
* Constructing it reads nothing: the store is first read when something
|
|
50
|
-
* observes the views.
|
|
51
|
-
*/
|
|
52
|
-
export default function createProviderViews(config: ProviderViewsConfig): OwnedViews;
|
|
53
|
-
//# sourceMappingURL=createProviderViews.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"createProviderViews.d.ts","sourceRoot":"","sources":["../../../../src/lib/views/createProviderViews.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,8CAA8C,CAAC;AAC/F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AAGtE,OAAO,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AACxD,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAK7D,OAAO,KAAK,EAIV,aAAa,EAOb,SAAS,EAGV,MAAM,YAAY,CAAC;AAEpB,sEAAsE;AACtE,MAAM,MAAM,SAAS,GAAG;IACtB,iDAAiD;IACjD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC,SAAS,qBAAqB,EAAE,CAAC,CAAC;IAC1D,0EAA0E;IAC1E,QAAQ,CAAC,YAAY,EAAE,kBAAkB,GAAG,IAAI,CAAC;IACjD,mEAAmE;IACnE,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC,0BAA0B,CAAC,MAAM,CAAC,CAAC,CAAC;IACrE,gDAAgD;IAChD,QAAQ,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,YAAY,KAAK,IAAI,CAAC;CAC9D,CAAC;AAEF,6CAA6C;AAC7C,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;CAC3B,CAAC;AAEF,+DAA+D;AAC/D,MAAM,MAAM,UAAU,GAAG,aAAa,GAAG;IACvC,kEAAkE;IAClE,QAAQ,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC;IAC5B,mDAAmD;IACnD,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;CAC9B,CAAC;AAsHF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CACzC,MAAM,EAAE,mBAAmB,GAC1B,UAAU,CAmkBZ"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The flat, form-compatible wire grammar: how a query is spelled as URL
|
|
3
|
-
* parameters. Repeated values carry equality operand sets and ordered sort
|
|
4
|
-
* terms; a `field__operator` key carries a bound; the window is `page` and
|
|
5
|
-
* `size`. Everything else in a URL belongs to the host.
|
|
6
|
-
*/
|
|
7
|
-
import type { PredicateOperator } from "../query/types.js";
|
|
8
|
-
/** The delimiter between a field's wire name and its operator. */
|
|
9
|
-
export declare const OPERATOR_DELIMITER = "__";
|
|
10
|
-
/**
|
|
11
|
-
* Parameter names the grammar reserves: those it writes, plus the window
|
|
12
|
-
* and annotation names it leaves to the host. A field's wire name may not
|
|
13
|
-
* collide with one — the query would be ambiguous.
|
|
14
|
-
*/
|
|
15
|
-
export declare const RESERVED_QUERY_KEYS: readonly string[];
|
|
16
|
-
/** The operators written with the delimiter. `eq` is the bare field name. */
|
|
17
|
-
export declare const SUFFIXED_OPERATORS: readonly ["gte", "lte", "isSet"];
|
|
18
|
-
/** The wire key one predicate address is written as. */
|
|
19
|
-
export declare const wireKeyOf: (field: string, operator: PredicateOperator) => string;
|
|
20
|
-
/** The field a wire key addresses: the part before the delimiter. */
|
|
21
|
-
export declare const fieldOfWireKey: (key: string) => string;
|
|
22
|
-
/** Why a field name cannot be spelled on the wire, or null when it can. */
|
|
23
|
-
export declare const wireNameRejection: (field: string) => string | null;
|
|
24
|
-
/**
|
|
25
|
-
* Whether one parameter belongs to a collection's query: a written name, a
|
|
26
|
-
* field, or any `field__…` address of one — a refused operator included, so
|
|
27
|
-
* the encoder clears what the decoder reported. A delimited name whose
|
|
28
|
-
* prefix is no field is the host's.
|
|
29
|
-
*/
|
|
30
|
-
export declare const isOwnedKey: (key: string, hasField: (name: string) => boolean) => boolean;
|
|
31
|
-
//# sourceMappingURL=wireGrammar.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"wireGrammar.d.ts","sourceRoot":"","sources":["../../../../src/lib/wire/wireGrammar.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAE3D,kEAAkE;AAClE,eAAO,MAAM,kBAAkB,OAAO,CAAC;AAWvC;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,EAAE,SAAS,MAAM,EAM/C,CAAC;AAEH,6EAA6E;AAC7E,eAAO,MAAM,kBAAkB,kCAImB,CAAC;AAEnD,wDAAwD;AACxD,eAAO,MAAM,SAAS,GACpB,OAAO,MAAM,EACb,UAAU,iBAAiB,KAC1B,MACqE,CAAC;AAEzE,qEAAqE;AACrE,eAAO,MAAM,cAAc,GAAI,KAAK,MAAM,KAAG,MAG5C,CAAC;AAEF,2EAA2E;AAC3E,eAAO,MAAM,iBAAiB,GAAI,OAAO,MAAM,KAAG,MAAM,GAAG,IAQ1D,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,UAAU,GACrB,KAAK,MAAM,EACX,UAAU,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,KAClC,OAA4E,CAAC"}
|