Skip to content

Commit

Permalink
fix: typings
Browse files Browse the repository at this point in the history
  • Loading branch information
magne4000 committed Oct 9, 2024
1 parent b5a32dc commit a2c3747
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion examples/tool/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -307,4 +307,4 @@
"@universal-middleware/elysia": "^0"
},
"sideEffects": false
}
}
4 changes: 2 additions & 2 deletions packages/universal-middleware/src/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ type ExtractT<T> = T extends (...args: infer X) => any ? X : never;
type ExtractInContext<T> = T extends (...args: any[]) => UniversalMiddleware<infer X> ? unknown extends X ? Universal.Context : X : {};
export type InContext = ExtractInContext<typeof ${type}>;
export type OutContext = ${info.outContext?.(type) ?? "unknown"};
export type Args = ExtractT<typeof middleware>;
export type Middleware = ReturnType<ReturnType<typeof createMiddleware<T, InContext, OutContext>>>;
export type Args = ExtractT<typeof ${type}>;
export type Middleware = ReturnType<ReturnType<typeof ${fn}<Args, InContext, OutContext>>>;
export default ${fn}(${type}) as (...args: Args) => Middleware;
`;

Expand Down

0 comments on commit a2c3747

Please sign in to comment.