@nxtedition/deepstream.io-client-js 31.2.9 → 31.2.11
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/.claude/settings.local.json +9 -0
- package/nxtedition-deepstream.io-client-js-31.0.18-b1.tgz +0 -0
- package/nxtedition-deepstream.io-client-js-31.0.18-b2.tgz +0 -0
- package/nxtedition-deepstream.io-client-js-31.0.18-b3.tgz +0 -0
- package/package.json +1 -1
- package/src/client.test-d.ts +11 -1
- package/src/record/record-handler.d.ts +10 -1
- package/src/record/record.d.ts +1 -0
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
package/src/client.test-d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
2
|
import make, { type DeepstreamClient } from './client.js'
|
|
3
|
-
import { expectAssignable, expectError } from 'tsd'
|
|
3
|
+
import { expectAssignable, expectError, expectType } from 'tsd'
|
|
4
4
|
import type { Observable } from 'rxjs'
|
|
5
5
|
|
|
6
6
|
interface Records extends Record<string, unknown> {
|
|
@@ -195,6 +195,11 @@ rec.set('o0.o1', {})
|
|
|
195
195
|
expectError(rec.update((x) => 'x'))
|
|
196
196
|
expectError(rec.update('o0', (x) => ({ ...x, o1: '22' })))
|
|
197
197
|
|
|
198
|
+
expectType<string | undefined>(rec.get('o0.o1.o2.o3'))
|
|
199
|
+
expectType<{ o0?: { o1?: { o2?: { o3?: string } } } }>(rec.get())
|
|
200
|
+
const pathOrUndefined: 'o0.01.02.03' | undefined = undefined
|
|
201
|
+
expectType<unknown>(rec.get(pathOrUndefined))
|
|
202
|
+
|
|
198
203
|
// when with options
|
|
199
204
|
expectAssignable<Promise<typeof rec>>(rec.when())
|
|
200
205
|
expectAssignable<Promise<typeof rec>>(rec.when(2))
|
|
@@ -214,3 +219,8 @@ expectAssignable<Promise<void>>(
|
|
|
214
219
|
)
|
|
215
220
|
expectAssignable<Promise<void>>(rec.update('o0', (x) => x, { timeout: 5000 }))
|
|
216
221
|
expectAssignable<Promise<void>>(rec.update('o0', (x) => x, { state: 2 }))
|
|
222
|
+
|
|
223
|
+
const state = 'VOID'
|
|
224
|
+
expectType<0>(ds.record.STATE[state])
|
|
225
|
+
const unknownState: string = 'VOID'
|
|
226
|
+
expectType<number>(ds.record.STATE[unknownState])
|
|
@@ -17,10 +17,19 @@ export default class RecordHandler<Records = Record<string, unknown>> {
|
|
|
17
17
|
STALE: 3
|
|
18
18
|
PROVIDER: 4
|
|
19
19
|
|
|
20
|
+
STATE: {
|
|
21
|
+
VOID: 0
|
|
22
|
+
CLIENT: 1
|
|
23
|
+
SERVER: 2
|
|
24
|
+
STALE: 3
|
|
25
|
+
PROVIDER: 4
|
|
26
|
+
[key: string]: number
|
|
27
|
+
}
|
|
28
|
+
|
|
20
29
|
JSON: {
|
|
21
30
|
EMPTY: EmptyObject
|
|
22
31
|
EMPTY_OBJ: EmptyObject
|
|
23
|
-
EMPTY_ARR:
|
|
32
|
+
EMPTY_ARR: []
|
|
24
33
|
}
|
|
25
34
|
|
|
26
35
|
connected: boolean
|