@livestore/common 0.0.53 → 0.0.54-dev.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/dist/.tsbuildinfo +1 -1
- package/dist/adapter-types.d.ts +8 -0
- package/dist/adapter-types.d.ts.map +1 -1
- package/dist/adapter-types.js +5 -1
- package/dist/adapter-types.js.map +1 -1
- package/dist/bounded-collections.d.ts +36 -0
- package/dist/bounded-collections.d.ts.map +1 -0
- package/dist/bounded-collections.js +98 -0
- package/dist/bounded-collections.js.map +1 -0
- package/dist/debug-info.d.ts +118 -0
- package/dist/debug-info.d.ts.map +1 -0
- package/dist/debug-info.js +50 -0
- package/dist/debug-info.js.map +1 -0
- package/dist/derived-mutations.d.ts +8 -8
- package/dist/devtools/devtools-messages.d.ts +223 -0
- package/dist/devtools/devtools-messages.d.ts.map +1 -0
- package/dist/devtools/devtools-messages.js +148 -0
- package/dist/devtools/devtools-messages.js.map +1 -0
- package/dist/devtools/index copy.d.ts +214 -0
- package/dist/devtools/index copy.d.ts.map +1 -0
- package/dist/devtools/index copy.js +137 -0
- package/dist/devtools/index copy.js.map +1 -0
- package/dist/devtools/index.d.ts +2 -0
- package/dist/devtools/index.d.ts.map +1 -0
- package/dist/devtools/index.js +2 -0
- package/dist/devtools/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/schema/index.d.ts +4 -1
- package/dist/schema/index.d.ts.map +1 -1
- package/dist/schema/index.js +4 -2
- package/dist/schema/index.js.map +1 -1
- package/dist/util.d.ts +4 -1
- package/dist/util.d.ts.map +1 -1
- package/dist/util.js +3 -0
- package/dist/util.js.map +1 -1
- package/package.json +3 -3
- package/src/adapter-types.ts +9 -0
- package/src/bounded-collections.ts +121 -0
- package/src/debug-info.ts +88 -0
- package/src/devtools/devtools-messages.ts +186 -0
- package/src/devtools/index.ts +1 -0
- package/src/index.ts +3 -0
- package/src/schema/index.ts +9 -3
- package/src/util.ts +10 -2
package/dist/adapter-types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Stream, SubscriptionRef, TRef } from '@livestore/utils/effect';
|
|
2
|
+
import { Schema } from '@livestore/utils/effect';
|
|
2
3
|
import type * as otel from '@opentelemetry/api';
|
|
3
4
|
import type { LiveStoreSchema, MutationEvent } from './schema/index.js';
|
|
4
5
|
import type { PreparedBindValues } from './util.js';
|
|
@@ -21,11 +22,18 @@ export type InMemoryDatabase = {
|
|
|
21
22
|
export(): Uint8Array;
|
|
22
23
|
};
|
|
23
24
|
export type ResetMode = 'all-data' | 'only-app-db';
|
|
25
|
+
export declare const NetworkStatus: Schema.Struct<{
|
|
26
|
+
isConnected: typeof Schema.Boolean;
|
|
27
|
+
timestampMs: typeof Schema.Number;
|
|
28
|
+
}>;
|
|
24
29
|
export type NetworkStatus = {
|
|
25
30
|
isConnected: boolean;
|
|
26
31
|
timestampMs: number;
|
|
27
32
|
};
|
|
28
33
|
export type Coordinator = {
|
|
34
|
+
devtools: {
|
|
35
|
+
channelId: string;
|
|
36
|
+
};
|
|
29
37
|
hasLock: TRef.TRef<boolean>;
|
|
30
38
|
syncMutations: Stream.Stream<MutationEvent.AnyEncoded>;
|
|
31
39
|
execute(queryStr: string, bindValues: PreparedBindValues | undefined, span: otel.Span | undefined): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-types.d.ts","sourceRoot":"","sources":["../src/adapter-types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAC5E,OAAO,KAAK,KAAK,IAAI,MAAM,oBAAoB,CAAA;AAE/C,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAA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ED,MAAM,MAAM,mBAAmB,GAAG,CAAC,IAAI,EAAE;IACvC,UAAU,EAAE,IAAI,CAAC,MAAM,CAAA;IACvB,WAAW,EAAE,IAAI,CAAC,OAAO,CAAA;IACzB,MAAM,EAAE,eAAe,CAAA;CACxB,KAAK,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC,CAAA"}
|
package/dist/adapter-types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"adapter-types.js","sourceRoot":"","sources":["../src/adapter-types.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"adapter-types.js","sourceRoot":"","sources":["../src/adapter-types.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AA6BhD,MAAM,CAAC,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,CAAC;IACzC,WAAW,EAAE,MAAM,CAAC,OAAO;IAC3B,WAAW,EAAE,MAAM,CAAC,MAAM;CAC3B,CAAC,CAAA"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a map that has a fixed number of entries.
|
|
3
|
+
* Once hitting the bound, earliest insertions are removed
|
|
4
|
+
*/
|
|
5
|
+
export declare class BoundMap<K, V> {
|
|
6
|
+
#private;
|
|
7
|
+
constructor(sizeLimit: number);
|
|
8
|
+
onEvict: ((key: K, value: V) => void) | undefined;
|
|
9
|
+
set: (key: K, value: V) => void;
|
|
10
|
+
get: (key: K) => V | undefined;
|
|
11
|
+
delete: (key: K) => void;
|
|
12
|
+
keys: () => IterableIterator<K>;
|
|
13
|
+
}
|
|
14
|
+
export declare class BoundSet<V> {
|
|
15
|
+
#private;
|
|
16
|
+
constructor(sizeLimit: number);
|
|
17
|
+
onEvict: ((key: V) => void) | undefined;
|
|
18
|
+
add: (v: V) => void;
|
|
19
|
+
[Symbol.iterator]: () => IterableIterator<V>;
|
|
20
|
+
}
|
|
21
|
+
export declare class BoundArray<V> {
|
|
22
|
+
#private;
|
|
23
|
+
sizeLimit: number;
|
|
24
|
+
constructor(sizeLimit: number);
|
|
25
|
+
static make: <V_1>(sizeLimit: number, initial?: readonly V_1[]) => BoundArray<V_1>;
|
|
26
|
+
onEvict: ((key: V) => void) | undefined;
|
|
27
|
+
push: (v: V) => void;
|
|
28
|
+
get: (index: number) => V | undefined;
|
|
29
|
+
delete: (index: number) => void;
|
|
30
|
+
get length(): number;
|
|
31
|
+
[Symbol.iterator]: () => IterableIterator<V>;
|
|
32
|
+
map: <T>(fn: (v: V) => T) => T[];
|
|
33
|
+
clear: () => void;
|
|
34
|
+
sort: (fn?: (a: V, b: V) => number) => V[];
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=bounded-collections.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bounded-collections.d.ts","sourceRoot":"","sources":["../src/bounded-collections.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,qBAAa,QAAQ,CAAC,CAAC,EAAE,CAAC;;gBAIZ,SAAS,EAAE,MAAM;IAI7B,OAAO,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,SAAS,CAAA;IAEjD,GAAG,QAAS,CAAC,SAAS,CAAC,UAWtB;IAED,GAAG,QAAS,CAAC,KAAG,CAAC,GAAG,SAAS,CAE5B;IAED,MAAM,QAAS,CAAC,UAEf;IAED,IAAI,4BAEH;CACF;AAED,qBAAa,QAAQ,CAAC,CAAC;;gBAGT,SAAS,EAAE,MAAM;IAW7B,OAAO,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,SAAS,CAAA;IAEvC,GAAG,MAAO,CAAC,UAET;IAEF,CAAC,MAAM,CAAC,QAAQ,CAAC,4BAEhB;CACF;AAED,qBAAa,UAAU,CAAC,CAAC;;IAEhB,SAAS,EAAE,MAAM,CAAA;gBAEZ,SAAS,EAAE,MAAM;IAI7B,MAAM,CAAC,IAAI,mBAAkB,MAAM,+CAMlC;IAED,OAAO,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,KAAK,IAAI,CAAC,GAAG,SAAS,CAAA;IAEvC,IAAI,MAAO,CAAC,UAQX;IAED,GAAG,UAAW,MAAM,KAAG,CAAC,GAAG,SAAS,CAEnC;IAED,MAAM,UAAW,MAAM,UAEtB;IAED,IAAI,MAAM,WAET;IAED,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAO,iBAAiB,CAAC,CAAC,CAE1C;IAED,GAAG,UAAW,CAAC,CAAC,EAAE,CAAC,KAAK,CAAC,KAAG,CAAC,EAAE,CAE9B;IAED,KAAK,aAEJ;IAED,IAAI,QAAS,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,MAAM,SAElC;CACF"}
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates a map that has a fixed number of entries.
|
|
3
|
+
* Once hitting the bound, earliest insertions are removed
|
|
4
|
+
*/
|
|
5
|
+
export class BoundMap {
|
|
6
|
+
#map = new Map();
|
|
7
|
+
#sizeLimit;
|
|
8
|
+
constructor(sizeLimit) {
|
|
9
|
+
this.#sizeLimit = sizeLimit;
|
|
10
|
+
}
|
|
11
|
+
onEvict;
|
|
12
|
+
set = (key, value) => {
|
|
13
|
+
this.#map.set(key, value);
|
|
14
|
+
// console.log(this.#map.size, this.#sizeLimit);
|
|
15
|
+
if (this.#map.size > this.#sizeLimit) {
|
|
16
|
+
const firstKey = this.#map.keys().next().value;
|
|
17
|
+
const deletedValue = this.#map.get(firstKey);
|
|
18
|
+
this.#map.delete(firstKey);
|
|
19
|
+
if (this.onEvict) {
|
|
20
|
+
this.onEvict(firstKey, deletedValue);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
get = (key) => {
|
|
25
|
+
return this.#map.get(key);
|
|
26
|
+
};
|
|
27
|
+
delete = (key) => {
|
|
28
|
+
this.#map.delete(key);
|
|
29
|
+
};
|
|
30
|
+
keys = () => {
|
|
31
|
+
return this.#map.keys();
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export class BoundSet {
|
|
35
|
+
#map;
|
|
36
|
+
constructor(sizeLimit) {
|
|
37
|
+
this.#map = new BoundMap(sizeLimit);
|
|
38
|
+
this.#map.onEvict = this.#onEvict;
|
|
39
|
+
}
|
|
40
|
+
#onEvict = (v) => {
|
|
41
|
+
if (this.onEvict) {
|
|
42
|
+
this.onEvict(v);
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
onEvict;
|
|
46
|
+
add = (v) => {
|
|
47
|
+
this.#map.set(v, v);
|
|
48
|
+
};
|
|
49
|
+
[Symbol.iterator] = () => {
|
|
50
|
+
return this.#map.keys();
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
export class BoundArray {
|
|
54
|
+
#array = [];
|
|
55
|
+
sizeLimit;
|
|
56
|
+
constructor(sizeLimit) {
|
|
57
|
+
this.sizeLimit = sizeLimit;
|
|
58
|
+
}
|
|
59
|
+
static make = (sizeLimit, initial = []) => {
|
|
60
|
+
const b = new BoundArray(sizeLimit);
|
|
61
|
+
for (const v of initial) {
|
|
62
|
+
b.push(v);
|
|
63
|
+
}
|
|
64
|
+
return b;
|
|
65
|
+
};
|
|
66
|
+
onEvict;
|
|
67
|
+
push = (v) => {
|
|
68
|
+
this.#array.push(v);
|
|
69
|
+
if (this.#array.length > this.sizeLimit) {
|
|
70
|
+
const first = this.#array.shift();
|
|
71
|
+
if (first && this.onEvict) {
|
|
72
|
+
this.onEvict(first);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
get = (index) => {
|
|
77
|
+
return this.#array[index];
|
|
78
|
+
};
|
|
79
|
+
delete = (index) => {
|
|
80
|
+
this.#array.splice(index, 1);
|
|
81
|
+
};
|
|
82
|
+
get length() {
|
|
83
|
+
return this.#array.length;
|
|
84
|
+
}
|
|
85
|
+
[Symbol.iterator] = () => {
|
|
86
|
+
return this.#array[Symbol.iterator]();
|
|
87
|
+
};
|
|
88
|
+
map = (fn) => {
|
|
89
|
+
return this.#array.map(fn);
|
|
90
|
+
};
|
|
91
|
+
clear = () => {
|
|
92
|
+
this.#array = [];
|
|
93
|
+
};
|
|
94
|
+
sort = (fn) => {
|
|
95
|
+
return this.#array.sort(fn);
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
//# sourceMappingURL=bounded-collections.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bounded-collections.js","sourceRoot":"","sources":["../src/bounded-collections.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,OAAO,QAAQ;IACnB,IAAI,GAAG,IAAI,GAAG,EAAQ,CAAA;IACtB,UAAU,CAAQ;IAElB,YAAY,SAAiB;QAC3B,IAAI,CAAC,UAAU,GAAG,SAAS,CAAA;IAC7B,CAAC;IAED,OAAO,CAA0C;IAEjD,GAAG,GAAG,CAAC,GAAM,EAAE,KAAQ,EAAE,EAAE;QACzB,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,CAAC,CAAA;QACzB,gDAAgD;QAChD,IAAI,IAAI,CAAC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC;YACrC,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,CAAA;YAC9C,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAE,CAAA;YAC7C,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAA;YAC1B,IAAI,IAAI,CAAC,OAAO,EAAE,CAAC;gBACjB,IAAI,CAAC,OAAO,CAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;YACtC,CAAC;QACH,CAAC;IACH,CAAC,CAAA;IAED,G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AAE;QACX,IAAI,CAAC,MAAM,GAAG,EAAE,CAAA;IAClB,CAAC,CAAA;IAED,IAAI,GAAG,CAAC,EAA2B,EAAE,EAAE;QACrC,OAAO,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAA;IAC7B,CAAC,CAAA"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { Schema } from '@livestore/utils/effect';
|
|
2
|
+
import { BoundArray } from './bounded-collections.js';
|
|
3
|
+
import { PreparedBindValues } from './util.js';
|
|
4
|
+
export type SlowQueryInfo = {
|
|
5
|
+
queryStr: string;
|
|
6
|
+
bindValues: PreparedBindValues | undefined;
|
|
7
|
+
durationMs: number;
|
|
8
|
+
rowsCount: number | undefined;
|
|
9
|
+
queriedTables: Set<string>;
|
|
10
|
+
startTimePerfNow: DOMHighResTimeStamp;
|
|
11
|
+
};
|
|
12
|
+
export declare const SlowQueryInfo: Schema.Struct<{
|
|
13
|
+
queryStr: typeof Schema.String;
|
|
14
|
+
bindValues: Schema.UndefinedOr<Schema.brand<Schema.Union<[Schema.Array$<Schema.Union<[typeof Schema.String, typeof Schema.Number, Schema.Schema<Uint8Array, readonly number[], never>, typeof Schema.Null]>>, Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, typeof Schema.Number, Schema.Schema<Uint8Array, readonly number[], never>, typeof Schema.Null]>>]>, "PreparedBindValues">>;
|
|
15
|
+
durationMs: typeof Schema.Number;
|
|
16
|
+
rowsCount: Schema.UndefinedOr<typeof Schema.Number>;
|
|
17
|
+
queriedTables: Schema.ReadonlySet$<typeof Schema.String>;
|
|
18
|
+
startTimePerfNow: typeof Schema.Number;
|
|
19
|
+
}>;
|
|
20
|
+
export declare const DebugInfo: Schema.Struct<{
|
|
21
|
+
slowQueries: Schema.transform<Schema.Struct<{
|
|
22
|
+
size: typeof Schema.Number;
|
|
23
|
+
items: Schema.Array$<Schema.Schema<{
|
|
24
|
+
readonly bindValues: ((readonly (string | number | Uint8Array | null)[] | {
|
|
25
|
+
readonly [x: string]: string | number | Uint8Array | null;
|
|
26
|
+
}) & import("effect/Brand").Brand<"PreparedBindValues">) | undefined;
|
|
27
|
+
readonly queryStr: string;
|
|
28
|
+
readonly durationMs: number;
|
|
29
|
+
readonly rowsCount: number | undefined;
|
|
30
|
+
readonly queriedTables: ReadonlySet<string>;
|
|
31
|
+
readonly startTimePerfNow: number;
|
|
32
|
+
}, {
|
|
33
|
+
readonly bindValues: readonly (string | number | readonly number[] | null)[] | {
|
|
34
|
+
readonly [x: string]: string | number | readonly number[] | null;
|
|
35
|
+
} | undefined;
|
|
36
|
+
readonly queryStr: string;
|
|
37
|
+
readonly durationMs: number;
|
|
38
|
+
readonly rowsCount: number | undefined;
|
|
39
|
+
readonly queriedTables: readonly string[];
|
|
40
|
+
readonly startTimePerfNow: number;
|
|
41
|
+
}, never>>;
|
|
42
|
+
}>, Schema.Schema<BoundArray<{
|
|
43
|
+
readonly bindValues: ((readonly (string | number | Uint8Array | null)[] | {
|
|
44
|
+
readonly [x: string]: string | number | Uint8Array | null;
|
|
45
|
+
}) & import("effect/Brand").Brand<"PreparedBindValues">) | undefined;
|
|
46
|
+
readonly queryStr: string;
|
|
47
|
+
readonly durationMs: number;
|
|
48
|
+
readonly rowsCount: number | undefined;
|
|
49
|
+
readonly queriedTables: ReadonlySet<string>;
|
|
50
|
+
readonly startTimePerfNow: number;
|
|
51
|
+
}>, BoundArray<{
|
|
52
|
+
readonly bindValues: ((readonly (string | number | Uint8Array | null)[] | {
|
|
53
|
+
readonly [x: string]: string | number | Uint8Array | null;
|
|
54
|
+
}) & import("effect/Brand").Brand<"PreparedBindValues">) | undefined;
|
|
55
|
+
readonly queryStr: string;
|
|
56
|
+
readonly durationMs: number;
|
|
57
|
+
readonly rowsCount: number | undefined;
|
|
58
|
+
readonly queriedTables: ReadonlySet<string>;
|
|
59
|
+
readonly startTimePerfNow: number;
|
|
60
|
+
}>, never>>;
|
|
61
|
+
queryFrameDuration: typeof Schema.Number;
|
|
62
|
+
queryFrameCount: typeof Schema.Number;
|
|
63
|
+
events: Schema.transform<Schema.Struct<{
|
|
64
|
+
size: typeof Schema.Number;
|
|
65
|
+
items: Schema.Array$<Schema.Schema<readonly [string, any], readonly [string, any], never>>;
|
|
66
|
+
}>, Schema.Schema<BoundArray<readonly [string, any]>, BoundArray<readonly [string, any]>, never>>;
|
|
67
|
+
}>;
|
|
68
|
+
export type DebugInfo = typeof DebugInfo.Type;
|
|
69
|
+
export declare const MutableDebugInfo: Schema.mutable<Schema.Struct<{
|
|
70
|
+
slowQueries: Schema.transform<Schema.Struct<{
|
|
71
|
+
size: typeof Schema.Number;
|
|
72
|
+
items: Schema.Array$<Schema.Schema<{
|
|
73
|
+
readonly bindValues: ((readonly (string | number | Uint8Array | null)[] | {
|
|
74
|
+
readonly [x: string]: string | number | Uint8Array | null;
|
|
75
|
+
}) & import("effect/Brand").Brand<"PreparedBindValues">) | undefined;
|
|
76
|
+
readonly queryStr: string;
|
|
77
|
+
readonly durationMs: number;
|
|
78
|
+
readonly rowsCount: number | undefined;
|
|
79
|
+
readonly queriedTables: ReadonlySet<string>;
|
|
80
|
+
readonly startTimePerfNow: number;
|
|
81
|
+
}, {
|
|
82
|
+
readonly bindValues: readonly (string | number | readonly number[] | null)[] | {
|
|
83
|
+
readonly [x: string]: string | number | readonly number[] | null;
|
|
84
|
+
} | undefined;
|
|
85
|
+
readonly queryStr: string;
|
|
86
|
+
readonly durationMs: number;
|
|
87
|
+
readonly rowsCount: number | undefined;
|
|
88
|
+
readonly queriedTables: readonly string[];
|
|
89
|
+
readonly startTimePerfNow: number;
|
|
90
|
+
}, never>>;
|
|
91
|
+
}>, Schema.Schema<BoundArray<{
|
|
92
|
+
readonly bindValues: ((readonly (string | number | Uint8Array | null)[] | {
|
|
93
|
+
readonly [x: string]: string | number | Uint8Array | null;
|
|
94
|
+
}) & import("effect/Brand").Brand<"PreparedBindValues">) | undefined;
|
|
95
|
+
readonly queryStr: string;
|
|
96
|
+
readonly durationMs: number;
|
|
97
|
+
readonly rowsCount: number | undefined;
|
|
98
|
+
readonly queriedTables: ReadonlySet<string>;
|
|
99
|
+
readonly startTimePerfNow: number;
|
|
100
|
+
}>, BoundArray<{
|
|
101
|
+
readonly bindValues: ((readonly (string | number | Uint8Array | null)[] | {
|
|
102
|
+
readonly [x: string]: string | number | Uint8Array | null;
|
|
103
|
+
}) & import("effect/Brand").Brand<"PreparedBindValues">) | undefined;
|
|
104
|
+
readonly queryStr: string;
|
|
105
|
+
readonly durationMs: number;
|
|
106
|
+
readonly rowsCount: number | undefined;
|
|
107
|
+
readonly queriedTables: ReadonlySet<string>;
|
|
108
|
+
readonly startTimePerfNow: number;
|
|
109
|
+
}>, never>>;
|
|
110
|
+
queryFrameDuration: typeof Schema.Number;
|
|
111
|
+
queryFrameCount: typeof Schema.Number;
|
|
112
|
+
events: Schema.transform<Schema.Struct<{
|
|
113
|
+
size: typeof Schema.Number;
|
|
114
|
+
items: Schema.Array$<Schema.Schema<readonly [string, any], readonly [string, any], never>>;
|
|
115
|
+
}>, Schema.Schema<BoundArray<readonly [string, any]>, BoundArray<readonly [string, any]>, never>>;
|
|
116
|
+
}>>;
|
|
117
|
+
export type MutableDebugInfo = typeof MutableDebugInfo.Type;
|
|
118
|
+
//# sourceMappingURL=debug-info.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-info.d.ts","sourceRoot":"","sources":["../src/debug-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAe,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAE7D,OAAO,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAA;AAE9C,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,EAAE,MAAM,CAAA;IAChB,UAAU,EAAE,kBAAkB,GAAG,SAAS,CAAA;IAC1C,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,GAAG,SAAS,CAAA;IAC7B,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,CAAA;IAC1B,gBAAgB,EAAE,mBAAmB,CAAA;CACtC,CAAA;AAED,eAAO,MAAM,aAAa;;;;;;;EAOxB,CAAA;AAiDF,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAKpB,CAAA;AASF,MAAM,MAAM,SAAS,GAAG,OAAO,SAAS,CAAC,IAAI,CAAA;AAE7C,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAA4B,CAAA;AACzD,MAAM,MAAM,gBAAgB,GAAG,OAAO,gBAAgB,CAAC,IAAI,CAAA"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { ParseResult, Schema } from '@livestore/utils/effect';
|
|
2
|
+
import { BoundArray } from './bounded-collections.js';
|
|
3
|
+
import { PreparedBindValues } from './util.js';
|
|
4
|
+
export const SlowQueryInfo = Schema.Struct({
|
|
5
|
+
queryStr: Schema.String,
|
|
6
|
+
bindValues: Schema.UndefinedOr(PreparedBindValues),
|
|
7
|
+
durationMs: Schema.Number,
|
|
8
|
+
rowsCount: Schema.UndefinedOr(Schema.Number),
|
|
9
|
+
queriedTables: Schema.ReadonlySet(Schema.String),
|
|
10
|
+
startTimePerfNow: Schema.Number,
|
|
11
|
+
});
|
|
12
|
+
const BoundArraySchemaFromSelf = (_elSchema) => Schema.declare((_) => _ instanceof BoundArray, {
|
|
13
|
+
identifier: `BoundArrayFromSelf`,
|
|
14
|
+
pretty: () => (_) => `BoundArray(${_.length})`,
|
|
15
|
+
arbitrary: () => (fc) => fc.anything(),
|
|
16
|
+
equivalence: () => (a, b) => a === b,
|
|
17
|
+
});
|
|
18
|
+
const BoundArraySchemaFromSelf_ = (item) => Schema.declare([item], {
|
|
19
|
+
decode: (item) => (input, parseOptions, ast) => {
|
|
20
|
+
if (input instanceof BoundArray) {
|
|
21
|
+
const elements = ParseResult.decodeUnknown(Schema.Array(item))([...input], parseOptions);
|
|
22
|
+
return ParseResult.map(elements, (as) => BoundArray.make(input.sizeLimit, as));
|
|
23
|
+
}
|
|
24
|
+
return ParseResult.fail(new ParseResult.Type(ast, input));
|
|
25
|
+
},
|
|
26
|
+
encode: (item) => (input, parseOptions, ast) => {
|
|
27
|
+
if (input instanceof BoundArray) {
|
|
28
|
+
const elements = ParseResult.encodeUnknown(Schema.Array(item))([...input], parseOptions);
|
|
29
|
+
return ParseResult.map(elements, (is) => BoundArray.make(input.sizeLimit, is));
|
|
30
|
+
}
|
|
31
|
+
return ParseResult.fail(new ParseResult.Type(ast, input));
|
|
32
|
+
},
|
|
33
|
+
}, {
|
|
34
|
+
description: `BoundArray<${Schema.format(item)}>`,
|
|
35
|
+
});
|
|
36
|
+
const BoundArraySchema = (elSchema) => Schema.transform(Schema.Struct({
|
|
37
|
+
size: Schema.Number,
|
|
38
|
+
items: Schema.Array(elSchema),
|
|
39
|
+
}), BoundArraySchemaFromSelf(elSchema), {
|
|
40
|
+
encode: (_) => ({ size: _.sizeLimit, items: [..._] }),
|
|
41
|
+
decode: (_) => BoundArray.make(_.size, _.items),
|
|
42
|
+
});
|
|
43
|
+
export const DebugInfo = Schema.Struct({
|
|
44
|
+
slowQueries: BoundArraySchema(SlowQueryInfo),
|
|
45
|
+
queryFrameDuration: Schema.Number,
|
|
46
|
+
queryFrameCount: Schema.Number,
|
|
47
|
+
events: BoundArraySchema(Schema.Tuple(Schema.String, Schema.Any)),
|
|
48
|
+
});
|
|
49
|
+
export const MutableDebugInfo = Schema.mutable(DebugInfo);
|
|
50
|
+
//# sourceMappingURL=debug-info.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-info.js","sourceRoot":"","sources":["../src/debug-info.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,yBAAyB,CAAA;AAE7D,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,CAAC;CAC9B,CAAC,EACF,wBAAwB,CAAC,QAA6C,CAAC,EACvE;IACE,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC,SAAS,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;IACrD,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,KAAK,CAAC;CAChD,CACF,CAAA;AAEH,MAAM,CAAC,MAAM,SAAS,GAAG,MAAM,CAAC,MAAM,CAAC;IACrC,WAAW,EAAE,gBAAgB,CAAC,aAAa,CAAC;IAC5C,kBAAkB,EAAE,MAAM,CAAC,MAAM;IACjC,eAAe,EAAE,MAAM,CAAC,MAAM;IAC9B,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;CAClE,CAAC,CAAA;AAWF,MAAM,CAAC,MAAM,gBAAgB,GAAG,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA"}
|
|
@@ -18,19 +18,19 @@ export declare const makeDerivedMutationDefsForTable: <TTableDef extends DbSchem
|
|
|
18
18
|
readonly [x: string]: any;
|
|
19
19
|
}>;
|
|
20
20
|
update: import("./schema/mutations.js").MutationDef<`_Derived_Update_${string}`, {
|
|
21
|
-
readonly where: {
|
|
22
|
-
[x: string]: any;
|
|
23
|
-
};
|
|
24
21
|
readonly values: {
|
|
25
22
|
[x: string]: any;
|
|
26
23
|
};
|
|
27
|
-
}, {
|
|
28
24
|
readonly where: {
|
|
29
25
|
[x: string]: any;
|
|
30
26
|
};
|
|
27
|
+
}, {
|
|
31
28
|
readonly values: {
|
|
32
29
|
[x: string]: any;
|
|
33
30
|
};
|
|
31
|
+
readonly where: {
|
|
32
|
+
[x: string]: any;
|
|
33
|
+
};
|
|
34
34
|
}>;
|
|
35
35
|
delete: import("./schema/mutations.js").MutationDef<`_Derived_Delete_${string}`, {
|
|
36
36
|
readonly where: {
|
|
@@ -60,19 +60,19 @@ export declare const deriveUpdateMutationDef: <TTableDef extends DbSchema.TableD
|
|
|
60
60
|
enabled: true;
|
|
61
61
|
};
|
|
62
62
|
}, Schema.Schema<any, any, never>>>(table: TTableDef) => import("./schema/mutations.js").MutationDef<`_Derived_Update_${string}`, {
|
|
63
|
-
readonly where: {
|
|
64
|
-
[x: string]: any;
|
|
65
|
-
};
|
|
66
63
|
readonly values: {
|
|
67
64
|
[x: string]: any;
|
|
68
65
|
};
|
|
69
|
-
}, {
|
|
70
66
|
readonly where: {
|
|
71
67
|
[x: string]: any;
|
|
72
68
|
};
|
|
69
|
+
}, {
|
|
73
70
|
readonly values: {
|
|
74
71
|
[x: string]: any;
|
|
75
72
|
};
|
|
73
|
+
readonly where: {
|
|
74
|
+
[x: string]: any;
|
|
75
|
+
};
|
|
76
76
|
}>;
|
|
77
77
|
export declare const deriveDeleteMutationDef: <TTableDef extends DbSchema.TableDef<DbSchema.DefaultSqliteTableDefConstrained, boolean, DbSchema.TableOptions & {
|
|
78
78
|
deriveMutations: {
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { Schema } from '@livestore/utils/effect';
|
|
2
|
+
declare const SnapshotReq_base: Schema.TaggedStruct<"LSD.SnapshotReq", {
|
|
3
|
+
requestId: typeof Schema.String;
|
|
4
|
+
channelId: typeof Schema.String;
|
|
5
|
+
}>;
|
|
6
|
+
export declare class SnapshotReq extends SnapshotReq_base {
|
|
7
|
+
}
|
|
8
|
+
declare const SnapshotRes_base: Schema.TaggedStruct<"LSD.SnapshotRes", {
|
|
9
|
+
requestId: typeof Schema.String;
|
|
10
|
+
snapshot: Schema.Schema<Uint8Array, readonly number[], never>;
|
|
11
|
+
}>;
|
|
12
|
+
export declare class SnapshotRes extends SnapshotRes_base {
|
|
13
|
+
}
|
|
14
|
+
declare const DebugInfoReq_base: Schema.TaggedStruct<"LSD.DebugInfoReq", {
|
|
15
|
+
requestId: typeof Schema.String;
|
|
16
|
+
channelId: typeof Schema.String;
|
|
17
|
+
}>;
|
|
18
|
+
export declare class DebugInfoReq extends DebugInfoReq_base {
|
|
19
|
+
}
|
|
20
|
+
declare const DebugInfoRes_base: Schema.TaggedStruct<"LSD.DebugInfoRes", {
|
|
21
|
+
requestId: typeof Schema.String;
|
|
22
|
+
debugInfo: Schema.Struct<{
|
|
23
|
+
slowQueries: Schema.transform<Schema.Struct<{
|
|
24
|
+
size: typeof Schema.Number;
|
|
25
|
+
items: Schema.Array$<Schema.Schema<{
|
|
26
|
+
readonly queryStr: string;
|
|
27
|
+
readonly bindValues: ((readonly (string | number | Uint8Array | null)[] | {
|
|
28
|
+
readonly [x: string]: string | number | Uint8Array | null;
|
|
29
|
+
}) & import("effect/Brand").Brand<"PreparedBindValues">) | undefined;
|
|
30
|
+
readonly durationMs: number;
|
|
31
|
+
readonly rowsCount: number | undefined;
|
|
32
|
+
readonly queriedTables: ReadonlySet<string>;
|
|
33
|
+
readonly startTimePerfNow: number;
|
|
34
|
+
}, {
|
|
35
|
+
readonly queryStr: string;
|
|
36
|
+
readonly bindValues: readonly (string | number | readonly number[] | null)[] | {
|
|
37
|
+
readonly [x: string]: string | number | readonly number[] | null;
|
|
38
|
+
} | undefined;
|
|
39
|
+
readonly durationMs: number;
|
|
40
|
+
readonly rowsCount: number | undefined;
|
|
41
|
+
readonly queriedTables: readonly string[];
|
|
42
|
+
readonly startTimePerfNow: number;
|
|
43
|
+
}, never>>;
|
|
44
|
+
}>, Schema.Schema<import("../bounded-collections.js").BoundArray<{
|
|
45
|
+
readonly queryStr: string;
|
|
46
|
+
readonly bindValues: ((readonly (string | number | Uint8Array | null)[] | {
|
|
47
|
+
readonly [x: string]: string | number | Uint8Array | null;
|
|
48
|
+
}) & import("effect/Brand").Brand<"PreparedBindValues">) | undefined;
|
|
49
|
+
readonly durationMs: number;
|
|
50
|
+
readonly rowsCount: number | undefined;
|
|
51
|
+
readonly queriedTables: ReadonlySet<string>;
|
|
52
|
+
readonly startTimePerfNow: number;
|
|
53
|
+
}>, import("../bounded-collections.js").BoundArray<{
|
|
54
|
+
readonly queryStr: string;
|
|
55
|
+
readonly bindValues: ((readonly (string | number | Uint8Array | null)[] | {
|
|
56
|
+
readonly [x: string]: string | number | Uint8Array | null;
|
|
57
|
+
}) & import("effect/Brand").Brand<"PreparedBindValues">) | undefined;
|
|
58
|
+
readonly durationMs: number;
|
|
59
|
+
readonly rowsCount: number | undefined;
|
|
60
|
+
readonly queriedTables: ReadonlySet<string>;
|
|
61
|
+
readonly startTimePerfNow: number;
|
|
62
|
+
}>, never>>;
|
|
63
|
+
queryFrameDuration: typeof Schema.Number;
|
|
64
|
+
queryFrameCount: typeof Schema.Number;
|
|
65
|
+
events: Schema.transform<Schema.Struct<{
|
|
66
|
+
size: typeof Schema.Number;
|
|
67
|
+
items: Schema.Array$<Schema.Schema<readonly [string, any], readonly [string, any], never>>;
|
|
68
|
+
}>, Schema.Schema<import("../bounded-collections.js").BoundArray<readonly [string, any]>, import("../bounded-collections.js").BoundArray<readonly [string, any]>, never>>;
|
|
69
|
+
}>;
|
|
70
|
+
}>;
|
|
71
|
+
export declare class DebugInfoRes extends DebugInfoRes_base {
|
|
72
|
+
}
|
|
73
|
+
declare const DebugInfoResetReq_base: Schema.TaggedStruct<"LSD.DebugInfoResetReq", {
|
|
74
|
+
requestId: typeof Schema.String;
|
|
75
|
+
channelId: typeof Schema.String;
|
|
76
|
+
}>;
|
|
77
|
+
export declare class DebugInfoResetReq extends DebugInfoResetReq_base {
|
|
78
|
+
}
|
|
79
|
+
declare const DebugInfoResetRes_base: Schema.TaggedStruct<"LSD.DebugInfoResetRes", {
|
|
80
|
+
requestId: typeof Schema.String;
|
|
81
|
+
}>;
|
|
82
|
+
export declare class DebugInfoResetRes extends DebugInfoResetRes_base {
|
|
83
|
+
}
|
|
84
|
+
declare const DebugInfoRerunQueryReq_base: Schema.TaggedStruct<"LSD.DebugInfoRerunQueryReq", {
|
|
85
|
+
requestId: typeof Schema.String;
|
|
86
|
+
channelId: typeof Schema.String;
|
|
87
|
+
queryStr: typeof Schema.String;
|
|
88
|
+
bindValues: Schema.UndefinedOr<Schema.brand<Schema.Union<[Schema.Array$<Schema.Union<[typeof Schema.String, typeof Schema.Number, Schema.Schema<Uint8Array, readonly number[], never>, typeof Schema.Null]>>, Schema.Record$<typeof Schema.String, Schema.Union<[typeof Schema.String, typeof Schema.Number, Schema.Schema<Uint8Array, readonly number[], never>, typeof Schema.Null]>>]>, "PreparedBindValues">>;
|
|
89
|
+
queriedTables: Schema.ReadonlySet$<typeof Schema.String>;
|
|
90
|
+
}>;
|
|
91
|
+
export declare class DebugInfoRerunQueryReq extends DebugInfoRerunQueryReq_base {
|
|
92
|
+
}
|
|
93
|
+
declare const DebugInfoRerunQueryRes_base: Schema.TaggedStruct<"LSD.DebugInfoRerunQueryRes", {
|
|
94
|
+
requestId: typeof Schema.String;
|
|
95
|
+
}>;
|
|
96
|
+
export declare class DebugInfoRerunQueryRes extends DebugInfoRerunQueryRes_base {
|
|
97
|
+
}
|
|
98
|
+
declare const MutationBroadcast_base: Schema.TaggedStruct<"LSD.MutationBroadcast", {
|
|
99
|
+
requestId: typeof Schema.String;
|
|
100
|
+
mutationEventEncoded: Schema.Struct<{
|
|
101
|
+
mutation: typeof Schema.String;
|
|
102
|
+
args: typeof Schema.Any;
|
|
103
|
+
id: typeof Schema.String;
|
|
104
|
+
}>;
|
|
105
|
+
persisted: typeof Schema.Boolean;
|
|
106
|
+
}>;
|
|
107
|
+
export declare class MutationBroadcast extends MutationBroadcast_base {
|
|
108
|
+
}
|
|
109
|
+
declare const MutationLogReq_base: Schema.TaggedStruct<"LSD.MutationLogReq", {
|
|
110
|
+
requestId: typeof Schema.String;
|
|
111
|
+
channelId: typeof Schema.String;
|
|
112
|
+
}>;
|
|
113
|
+
export declare class MutationLogReq extends MutationLogReq_base {
|
|
114
|
+
}
|
|
115
|
+
declare const MutationLogRes_base: Schema.TaggedStruct<"LSD.MutationLogRes", {
|
|
116
|
+
requestId: typeof Schema.String;
|
|
117
|
+
mutationLog: Schema.Schema<Uint8Array, readonly number[], never>;
|
|
118
|
+
}>;
|
|
119
|
+
export declare class MutationLogRes extends MutationLogRes_base {
|
|
120
|
+
}
|
|
121
|
+
declare const SignalsSubscribe_base: Schema.TaggedStruct<"LSD.SignalsSubscribe", {
|
|
122
|
+
requestId: typeof Schema.String;
|
|
123
|
+
channelId: typeof Schema.String;
|
|
124
|
+
includeResults: typeof Schema.Boolean;
|
|
125
|
+
}>;
|
|
126
|
+
export declare class SignalsSubscribe extends SignalsSubscribe_base {
|
|
127
|
+
}
|
|
128
|
+
declare const SignalsUnsubscribe_base: Schema.TaggedStruct<"LSD.SignalsUnsubscribe", {
|
|
129
|
+
requestId: typeof Schema.String;
|
|
130
|
+
channelId: typeof Schema.String;
|
|
131
|
+
}>;
|
|
132
|
+
export declare class SignalsUnsubscribe extends SignalsUnsubscribe_base {
|
|
133
|
+
}
|
|
134
|
+
declare const SignalsRes_base: Schema.TaggedStruct<"LSD.SignalsRes", {
|
|
135
|
+
requestId: typeof Schema.String;
|
|
136
|
+
signals: typeof Schema.Any;
|
|
137
|
+
}>;
|
|
138
|
+
export declare class SignalsRes extends SignalsRes_base {
|
|
139
|
+
}
|
|
140
|
+
declare const LiveQueriesSubscribe_base: Schema.TaggedStruct<"LSD.LiveQueriesSubscribe", {
|
|
141
|
+
requestId: typeof Schema.String;
|
|
142
|
+
channelId: typeof Schema.String;
|
|
143
|
+
}>;
|
|
144
|
+
export declare class LiveQueriesSubscribe extends LiveQueriesSubscribe_base {
|
|
145
|
+
}
|
|
146
|
+
declare const LiveQueriesUnsubscribe_base: Schema.TaggedStruct<"LSD.LiveQueriesUnsubscribe", {
|
|
147
|
+
requestId: typeof Schema.String;
|
|
148
|
+
channelId: typeof Schema.String;
|
|
149
|
+
}>;
|
|
150
|
+
export declare class LiveQueriesUnsubscribe extends LiveQueriesUnsubscribe_base {
|
|
151
|
+
}
|
|
152
|
+
declare const SerializedLiveQuery_base: Schema.Struct<{
|
|
153
|
+
_tag: Schema.Literal<["js", "sql", "graphql"]>;
|
|
154
|
+
id: typeof Schema.Number;
|
|
155
|
+
label: typeof Schema.String;
|
|
156
|
+
runs: typeof Schema.Number;
|
|
157
|
+
executionTimes: Schema.Array$<typeof Schema.Number>;
|
|
158
|
+
lastestResult: typeof Schema.Any;
|
|
159
|
+
activeSubscriptions: Schema.Array$<Schema.Struct<{
|
|
160
|
+
frames: Schema.Array$<Schema.Struct<{
|
|
161
|
+
name: typeof Schema.String;
|
|
162
|
+
filePath: typeof Schema.String;
|
|
163
|
+
}>>;
|
|
164
|
+
}>>;
|
|
165
|
+
}>;
|
|
166
|
+
export declare class SerializedLiveQuery extends SerializedLiveQuery_base {
|
|
167
|
+
}
|
|
168
|
+
declare const LiveQueriesRes_base: Schema.TaggedStruct<"LSD.LiveQueriesRes", {
|
|
169
|
+
requestId: typeof Schema.String;
|
|
170
|
+
liveQueries: Schema.Array$<typeof SerializedLiveQuery>;
|
|
171
|
+
}>;
|
|
172
|
+
export declare class LiveQueriesRes extends LiveQueriesRes_base {
|
|
173
|
+
}
|
|
174
|
+
declare const ResetAllDataReq_base: Schema.TaggedStruct<"LSD.ResetAllDataReq", {
|
|
175
|
+
requestId: typeof Schema.String;
|
|
176
|
+
channelId: typeof Schema.String;
|
|
177
|
+
mode: Schema.Literal<["all-data", "only-app-db"]>;
|
|
178
|
+
}>;
|
|
179
|
+
export declare class ResetAllDataReq extends ResetAllDataReq_base {
|
|
180
|
+
}
|
|
181
|
+
declare const ResetAllDataRes_base: Schema.TaggedStruct<"LSD.ResetAllDataRes", {
|
|
182
|
+
requestId: typeof Schema.String;
|
|
183
|
+
}>;
|
|
184
|
+
export declare class ResetAllDataRes extends ResetAllDataRes_base {
|
|
185
|
+
}
|
|
186
|
+
declare const NetworkStatusBroadcast_base: Schema.TaggedStruct<"LSD.NetworkStatusBroadcast", {
|
|
187
|
+
channelId: typeof Schema.String;
|
|
188
|
+
networkStatus: Schema.Struct<{
|
|
189
|
+
isConnected: typeof Schema.Boolean;
|
|
190
|
+
timestampMs: typeof Schema.Number;
|
|
191
|
+
}>;
|
|
192
|
+
}>;
|
|
193
|
+
export declare class NetworkStatusBroadcast extends NetworkStatusBroadcast_base {
|
|
194
|
+
}
|
|
195
|
+
declare const DevtoolsReadyBroadcast_base: Schema.TaggedStruct<"LSD.DevtoolsReadyBroadcast", {}>;
|
|
196
|
+
export declare class DevtoolsReadyBroadcast extends DevtoolsReadyBroadcast_base {
|
|
197
|
+
}
|
|
198
|
+
declare const DevtoolsConnected_base: Schema.TaggedStruct<"LSD.DevtoolsConnected", {
|
|
199
|
+
channelId: typeof Schema.String;
|
|
200
|
+
}>;
|
|
201
|
+
export declare class DevtoolsConnected extends DevtoolsConnected_base {
|
|
202
|
+
}
|
|
203
|
+
declare const AppHostReadyBroadcast_base: Schema.TaggedStruct<"LSD.AppHostReadyBroadcast", {
|
|
204
|
+
channelId: typeof Schema.String;
|
|
205
|
+
}>;
|
|
206
|
+
export declare class AppHostReadyBroadcast extends AppHostReadyBroadcast_base {
|
|
207
|
+
}
|
|
208
|
+
declare const Disconnect_base: Schema.TaggedStruct<"LSD.Disconnect", {
|
|
209
|
+
requestId: typeof Schema.String;
|
|
210
|
+
channelId: typeof Schema.String;
|
|
211
|
+
}>;
|
|
212
|
+
export declare class Disconnect extends Disconnect_base {
|
|
213
|
+
}
|
|
214
|
+
export declare const MessageToAppHost: Schema.Union<[typeof SnapshotReq, typeof MutationLogReq, typeof DebugInfoReq, typeof DebugInfoResetReq, typeof DebugInfoRerunQueryReq, typeof SignalsSubscribe, typeof SignalsUnsubscribe, typeof LiveQueriesSubscribe, typeof LiveQueriesUnsubscribe, typeof ResetAllDataReq, typeof DevtoolsReadyBroadcast, typeof Disconnect, typeof DevtoolsConnected]>;
|
|
215
|
+
export type MessageToAppHost = typeof MessageToAppHost.Type;
|
|
216
|
+
export declare const MessageFromAppHost: Schema.Union<[typeof SnapshotRes, typeof MutationLogRes, typeof DebugInfoRes, typeof DebugInfoResetRes, typeof DebugInfoRerunQueryRes, typeof SignalsRes, typeof LiveQueriesRes, typeof ResetAllDataRes, typeof Disconnect, typeof MutationBroadcast, typeof AppHostReadyBroadcast, typeof NetworkStatusBroadcast]>;
|
|
217
|
+
export type MessageFromAppHost = typeof MessageFromAppHost.Type;
|
|
218
|
+
export declare const makeBroadcastChannels: () => {
|
|
219
|
+
fromAppHost: BroadcastChannel;
|
|
220
|
+
toAppHost: BroadcastChannel;
|
|
221
|
+
};
|
|
222
|
+
export {};
|
|
223
|
+
//# sourceMappingURL=devtools-messages.d.ts.map
|