File tree 2 files changed +11
-7
lines changed
packages/runtime-core/src
2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -149,17 +149,19 @@ export interface AppContext {
149
149
filters ?: Record < string , Function >
150
150
}
151
151
152
- type PluginInstallFunction < Options > = Options extends unknown [ ]
152
+ type PluginInstallFunction < Options = any [ ] > = Options extends unknown [ ]
153
153
? ( app : App , ...options : Options ) => any
154
154
: ( app : App , options : Options ) => any
155
155
156
+ export type ObjectPlugin < Options = any [ ] > = {
157
+ install : PluginInstallFunction < Options >
158
+ }
159
+ export type FunctionPlugin < Options = any [ ] > = PluginInstallFunction < Options > &
160
+ Partial < ObjectPlugin < Options > >
161
+
156
162
export type Plugin < Options = any [ ] > =
157
- | ( PluginInstallFunction < Options > & {
158
- install ?: PluginInstallFunction < Options >
159
- } )
160
- | {
161
- install : PluginInstallFunction < Options >
162
- }
163
+ | FunctionPlugin < Options >
164
+ | ObjectPlugin < Options >
163
165
164
166
export function createAppContext ( ) : AppContext {
165
167
return {
Original file line number Diff line number Diff line change @@ -212,6 +212,8 @@ export type {
212
212
AppConfig ,
213
213
AppContext ,
214
214
Plugin ,
215
+ ObjectPlugin ,
216
+ FunctionPlugin ,
215
217
CreateAppFunction ,
216
218
OptionMergeFunction
217
219
} from './apiCreateApp'
You can’t perform that action at this time.
0 commit comments