Skip to content

Commit

Permalink
fix: Types
Browse files Browse the repository at this point in the history
  • Loading branch information
frandiox committed Jul 30, 2021
1 parent 46ec462 commit f376c92
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 8 deletions.
1 change: 1 addition & 0 deletions src/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ declare module 'vite-ssr' {
options: SharedOptions & {
routes: Array<Record<string, any>>
routerOptions?: Record<string, any>
styleCollector?: (ctx: any) => any
},
hook?: (
params: SharedContext & {
Expand Down
4 changes: 3 additions & 1 deletion src/react/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ export type ClientOptions = Options & {
})
}

export type Hook = (params: Context) => any | Promise<any>
export type HookParams = Context

export type Hook = (params: HookParams) => any | Promise<any>

export type ClientHandler = (
App: any,
Expand Down
14 changes: 7 additions & 7 deletions src/vue/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ type HookResponse = void | {

export type Context = SharedContext

export type Hook = (
params: Context & {
app: App
router: Router
initialRoute: RouteLocationNormalized
}
) => HookResponse | Promise<HookResponse>
export type HookParams = Context & {
app: App
router: Router
initialRoute: RouteLocationNormalized
}

export type Hook = (params: HookParams) => HookResponse | Promise<HookResponse>

export type ClientHandler = (
App: Component,
Expand Down

0 comments on commit f376c92

Please sign in to comment.