@livestore/livestore 0.4.0-dev.19 → 0.4.0-dev.20

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.
@@ -174,6 +174,15 @@ export interface CreateStoreOptions<
174
174
  }
175
175
  }
176
176
 
177
+ export type CreateStoreOptionsPromise<
178
+ TSchema extends LiveStoreSchema = LiveStoreSchema.Any,
179
+ TContext = {},
180
+ TSyncPayloadSchema extends Schema.Schema<any> = typeof Schema.JsonValue,
181
+ > = CreateStoreOptions<TSchema, TContext, TSyncPayloadSchema> & {
182
+ signal?: AbortSignal
183
+ otelOptions?: Partial<OtelOptions>
184
+ }
185
+
177
186
  /** Create a new LiveStore Store */
178
187
  export const createStorePromise = async <
179
188
  TSchema extends LiveStoreSchema = LiveStoreSchema.Any,
@@ -183,10 +192,7 @@ export const createStorePromise = async <
183
192
  signal,
184
193
  otelOptions,
185
194
  ...options
186
- }: CreateStoreOptions<TSchema, TContext, TSyncPayloadSchema> & {
187
- signal?: AbortSignal
188
- otelOptions?: Partial<OtelOptions>
189
- }): Promise<Store<TSchema, TContext>> =>
195
+ }: CreateStoreOptionsPromise<TSchema, TContext, TSyncPayloadSchema>): Promise<Store<TSchema, TContext>> =>
190
196
  Effect.gen(function* () {
191
197
  const scope = yield* Scope.make()
192
198
  const runtime = yield* Effect.runtime()
@@ -277,7 +277,7 @@ export namespace Queryable {
277
277
  export type Result<TQueryable extends Queryable<any>> = TQueryable extends Queryable<infer TResult> ? TResult : never
278
278
  }
279
279
 
280
- const isLiveQueryDef = (value: unknown): value is LiveQueryDef<any> | SignalDef<any> => {
280
+ export const isLiveQueryDef = (value: unknown): value is LiveQueryDef<any> | SignalDef<any> => {
281
281
  if (typeof value !== 'object' || value === null) {
282
282
  return false
283
283
  }
@@ -305,7 +305,7 @@ const isLiveQueryDef = (value: unknown): value is LiveQueryDef<any> | SignalDef<
305
305
  return true
306
306
  }
307
307
 
308
- const isLiveQueryInstance = (value: unknown): value is LiveQuery<any> => Predicate.hasProperty(value, TypeId)
308
+ export const isLiveQueryInstance = (value: unknown): value is LiveQuery<any> => Predicate.hasProperty(value, TypeId)
309
309
 
310
310
  export const isQueryable = (value: unknown): value is Queryable<unknown> =>
311
311
  isQueryBuilder(value) || isLiveQueryInstance(value) || isLiveQueryDef(value)
package/src/utils/dev.ts CHANGED
@@ -1,10 +1,8 @@
1
1
  import type { SqliteDb } from '@livestore/common'
2
2
  import { prettyBytes } from '@livestore/utils'
3
3
  import { Effect } from '@livestore/utils/effect'
4
- import { Opfs } from '@livestore/utils/effect/browser'
5
4
 
6
5
  declare global {
7
- // declaring a global *value* is the least fussy when augmenting inline
8
6
  var __debugLiveStoreUtils: any
9
7
  }
10
8
 
@@ -34,7 +32,6 @@ export const downloadURL = (data: string, fileName: string) => {
34
32
 
35
33
  export const exposeDebugUtils = () => {
36
34
  globalThis.__debugLiveStoreUtils = {
37
- opfs: Opfs.debugUtils,
38
35
  downloadBlob,
39
36
  runSync: (effect: Effect.Effect<any, any, never>) => Effect.runSync(effect),
40
37
  runFork: (effect: Effect.Effect<any, any, never>) => Effect.runFork(effect),