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

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,27 @@ 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 PushDeviceKind,
79
+ type WebPushSubscribeOptions,
80
+ type WebPushUnsubscribeOptions,
81
+ type WebPushSyncOptions,
82
+ type WebPushSyncStatus,
83
+ type WebPushUpdateOptions,
84
+ type WebPushMessageInput,
85
+ type WebPushMessage,
86
+ type WebPushErrorCode,
87
+ type WebPushClientMessage,
88
+ type PushPayload,
89
+ type PushNotification,
90
+ } from '@spooky-sync/core';
69
91
  export { useCrdtField } from './lib/use-crdt-field';
70
92
  export { useFeatureFlag, type UseFeatureFlag } from './lib/use-feature-flag';
71
93
  export {
@@ -438,6 +460,16 @@ export class SyncedDb<S extends SchemaStructure> {
438
460
  return this.sp00ky.subscribeToStorageHealth(cb);
439
461
  }
440
462
 
463
+ /**
464
+ * Web Push for this browser: `support()`, `subscribe()` (from a click),
465
+ * `devices()`, `notify()` / `test()` (push to yourself), `bridge()` for the
466
+ * service worker. See the push-notifications docs page.
467
+ */
468
+ get webPush(): WebPushModule {
469
+ if (!this.sp00ky) throw new Error('SyncedDb not initialized');
470
+ return this.sp00ky.webPush;
471
+ }
472
+
441
473
  bucket<B extends BucketNames<S>>(name: B): BucketHandle {
442
474
  if (!this.sp00ky) throw new Error('SyncedDb not initialized');
443
475
  return this.sp00ky.bucket(name);