pinia-plugin-subscription 0.0.0-beta.2 → 0.0.0-beta.4

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.
@@ -1,29 +1,30 @@
1
1
  import type { PiniaPlugin, PiniaPluginContext, Store as PiniaStore, StateTree } from "pinia"
2
2
  import type { PluginSubscriber as PluginSubscriberInterface, PluginSubscription, PluginSubscriptions, StoreOnActionSubscription, StoreMutationSubscription } from "./plugin"
3
- import type { DefineAugmentedStore, PluginStoreOptions, StatePropertyValue, StoreOptions, StoreOptionsPropertyValue } from "./store"
3
+ import { DefineAugmentedStore, StatePropertyValue, StoreOptions, StoreOptionsPropertyValue } from "./store"
4
4
 
5
5
 
6
6
  declare module 'pinia-plugin-subscription' {
7
- export function createPlugin(subscribers: PluginSubscriberInterface<Store>[], debug?: boolean): PiniaPlugin;
7
+ export function createPlugin(subscribers: PluginSubscriberInterface[], debug?: boolean): PiniaPlugin;
8
8
 
9
9
  export function defineAStore<TStore, TState>(id: string, storeDefinition: () => AnyObject, storeOptions?: StoreOptions): DefineAugmentedStore<TStore, TState>
10
10
 
11
11
  export function isEmpty(value: any): boolean
12
12
 
13
- export abstract class PluginSubscriber<Instance extends Store> implements PluginSubscriberInterface<Instance> {
13
+ export abstract class PluginSubscriber<Instance extends Store> implements PluginSubscriberInterface {
14
14
  public name: string
15
+ protected pluginCreated?: (store: PiniaStore) => void
15
16
  public resetStoreCallback: ((store?: PiniaStore) => void) | undefined
16
17
  public storeOnActionSubscription: StoreOnActionSubscription | undefined
17
18
  public storeMutationSubscription: StoreMutationSubscription | undefined
18
19
  public subscriptions: PluginSubscriptions | undefined
19
20
 
20
- constructor(pluginName: string, createInstanceFunction: (store: PiniaStore, options: AnyObject, debug?: boolean) => Store | undefined)
21
+ constructor(pluginName: string, createInstanceFunction: (store: PiniaStore, options: AnyObject, debug?: boolean) => Instance | undefined)
21
22
 
22
23
  public invoke(context: PiniaPluginContext, debug?: boolean): void
23
24
  }
24
25
 
25
26
  export class Store {
26
- constructor(store: PiniaStore, options: PluginStoreOptions, debug?: boolean)
27
+ constructor(store: PiniaStore, options: AnyObject, debug?: boolean)
27
28
 
28
29
  public debug: boolean
29
30
  public onAction: StoreOnActionSubscription | undefined
@@ -40,7 +41,7 @@ declare module 'pinia-plugin-subscription' {
40
41
 
41
42
  static customizeStore<Instance extends Store>(
42
43
  store: PiniaStore,
43
- options: PluginStoreOptions,
44
+ options: AnyObject,
44
45
  debug?: boolean
45
46
  ): Instance | undefined
46
47
 
@@ -71,4 +72,4 @@ export interface SearchCollectionCriteria {
71
72
  [key: number | string | symbol]: boolean | number | string;
72
73
  }
73
74
  export type { CustomStore, DefineAugmentedStore, PluginStoreOptions, StatePropertyValue, StoreOptions, StoreOptionsPropertyValue } from "./store";
74
- export type { PluginSubscriber } from "./plugin";
75
+ export type { PluginSubscriber as PluginSubscriberInterface } from "./plugin";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "author": "Alexandre Bidaud <alexbidaud85@gmail.com> (https://github.com/AlxBDo)",
3
3
  "name": "pinia-plugin-subscription",
4
- "version": "0.0.0-beta.2",
4
+ "version": "0.0.0-beta.4",
5
5
  "type": "module",
6
6
  "exports": {
7
7
  ".": {