@chromahq/store 0.1.13 → 0.1.14

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/index.cjs.js CHANGED
@@ -396,6 +396,7 @@ async function init(storeDefinition) {
396
396
  }
397
397
  const store = await builder.create();
398
398
  return {
399
+ def: storeDefinition,
399
400
  store,
400
401
  classes: autoRegisterStoreHandlers(store)
401
402
  };
@@ -417,5 +418,6 @@ exports.createActionHookForStore = createActionHookForStore;
417
418
  exports.createBridgeStore = createBridgeStore;
418
419
  exports.createStore = createStore;
419
420
  exports.createStoreHooks = createStoreHooks;
421
+ exports.init = init;
420
422
  exports.useCentralDispatch = useCentralDispatch;
421
423
  exports.useCentralStore = useCentralStore;
package/dist/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { StoreApi, StateCreator } from 'zustand';
1
+ import { StateCreator, StoreApi } from 'zustand';
2
2
  import * as React from 'react';
3
3
  import { ReactNode } from 'react';
4
4
  import { StateCreator as StateCreator$1 } from 'zustand/vanilla';
@@ -134,5 +134,10 @@ declare class StoreBuilder<T = any> {
134
134
  */
135
135
  declare function createStore<T = any>(name?: string): StoreBuilder<T>;
136
136
 
137
- export { BridgeStore, StoreBuilder, chromeStoragePersist, createActionHookForStore, createBridgeStore, createStore, createStoreHooks, useCentralDispatch, useCentralStore };
137
+ /**
138
+ * Initialize a store from a store definition
139
+ */
140
+ declare function init(storeDefinition: StoreDefinition): Promise<any>;
141
+
142
+ export { BridgeStore, StoreBuilder, chromeStoragePersist, createActionHookForStore, createBridgeStore, createStore, createStoreHooks, init, useCentralDispatch, useCentralStore };
138
143
  export type { Bridge, BridgeWithEvents, BridgeWithHandlers, CentralStore, ExtractSliceState, MergeSlices, PersistOptions, SliceCreator, StoreConfig, StoreDefinition };
package/dist/index.es.js CHANGED
@@ -376,6 +376,7 @@ async function init(storeDefinition) {
376
376
  }
377
377
  const store = await builder.create();
378
378
  return {
379
+ def: storeDefinition,
379
380
  store,
380
381
  classes: autoRegisterStoreHandlers(store)
381
382
  };
@@ -390,4 +391,4 @@ if (typeof globalThis !== "undefined") {
390
391
  globalThis.initStores = init;
391
392
  }
392
393
 
393
- export { BridgeStore, StoreBuilder, chromeStoragePersist, createActionHookForStore, createBridgeStore, createStore, createStoreHooks, useCentralDispatch, useCentralStore };
394
+ export { BridgeStore, StoreBuilder, chromeStoragePersist, createActionHookForStore, createBridgeStore, createStore, createStoreHooks, init, useCentralDispatch, useCentralStore };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chromahq/store",
3
- "version": "0.1.13",
3
+ "version": "0.1.14",
4
4
  "description": "Centralized, persistent store for Chrome extensions using zustand, accessible from service workers and React, with chrome.storage.local persistence.",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",