|
2 | 2 | declare module 'vue-analytics' { |
3 | 3 | import _Vue, { PluginFunction } from 'vue'; |
4 | 4 | import VueRouter, { Route } from 'vue-router'; |
| 5 | + import { Store } from 'vuex'; |
5 | 6 |
|
6 | 7 | interface eventFn { |
7 | 8 | (category: string, action?: string, label?: string, value?: number): void; |
@@ -50,7 +51,7 @@ declare module 'vue-analytics' { |
50 | 51 | timingLabel: string |
51 | 52 | }): void; |
52 | 53 | } |
53 | | - |
| 54 | + |
54 | 55 | interface EcommerceItem { |
55 | 56 | id: string; |
56 | 57 | name: string; |
@@ -236,22 +237,35 @@ declare module 'vue-analytics' { |
236 | 237 |
|
237 | 238 | export default class VueAnalytics { |
238 | 239 | static install(Vue: typeof _Vue, options: InstallOptions): void; |
239 | | - analyticsMiddleware: any; |
240 | | - onAnalyticsReady: () => Promise<void>; |
| 240 | + analyticsMiddleware<T>(store: Store<T>): void; |
| 241 | + onAnalyticsReady: onAnalyticsReadyFn; |
241 | 242 | event: eventFn; |
242 | 243 | ecommerce: Ecommerce; |
243 | 244 | set: setFn; |
244 | 245 | page: pageFn; |
245 | | - query: any; |
246 | | - screenview: ((screen: string) => void) | ((option: { screenName: string, [otherProperties: string]: any }) => void); |
| 246 | + query: queryFn; |
| 247 | + screenview: screenviewFn; |
247 | 248 | time: timeFn; |
248 | | - require: (pluginName: string, options?: any) => void; |
249 | | - exception: (exception: Error | string) => void; |
| 249 | + require: requireFn; |
| 250 | + exception: exceptionFn; |
250 | 251 | social: socialFn; |
251 | 252 | disable: () => void; |
252 | 253 | enable: () => void; |
253 | 254 | } |
254 | 255 |
|
| 256 | + export const analyticsMiddleware: analyticsMiddlewareFn; |
| 257 | + export const onAnalyticsReady: onAnalyticsReadyFn; |
| 258 | + export const event: eventFn; |
| 259 | + export const ecommerce: Ecommerce; |
| 260 | + export const set: setFn; |
| 261 | + export const page: pageFn; |
| 262 | + export const query: queryFn; |
| 263 | + export const screenview: screenviewFn; |
| 264 | + export const time: timeFn; |
| 265 | + export const require: requireFn; |
| 266 | + export const exception: exceptionFn; |
| 267 | + export const social: socialFn; |
| 268 | + |
255 | 269 | module 'vue/types/options' { |
256 | 270 | interface ComponentOptions<V extends _Vue> { |
257 | 271 | ga?: VueAnalytics; |
|
0 commit comments