]> git.ipfire.org Git - thirdparty/vuejs/pinia.git/commitdiff
fix(types): remove unused option hydrate for setup stores
authorEduardo San Martin Morote <posva13@gmail.com>
Mon, 25 Oct 2021 14:23:17 +0000 (16:23 +0200)
committerEduardo San Martin Morote <posva13@gmail.com>
Mon, 25 Oct 2021 14:23:17 +0000 (16:23 +0200)
packages/pinia/src/store.ts
packages/pinia/src/types.ts

index 488c3b6e59ba885a807ba193532379a84de75edf..f4a037b1a15b5078163c29e0e1abe76ca81b37dc 100644 (file)
@@ -644,7 +644,6 @@ function createSetupStore<
           store,
           app: pinia._a,
           pinia,
-          // @ts-expect-error
           options: optionsForPlugin,
         })
       )!
@@ -660,7 +659,6 @@ function createSetupStore<
             store,
             app: pinia._a,
             pinia,
-            // @ts-expect-error
             options: optionsForPlugin,
           })
         )!
index c0b03a07e944e006c0565a559b5231be3387e2e2..4f7ef205cc67d410c8a6f6995cb80a9e94ac0675 100644 (file)
@@ -608,16 +608,7 @@ export type _ExtractGettersFromSetupStore<SS> = SS extends undefined | void
  * stores. Extend this interface if you want to add custom options to both kinds
  * of stores.
  */
-export interface DefineStoreOptionsBase<S extends StateTree, Store> {
-  /**
-   * Allows hydrating the store during SSR when there is an available state in
-   * pinia.state.
-   *
-   * @param store - the store
-   * @param initialState - initialState
-   */
-  hydrate?(store: Store, initialState: UnwrapRef<S>): void
-}
+export interface DefineStoreOptionsBase<S extends StateTree, Store> {}
 
 /**
  * Options parameter of `defineStore()` for option stores. Can be extended to
@@ -658,6 +649,15 @@ export interface DefineStoreOptions<
         _StoreWithGetters<G> &
         PiniaCustomProperties
     >
+
+  /**
+   * Allows hydrating the store during SSR when there is an available state in
+   * pinia.state.
+   *
+   * @param store - the store
+   * @param initialState - initialState
+   */
+  hydrate?(storeState: UnwrapRef<S>, initialState: UnwrapRef<S>): void
 }
 
 /**