Skip to content

Commit e4e2abf

Browse files
committed
feat: move intersection
1 parent ca0bab8 commit e4e2abf

2 files changed

Lines changed: 2 additions & 3 deletions

File tree

packages/openapi-code-generator/src/typescript/server/typescript-koa/typescript-koa-router-builder.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,11 @@ export class KoaRouterBuilder extends AbstractRouterBuilder {
9999
operationId: builder.operationId,
100100
statements: [
101101
`const ${symbols.implPropName} = ${responder.implementation}`,
102-
`type ${titleCase(symbols.responderName)} = typeof ${symbols.implPropName}['responder'] & KoaRuntimeResponder`,
103102
buildExport({
104103
name: symbols.implTypeName,
105104
value: `(
106105
params: ${params.type},
107-
respond: ${titleCase(symbols.responderName)},
106+
respond: typeof ${symbols.implPropName}['responder'],
108107
ctx: RouterContext
109108
) => Promise<KoaRuntimeResponse<unknown> | ${[
110109
...responseSchemas.specific.map(

packages/typescript-koa-runtime/src/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ function isValidStatusCode(status: unknown): status is StatusCode {
8787
return !(status < 100 || status > 599)
8888
}
8989

90-
export const b = <T>(fn: (r: ResponderBuilder) => T) => {
90+
export const b = <T>(fn: (r: ResponderBuilder) => T & KoaRuntimeResponder) => {
9191
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
9292
const responses: any[] = []
9393
// biome-ignore lint/suspicious/noExplicitAny: <explanation>

0 commit comments

Comments
 (0)