diff --git a/e2e-tests/testdata/echo_client/ts/client.ts b/e2e-tests/testdata/echo_client/ts/client.ts index 6b7d84880f..f392b04bc9 100644 --- a/e2e-tests/testdata/echo_client/ts/client.ts +++ b/e2e-tests/testdata/echo_client/ts/client.ts @@ -145,7 +145,7 @@ export namespace di { await this.baseClient.callAPI("POST", `/di/one`) } - public async Three(method: string, body?: BodyInit, options?: CallParameters): Promise { + public async Three(method: string, body?: BodyInit, options?: CallParameters): Promise { return this.baseClient.callAPI(method, `/di/raw`, body, options) } @@ -648,7 +648,7 @@ export namespace test { * RawEndpoint allows us to test the clients' ability to send raw requests * under auth */ - public async RawEndpoint(method: "PUT" | "POST" | "DELETE" | "GET", id: string[], body?: BodyInit, options?: CallParameters): Promise { + public async RawEndpoint(method: "PUT" | "POST" | "DELETE" | "GET", id: string[], body?: BodyInit, options?: CallParameters): Promise { return this.baseClient.callAPI(method, `/raw/blah/${id.map(encodeURIComponent).join("/")}`, body, options) } diff --git a/internal/clientgen/testdata/goapp/expected_typescript.ts b/internal/clientgen/testdata/goapp/expected_typescript.ts index 068d58d4b8..ab9c625431 100644 --- a/internal/clientgen/testdata/goapp/expected_typescript.ts +++ b/internal/clientgen/testdata/goapp/expected_typescript.ts @@ -411,7 +411,7 @@ export namespace svc { return await resp.json() as Tuple } - public async Webhook(method: string, a: string, b: string[], body?: BodyInit, options?: CallParameters): Promise { + public async Webhook(method: string, a: string, b: string[], body?: BodyInit, options?: CallParameters): Promise { return this.baseClient.callAPI(method, `/webhook/${encodeURIComponent(a)}/${b.map(encodeURIComponent).join("/")}`, body, options) } diff --git a/internal/clientgen/typescript.go b/internal/clientgen/typescript.go index b692548c41..256d39313f 100644 --- a/internal/clientgen/typescript.go +++ b/internal/clientgen/typescript.go @@ -304,7 +304,7 @@ func (ts *typescript) writeService(svc *meta.Service, p clientgentypes.ServiceSe } else if rpc.ResponseSchema != nil { ts.writeTyp(ns, rpc.ResponseSchema, 0) } else if rpc.Proto == meta.RPC_RAW { - ts.WriteString("Response") + ts.WriteString("globalThis.Response") } else { ts.WriteString("void") }