Skip to content

Commit 0858c6d

Browse files
committed
fix(types): revert renaming Payload to avoid breaking change
1 parent 58d28a5 commit 0858c6d

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

dist/logger.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
* This file must be put alongside the JavaScript file of the logger.
44
*/
55

6-
import { BasePayload, Plugin } from "../types/index";
6+
import { Payload, Plugin } from "../types/index";
77

88
export interface LoggerOption<S> {
99
collapsed?: boolean;
10-
filter?: <P extends BasePayload>(mutation: P, stateBefore: S, stateAfter: S) => boolean;
10+
filter?: <P extends Payload>(mutation: P, stateBefore: S, stateAfter: S) => boolean;
1111
transformer?: (state: S) => any;
12-
mutationTransformer?: <P extends BasePayload>(mutation: P) => any;
12+
mutationTransformer?: <P extends Payload>(mutation: P) => any;
1313
}
1414

1515
export default function createLogger<S>(option: LoggerOption<S>): Plugin<S>;

types/index.d.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,23 +51,23 @@ export declare function install(Vue: typeof _Vue): void;
5151
export interface Dispatch<Actions = Record<string, any>, RootActions = Record<string, any>> {
5252
// Local
5353
<K extends keyof Actions>(type: K, payload?: Actions[K], options?: LocalDispatchOptions): Promise<any>;
54-
<K extends keyof Actions>(payloadWithType: Payload<K, Actions>, options?: LocalDispatchOptions): Promise<any>;
54+
<K extends keyof Actions>(payloadWithType: InputPayload<K, Actions>, options?: LocalDispatchOptions): Promise<any>;
5555

5656
// Root
5757
<K extends keyof RootActions>(type: K, options: RootDispatchOptions): Promise<any>;
5858
<K extends keyof RootActions>(type: K, payload: RootActions[K], options: RootDispatchOptions): Promise<any>;
59-
<K extends keyof RootActions>(payloadWithType: Payload<K, RootActions>, options: RootDispatchOptions): Promise<any>;
59+
<K extends keyof RootActions>(payloadWithType: InputPayload<K, RootActions>, options: RootDispatchOptions): Promise<any>;
6060
}
6161

6262
export interface Commit<Mutations = Record<string, any>, RootMutations = Record<string, any>> {
6363
// Local
6464
<K extends keyof Mutations>(type: K, payload?: Mutations[K], options?: LocalCommitOptions): void;
65-
<K extends keyof Mutations>(payloadWithType: Payload<K, Mutations>, options?: LocalCommitOptions): void;
65+
<K extends keyof Mutations>(payloadWithType: InputPayload<K, Mutations>, options?: LocalCommitOptions): void;
6666

6767
// Root
6868
<K extends keyof RootMutations>(type: K, options: RootCommitOptions): void;
6969
<K extends keyof RootMutations>(type: K, payload: RootMutations[K], options: RootCommitOptions): void;
70-
<K extends keyof RootMutations>(payloadWithType: Payload<K, RootMutations>, options: RootCommitOptions): void;
70+
<K extends keyof RootMutations>(payloadWithType: InputPayload<K, RootMutations>, options: RootCommitOptions): void;
7171
}
7272

7373
export interface ActionContext<
@@ -88,17 +88,17 @@ export interface ActionContext<
8888
rootGetters: RG;
8989
}
9090

91-
export interface BasePayload {
91+
export interface Payload {
9292
type: string;
9393
}
9494

95-
type Payload<K extends keyof P, P> = { type: K } & P[K]
95+
type InputPayload<K extends keyof P, P> = { type: K } & P[K]
9696

97-
export interface MutationPayload extends BasePayload {
97+
export interface MutationPayload extends Payload {
9898
payload: any;
9999
}
100100

101-
export interface ActionPayload extends BasePayload {
101+
export interface ActionPayload extends Payload {
102102
payload: any;
103103
}
104104

0 commit comments

Comments
 (0)