Skip to content

Commit 06e9109

Browse files
committed
refactor: rewrite component options type parameters to shorter form
1 parent d8f4878 commit 06e9109

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

src/component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export const $internalHooks = [
2020

2121
export function componentFactory (
2222
Component: VueClass<Vue>,
23-
options: ComponentOptions<any, any, any, any> = {}
23+
options: ComponentOptions<Vue> = {}
2424
): VueClass<Vue> {
2525
options.name = options.name || (Component as any)._componentTag || (Component as any).name
2626
// prototype props.

src/declarations.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ export type DecoratedClass = VueClass<Vue> & {
66
// Property, method and parameter decorators created by `createDecorator` helper
77
// will enqueue functions that update component options for lazy processing.
88
// They will be executed just before creating component constructor.
9-
__decorators__?: ((options: ComponentOptions<any, any, any, any>) => void)[]
9+
__decorators__?: ((options: ComponentOptions<Vue>) => void)[]
1010
}

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ import { componentFactory, $internalHooks } from './component'
44

55
export { createDecorator } from './util'
66

7-
function Component <V extends Vue>(options: ComponentOptions<any, any, any, any> & ThisType<V>): <VC extends VueClass<V>>(target: VC) => VC
7+
function Component <V extends Vue>(options: ComponentOptions<V> & ThisType<V>): <VC extends VueClass<V>>(target: VC) => VC
88
function Component <VC extends VueClass<Vue>>(target: VC): VC
9-
function Component (options: ComponentOptions<any, any, any, any> | VueClass<Vue>): any {
9+
function Component (options: ComponentOptions<Vue> | VueClass<Vue>): any {
1010
if (typeof options === 'function') {
1111
return componentFactory(options)
1212
}

src/util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export interface VueDecorator {
1414
(target: Vue, key: string, index: number): void
1515
}
1616

17-
export function createDecorator (factory: (options: ComponentOptions<any, any, any, any>, key: string, index: number) => void): VueDecorator {
17+
export function createDecorator (factory: (options: ComponentOptions<Vue>, key: string, index: number) => void): VueDecorator {
1818
return (target: Vue | typeof Vue, key?: any, index?: any) => {
1919
const Ctor = typeof target === 'function'
2020
? target as DecoratedClass

0 commit comments

Comments
 (0)