-
Notifications
You must be signed in to change notification settings - Fork 132
/
Copy pathtwirp-options.ts
41 lines (35 loc) · 1.13 KB
/
twirp-options.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import {RpcOptions} from "@protobuf-ts/runtime-rpc";
export interface TwirpOptions extends RpcOptions {
/**
* Base URI for all HTTP requests.
*
* Requests will be made to <baseUrl>/<package>.<service>/method
*
* If you need the "twirp" path prefix, you must add it yourself.
*
* Example: `baseUrl: "https://example.com/twirp"`
*
* This will make a `POST /twirp/my_package.MyService/Foo` to
* `example.com` via HTTPS.
*/
baseUrl: string;
/**
* For Twirp, method names are CamelCased just as they would be in Go.
* To use the original method name as defined in the .proto, set this
* option to `true`.
*/
useProtoMethodName?: boolean;
/**
* Send JSON? Defaults to false, which means binary
* format is sent.
*/
sendJson?: boolean;
/**
* Extra options to pass through to the fetch when doing a request.
*
* Example: `fetchInit: { credentials: 'include' }`
*
* This will make requests include cookies for cross-origin calls.
*/
fetchInit?: Omit<RequestInit, 'body' | 'headers' | 'method' | 'signal'>;
}