Skip to content

Commit

Permalink
feat: add types when creating global directives
Browse files Browse the repository at this point in the history
  • Loading branch information
carlesmitjans committed Nov 22, 2023
1 parent fc772db commit e14af5d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/runtime-core/src/apiCreateApp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export interface App<HostElement = any> {
component(name: string): Component | undefined
component(name: string, component: Component): this
directive(name: string): Directive | undefined
directive(name: string, directive: Directive): this
directive<T = any, V = any>(name: string, directive: Directive<T, V>): this
mount(
rootContainer: HostElement | string,
isHydrate?: boolean,
Expand Down
5 changes: 4 additions & 1 deletion packages/runtime-core/src/compat/global.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ export type CompatVue = Pick<App, 'version' | 'component' | 'directive'> & {
component(name: string): Component | undefined
component(name: string, component: Component): CompatVue
directive(name: string): Directive | undefined
directive(name: string, directive: Directive): CompatVue
directive<T = any, V = any>(
name: string,
directive: Directive<T, V>
): CompatVue

compile(template: string): RenderFunction

Expand Down

0 comments on commit e14af5d

Please sign in to comment.