File tree 3 files changed +7
-7
lines changed
3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change 1
1
import { md5 , randomString , toQueryString } from '@/shared/utils'
2
2
import { config } from '@/shared/config'
3
3
import { inject } from 'vue'
4
- import { App , PluginObject } from '@/shared/compat'
4
+ import { App , Plugin } from '@/shared/compat'
5
5
import { pickBy } from 'lodash-es'
6
6
7
7
type Auth = { password ?: string , salt ?: string , hash ?: string }
@@ -144,7 +144,7 @@ export function useAuth(): AuthService {
144
144
return inject ( apiSymbol ) as AuthService
145
145
}
146
146
147
- export function createAuth ( ) : AuthService & PluginObject < never > {
147
+ export function createAuth ( ) : AuthService & Plugin {
148
148
const instance = new AuthService ( )
149
149
return Object . assign ( instance , {
150
150
install : ( app : App ) => {
Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ import Vue from 'vue'
4
4
export interface App < T = any > {
5
5
config : VueConstructor [ 'config' ] & { globalProperties : any }
6
6
// eslint-disable-next-line no-use-before-define
7
- use ( plugin : PluginObject < T > , options ?: T ) : this
7
+ use ( plugin : Plugin < T > , options ?: T ) : this
8
8
component : VueConstructor [ 'component' ]
9
9
provide < T > ( key : symbol | string , value : T ) : this
10
10
mount : Vue [ '$mount' ]
@@ -13,15 +13,15 @@ export interface App<T = any> {
13
13
// unmount: Vue['$destroy']
14
14
}
15
15
16
- export interface PluginObject < T > {
16
+ export interface Plugin < T = any > {
17
17
install : ( app : App < T > , options ?: T ) => void
18
18
}
19
19
20
20
export const createApp = ( component : any , options : any ) : App => {
21
21
const provide : Record < any , any > = { }
22
22
let vm = undefined as undefined | Vue
23
23
return {
24
- use < T > ( plugin : PluginObject < T > , options ?: T ) {
24
+ use < T > ( plugin : Plugin < T > , options ?: T ) {
25
25
( plugin as any ) . install ( this , options )
26
26
return this
27
27
} ,
Original file line number Diff line number Diff line change 1
1
import { API } from '@/shared/api'
2
2
import { inject } from 'vue'
3
3
import { AuthService } from '@/auth/service'
4
- import { App , PluginObject } from '@/shared/compat'
4
+ import { App , Plugin } from '@/shared/compat'
5
5
6
6
const apiSymbol = Symbol ( '' )
7
7
8
8
export function useApi ( ) : API {
9
9
return inject ( apiSymbol ) as API
10
10
}
11
11
12
- export function createApi ( auth : AuthService ) : API & PluginObject < never > {
12
+ export function createApi ( auth : AuthService ) : API & Plugin {
13
13
const instance = new API ( auth )
14
14
return Object . assign ( instance , {
15
15
install : ( app : App ) => {
You can’t perform that action at this time.
0 commit comments