@spooky-sync/client-solid2 0.0.1-canary.280 → 0.0.1-canary.281

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/src/index.ts CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  type StorageHealth,
11
11
  type PreloadOptions,
12
12
  type PreloadRefresh,
13
+ type WebPushModule,
13
14
  } from '@spooky-sync/core';
14
15
 
15
16
  import type {
@@ -66,6 +67,26 @@ export type {
66
67
  } from '@spooky-sync/core';
67
68
  export { useStorageStatus, type UseStorageStatus } from './lib/use-storage-status';
68
69
  export type { StorageHealth, StorageHealthStatus } from '@spooky-sync/core';
70
+ export {
71
+ WebPushError,
72
+ type WebPushModule,
73
+ type WebPushConfig,
74
+ type WebPushSupport,
75
+ type WebPushUnsupportedReason,
76
+ type WebPushInfo,
77
+ type WebPushDevice,
78
+ type WebPushSubscribeOptions,
79
+ type WebPushUnsubscribeOptions,
80
+ type WebPushSyncOptions,
81
+ type WebPushSyncStatus,
82
+ type WebPushUpdateOptions,
83
+ type WebPushMessageInput,
84
+ type WebPushMessage,
85
+ type WebPushErrorCode,
86
+ type WebPushClientMessage,
87
+ type PushPayload,
88
+ type PushNotification,
89
+ } from '@spooky-sync/core';
69
90
  export { useCrdtField } from './lib/use-crdt-field';
70
91
  export { useFeatureFlag, type UseFeatureFlag } from './lib/use-feature-flag';
71
92
  export {
@@ -438,6 +459,16 @@ export class SyncedDb<S extends SchemaStructure> {
438
459
  return this.sp00ky.subscribeToStorageHealth(cb);
439
460
  }
440
461
 
462
+ /**
463
+ * Web Push for this browser: `support()`, `subscribe()` (from a click),
464
+ * `devices()`, `notify()` / `test()` (push to yourself), `bridge()` for the
465
+ * service worker. See the push-notifications docs page.
466
+ */
467
+ get webPush(): WebPushModule {
468
+ if (!this.sp00ky) throw new Error('SyncedDb not initialized');
469
+ return this.sp00ky.webPush;
470
+ }
471
+
441
472
  bucket<B extends BucketNames<S>>(name: B): BucketHandle {
442
473
  if (!this.sp00ky) throw new Error('SyncedDb not initialized');
443
474
  return this.sp00ky.bucket(name);