index.d.ts 494 B

1234567891011121314151617181920
  1. export interface ConstructorOption {
  2. state?: any;
  3. mutations?: any;
  4. middlewares?: {
  5. snapshot: boolean;
  6. onInit: Function;
  7. onMutation: Function;
  8. }[];
  9. strict?: boolean;
  10. modules?: any;
  11. }
  12. export class Store<S> {
  13. constructor(obj: ConstructorOption);
  14. state: S;
  15. dispatch(mutationName: any, ...args: any[]): void;
  16. watch(pathOrGetter: (string | Function), cb: Function, options: any): void;
  17. }
  18. export function install(...args: any[]): any;