@anthropic-ai/sdk 0.5.10 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +48 -20
  3. package/_shims/ReadableStream.d.ts +38 -0
  4. package/_shims/ReadableStream.js +5 -0
  5. package/_shims/ReadableStream.mjs +7 -0
  6. package/_shims/ReadableStream.node.d.ts +6 -0
  7. package/_shims/ReadableStream.node.d.ts.map +1 -0
  8. package/_shims/ReadableStream.node.js +14 -0
  9. package/_shims/ReadableStream.node.js.map +1 -0
  10. package/_shims/ReadableStream.node.mjs +3 -0
  11. package/_shims/ReadableStream.node.mjs.map +1 -0
  12. package/_shims/fetch.d.ts +8 -1
  13. package/_shims/fetch.node.d.ts +11 -1
  14. package/core.d.ts +77 -28
  15. package/core.d.ts.map +1 -1
  16. package/core.js +180 -61
  17. package/core.js.map +1 -1
  18. package/core.mjs +174 -61
  19. package/core.mjs.map +1 -1
  20. package/index.d.mts +2 -0
  21. package/index.d.ts +2 -0
  22. package/index.d.ts.map +1 -1
  23. package/index.js.map +1 -1
  24. package/index.mjs.map +1 -1
  25. package/package.json +1 -1
  26. package/resources/completions.d.ts +115 -191
  27. package/resources/completions.d.ts.map +1 -1
  28. package/resources/completions.js.map +1 -1
  29. package/resources/completions.mjs.map +1 -1
  30. package/resources/index.d.ts +7 -1
  31. package/resources/index.d.ts.map +1 -1
  32. package/resources/index.js.map +1 -1
  33. package/resources/index.mjs.map +1 -1
  34. package/src/_shims/ReadableStream.d.ts +38 -0
  35. package/src/_shims/ReadableStream.js +5 -0
  36. package/src/_shims/ReadableStream.mjs +7 -0
  37. package/src/_shims/ReadableStream.node.ts +6 -0
  38. package/src/_shims/fetch.d.ts +8 -1
  39. package/src/_shims/fetch.node.d.ts +11 -1
  40. package/src/core.ts +245 -83
  41. package/src/index.ts +2 -0
  42. package/src/resources/completions.ts +120 -202
  43. package/src/resources/index.ts +7 -1
  44. package/src/streaming.ts +9 -15
  45. package/src/version.ts +1 -1
  46. package/streaming.d.ts +3 -7
  47. package/streaming.d.ts.map +1 -1
  48. package/streaming.js +8 -5
  49. package/streaming.js.map +1 -1
  50. package/streaming.mjs +7 -4
  51. package/streaming.mjs.map +1 -1
  52. package/version.d.ts +1 -1
  53. package/version.d.ts.map +1 -1
  54. package/version.js +1 -1
  55. package/version.js.map +1 -1
  56. package/version.mjs +1 -1
  57. package/version.mjs.map +1 -1
@@ -1,4 +1,5 @@
1
1
  import * as Core from '@anthropic-ai/sdk/core';
2
+ import { APIPromise } from '@anthropic-ai/sdk/core';
2
3
  import { APIResource } from '@anthropic-ai/sdk/resource';
3
4
  import * as API from './index.js';
4
5
  import { Stream } from '@anthropic-ai/sdk/streaming';
@@ -6,14 +7,11 @@ export declare class Completions extends APIResource {
6
7
  /**
7
8
  * Create a completion
8
9
  */
10
+ create(body: CompletionCreateParamsNonStreaming, options?: Core.RequestOptions): APIPromise<Completion>;
9
11
  create(
10
- body: CompletionCreateParams.CompletionRequestNonStreaming,
12
+ body: CompletionCreateParamsStreaming,
11
13
  options?: Core.RequestOptions,
12
- ): Promise<Core.APIResponse<Completion>>;
13
- create(
14
- body: CompletionCreateParams.CompletionRequestStreaming,
15
- options?: Core.RequestOptions,
16
- ): Promise<Core.APIResponse<Stream<Completion>>>;
14
+ ): APIPromise<Stream<Completion>>;
17
15
  }
18
16
  export interface Completion {
19
17
  /**
@@ -35,199 +33,125 @@ export interface Completion {
35
33
  */
36
34
  stop_reason: string;
37
35
  }
38
- export type CompletionCreateParams =
39
- | CompletionCreateParams.CompletionRequestNonStreaming
40
- | CompletionCreateParams.CompletionRequestStreaming;
36
+ export interface CompletionCreateParams {
37
+ /**
38
+ * The maximum number of tokens to generate before stopping.
39
+ *
40
+ * Note that our models may stop _before_ reaching this maximum. This parameter
41
+ * only specifies the absolute maximum number of tokens to generate.
42
+ */
43
+ max_tokens_to_sample: number;
44
+ /**
45
+ * The model that will complete your prompt.
46
+ *
47
+ * As we improve Claude, we develop new versions of it that you can query. This
48
+ * parameter controls which version of Claude answers your request. Right now we
49
+ * are offering two model families: Claude, and Claude Instant. You can use them by
50
+ * setting `model` to `"claude-2"` or `"claude-instant-1"`, respectively. See
51
+ * [models](https://docs.anthropic.com/claude/reference/selecting-a-model) for
52
+ * additional details.
53
+ */
54
+ model: (string & {}) | 'claude-2' | 'claude-instant-1';
55
+ /**
56
+ * The prompt that you want Claude to complete.
57
+ *
58
+ * For proper response generation you will need to format your prompt as follows:
59
+ *
60
+ * ```javascript
61
+ * const userQuestion = r"Why is the sky blue?";
62
+ * const prompt = `\n\nHuman: ${userQuestion}\n\nAssistant:`;
63
+ * ```
64
+ *
65
+ * See our
66
+ * [comments on prompts](https://docs.anthropic.com/claude/docs/introduction-to-prompt-design)
67
+ * for more context.
68
+ */
69
+ prompt: string;
70
+ /**
71
+ * An object describing metadata about the request.
72
+ */
73
+ metadata?: CompletionCreateParams.Metadata;
74
+ /**
75
+ * Sequences that will cause the model to stop generating completion text.
76
+ *
77
+ * Our models stop on `"\n\nHuman:"`, and may include additional built-in stop
78
+ * sequences in the future. By providing the stop_sequences parameter, you may
79
+ * include additional strings that will cause the model to stop generating.
80
+ */
81
+ stop_sequences?: Array<string>;
82
+ /**
83
+ * Whether to incrementally stream the response using server-sent events.
84
+ *
85
+ * See
86
+ * [this guide to SSE events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events)
87
+ * for details.
88
+ */
89
+ stream?: boolean;
90
+ /**
91
+ * Amount of randomness injected into the response.
92
+ *
93
+ * Defaults to 1. Ranges from 0 to 1. Use temp closer to 0 for analytical /
94
+ * multiple choice, and closer to 1 for creative and generative tasks.
95
+ */
96
+ temperature?: number;
97
+ /**
98
+ * Only sample from the top K options for each subsequent token.
99
+ *
100
+ * Used to remove "long tail" low probability responses.
101
+ * [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
102
+ */
103
+ top_k?: number;
104
+ /**
105
+ * Use nucleus sampling.
106
+ *
107
+ * In nucleus sampling, we compute the cumulative distribution over all the options
108
+ * for each subsequent token in decreasing probability order and cut it off once it
109
+ * reaches a particular probability specified by `top_p`. You should either alter
110
+ * `temperature` or `top_p`, but not both.
111
+ */
112
+ top_p?: number;
113
+ }
41
114
  export declare namespace CompletionCreateParams {
42
- interface CompletionRequestNonStreaming {
43
- /**
44
- * The maximum number of tokens to generate before stopping.
45
- *
46
- * Note that our models may stop _before_ reaching this maximum. This parameter
47
- * only specifies the absolute maximum number of tokens to generate.
48
- */
49
- max_tokens_to_sample: number;
50
- /**
51
- * The model that will complete your prompt.
52
- *
53
- * As we improve Claude, we develop new versions of it that you can query. This
54
- * parameter controls which version of Claude answers your request. Right now we
55
- * are offering two model families: Claude, and Claude Instant. You can use them by
56
- * setting `model` to `"claude-2"` or `"claude-instant-1"`, respectively. See
57
- * [models](https://docs.anthropic.com/claude/reference/selecting-a-model) for
58
- * additional details.
59
- */
60
- model: (string & {}) | 'claude-2' | 'claude-instant-1';
61
- /**
62
- * The prompt that you want Claude to complete.
63
- *
64
- * For proper response generation you will need to format your prompt as follows:
65
- *
66
- * ```javascript
67
- * const userQuestion = r"Why is the sky blue?";
68
- * const prompt = `\n\nHuman: ${userQuestion}\n\nAssistant:`;
69
- * ```
70
- *
71
- * See our
72
- * [comments on prompts](https://docs.anthropic.com/claude/docs/introduction-to-prompt-design)
73
- * for more context.
74
- */
75
- prompt: string;
76
- /**
77
- * An object describing metadata about the request.
78
- */
79
- metadata?: CompletionCreateParams.CompletionRequestNonStreaming.Metadata;
80
- /**
81
- * Sequences that will cause the model to stop generating completion text.
82
- *
83
- * Our models stop on `"\n\nHuman:"`, and may include additional built-in stop
84
- * sequences in the future. By providing the stop_sequences parameter, you may
85
- * include additional strings that will cause the model to stop generating.
86
- */
87
- stop_sequences?: Array<string>;
88
- /**
89
- * Whether to incrementally stream the response using server-sent events.
90
- *
91
- * See
92
- * [this guide to SSE events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events)
93
- * for details.
94
- */
95
- stream?: false;
96
- /**
97
- * Amount of randomness injected into the response.
98
- *
99
- * Defaults to 1. Ranges from 0 to 1. Use temp closer to 0 for analytical /
100
- * multiple choice, and closer to 1 for creative and generative tasks.
101
- */
102
- temperature?: number;
103
- /**
104
- * Only sample from the top K options for each subsequent token.
105
- *
106
- * Used to remove "long tail" low probability responses.
107
- * [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
108
- */
109
- top_k?: number;
110
- /**
111
- * Use nucleus sampling.
112
- *
113
- * In nucleus sampling, we compute the cumulative distribution over all the options
114
- * for each subsequent token in decreasing probability order and cut it off once it
115
- * reaches a particular probability specified by `top_p`. You should either alter
116
- * `temperature` or `top_p`, but not both.
117
- */
118
- top_p?: number;
119
- }
120
- namespace CompletionRequestNonStreaming {
121
- /**
122
- * An object describing metadata about the request.
123
- */
124
- interface Metadata {
125
- /**
126
- * An external identifier for the user who is associated with the request.
127
- *
128
- * This should be a uuid, hash value, or other opaque identifier. Anthropic may use
129
- * this id to help detect abuse. Do not include any identifying information such as
130
- * name, email address, or phone number.
131
- */
132
- user_id?: string;
133
- }
134
- }
135
- interface CompletionRequestStreaming {
136
- /**
137
- * The maximum number of tokens to generate before stopping.
138
- *
139
- * Note that our models may stop _before_ reaching this maximum. This parameter
140
- * only specifies the absolute maximum number of tokens to generate.
141
- */
142
- max_tokens_to_sample: number;
143
- /**
144
- * The model that will complete your prompt.
145
- *
146
- * As we improve Claude, we develop new versions of it that you can query. This
147
- * parameter controls which version of Claude answers your request. Right now we
148
- * are offering two model families: Claude, and Claude Instant. You can use them by
149
- * setting `model` to `"claude-2"` or `"claude-instant-1"`, respectively. See
150
- * [models](https://docs.anthropic.com/claude/reference/selecting-a-model) for
151
- * additional details.
152
- */
153
- model: (string & {}) | 'claude-2' | 'claude-instant-1';
154
- /**
155
- * The prompt that you want Claude to complete.
156
- *
157
- * For proper response generation you will need to format your prompt as follows:
158
- *
159
- * ```javascript
160
- * const userQuestion = r"Why is the sky blue?";
161
- * const prompt = `\n\nHuman: ${userQuestion}\n\nAssistant:`;
162
- * ```
163
- *
164
- * See our
165
- * [comments on prompts](https://docs.anthropic.com/claude/docs/introduction-to-prompt-design)
166
- * for more context.
167
- */
168
- prompt: string;
169
- /**
170
- * Whether to incrementally stream the response using server-sent events.
171
- *
172
- * See
173
- * [this guide to SSE events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events)
174
- * for details.
175
- */
176
- stream: true;
177
- /**
178
- * An object describing metadata about the request.
179
- */
180
- metadata?: CompletionCreateParams.CompletionRequestStreaming.Metadata;
181
- /**
182
- * Sequences that will cause the model to stop generating completion text.
183
- *
184
- * Our models stop on `"\n\nHuman:"`, and may include additional built-in stop
185
- * sequences in the future. By providing the stop_sequences parameter, you may
186
- * include additional strings that will cause the model to stop generating.
187
- */
188
- stop_sequences?: Array<string>;
189
- /**
190
- * Amount of randomness injected into the response.
191
- *
192
- * Defaults to 1. Ranges from 0 to 1. Use temp closer to 0 for analytical /
193
- * multiple choice, and closer to 1 for creative and generative tasks.
194
- */
195
- temperature?: number;
196
- /**
197
- * Only sample from the top K options for each subsequent token.
198
- *
199
- * Used to remove "long tail" low probability responses.
200
- * [Learn more technical details here](https://towardsdatascience.com/how-to-sample-from-language-models-682bceb97277).
201
- */
202
- top_k?: number;
115
+ /**
116
+ * An object describing metadata about the request.
117
+ */
118
+ interface Metadata {
203
119
  /**
204
- * Use nucleus sampling.
120
+ * An external identifier for the user who is associated with the request.
205
121
  *
206
- * In nucleus sampling, we compute the cumulative distribution over all the options
207
- * for each subsequent token in decreasing probability order and cut it off once it
208
- * reaches a particular probability specified by `top_p`. You should either alter
209
- * `temperature` or `top_p`, but not both.
210
- */
211
- top_p?: number;
212
- }
213
- namespace CompletionRequestStreaming {
214
- /**
215
- * An object describing metadata about the request.
122
+ * This should be a uuid, hash value, or other opaque identifier. Anthropic may use
123
+ * this id to help detect abuse. Do not include any identifying information such as
124
+ * name, email address, or phone number.
216
125
  */
217
- interface Metadata {
218
- /**
219
- * An external identifier for the user who is associated with the request.
220
- *
221
- * This should be a uuid, hash value, or other opaque identifier. Anthropic may use
222
- * this id to help detect abuse. Do not include any identifying information such as
223
- * name, email address, or phone number.
224
- */
225
- user_id?: string;
226
- }
126
+ user_id?: string;
227
127
  }
128
+ type CompletionCreateParamsNonStreaming = API.CompletionCreateParamsNonStreaming;
129
+ type CompletionCreateParamsStreaming = API.CompletionCreateParamsStreaming;
130
+ }
131
+ export interface CompletionCreateParamsNonStreaming extends CompletionCreateParams {
132
+ /**
133
+ * Whether to incrementally stream the response using server-sent events.
134
+ *
135
+ * See
136
+ * [this guide to SSE events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events)
137
+ * for details.
138
+ */
139
+ stream?: false;
140
+ }
141
+ export interface CompletionCreateParamsStreaming extends CompletionCreateParams {
142
+ /**
143
+ * Whether to incrementally stream the response using server-sent events.
144
+ *
145
+ * See
146
+ * [this guide to SSE events](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events/Using_server-sent_events)
147
+ * for details.
148
+ */
149
+ stream: true;
228
150
  }
229
151
  export declare namespace Completions {
230
152
  export import Completion = API.Completion;
231
153
  export import CompletionCreateParams = API.CompletionCreateParams;
154
+ export import CompletionCreateParamsNonStreaming = API.CompletionCreateParamsNonStreaming;
155
+ export import CompletionCreateParamsStreaming = API.CompletionCreateParamsStreaming;
232
156
  }
233
157
  //# sourceMappingURL=completions.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"completions.d.ts","sourceRoot":"","sources":["../src/resources/completions.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,IAAI,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAC;AACzD,OAAO,KAAK,GAAG,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,M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iB,QAAQ;QACvB;;;;;;WAMG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;KAClB;IAED,KAAY,kCAAkC,GAAG,GAAG,CAAC,kCAAkC,CAAC;IACxF,KAAY,+BAA+B,GAAG,GAAG,CAAC,+BAA+B,CAAC;CACnF;AAED,MAAM,WAAW,kCAAmC,SAAQ,sBAAsB;IAChF;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC;CAChB;AAED,MAAM,WAAW,+BAAgC,SAAQ,sBAAsB;IAC7E;;;;;;OAMG;IACH,MAAM,EAAE,IAAI,CAAC;CACd;AAED,yBAAiB,WAAW,CAAC;IAC3B,MAAM,QAAQ,UAAU,GAAG,GAAG,CAAC,UAAU,CAAC;IAC1C,MAAM,QAAQ,sBAAsB,GAAG,GAAG,CAAC,sBAAsB,CAAC;IAClE,MAAM,QAAQ,kCAAkC,GAAG,GAAG,CAAC,kCAAkC,CAAC;IAC1F,MAAM,QAAQ,+BAA+B,GAAG,GAAG,CAAC,+BAA+B,CAAC;CACrF"}
@@ -1 +1 @@
1
- {"version":3,"file":"completions.js","sourceRoot":"","sources":["../src/resources/completions.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;AAGrD,yDAAyD;AAIzD,MAAa,WAAY,SAAQ,sBAAW;IAY1C,MAAM,CACJ,IAA4B,EAC5B,OAA6B;;QAE7B,OAAO,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,MAAA,IAAI,CAAC,MAAM,mCAAI,KAAK,EAAE,CAAC,CAAC;IACxG,CAAC;CACF;AAlBD,kCAkBC;AA6OD,WAAiB,WAAW;AAG5B,CAAC,EAHgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAG3B"}
1
+ {"version":3,"file":"completions.js","sourceRoot":"","sources":["../src/resources/completions.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;AAIrD,yDAAyD;AAIzD,MAAa,WAAY,SAAQ,sBAAW;IAS1C,MAAM,CACJ,IAA4B,EAC5B,OAA6B;;QAE7B,OAAO,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,MAAA,IAAI,CAAC,MAAM,mCAAI,KAAK,EAAE,CAElE,CAAC;IACrC,CAAC;CACF;AAjBD,kCAiBC;AAyJD,WAAiB,WAAW;AAK5B,CAAC,EALgB,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAK3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"completions.mjs","sourceRoot":"","sources":["../src/resources/completions.ts"],"names":[],"mappings":"AAAA,qDAAqD;OAG9C,EAAE,WAAW,EAAE,MAAM,4BAA4B;AAIxD,MAAM,OAAO,WAAY,SAAQ,WAAW;IAY1C,MAAM,CACJ,IAA4B,EAC5B,OAA6B;;QAE7B,OAAO,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,MAAA,IAAI,CAAC,MAAM,mCAAI,KAAK,EAAE,CAAC,CAAC;IACxG,CAAC;CACF;AA6OD,WAAiB,WAAW;AAG5B,CAAC,EAHgB,WAAW,KAAX,WAAW,QAG3B"}
1
+ {"version":3,"file":"completions.mjs","sourceRoot":"","sources":["../src/resources/completions.ts"],"names":[],"mappings":"AAAA,qDAAqD;OAI9C,EAAE,WAAW,EAAE,MAAM,4BAA4B;AAIxD,MAAM,OAAO,WAAY,SAAQ,WAAW;IAS1C,MAAM,CACJ,IAA4B,EAC5B,OAA6B;;QAE7B,OAAO,IAAI,CAAC,IAAI,CAAC,cAAc,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,OAAO,EAAE,MAAM,EAAE,MAAA,IAAI,CAAC,MAAM,mCAAI,KAAK,EAAE,CAElE,CAAC;IACrC,CAAC;CACF;AAyJD,WAAiB,WAAW;AAK5B,CAAC,EALgB,WAAW,KAAX,WAAW,QAK3B"}
@@ -1,3 +1,9 @@
1
1
  export {} from './top-level.js';
2
- export { Completion, CompletionCreateParams, Completions } from './completions.js';
2
+ export {
3
+ Completion,
4
+ CompletionCreateParams,
5
+ CompletionCreateParamsNonStreaming,
6
+ CompletionCreateParamsStreaming,
7
+ Completions,
8
+ } from './completions.js';
3
9
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,EAAE,UAAU,EAAE,sBAAsB,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,aAAa,CAAC;AAC7B,OAAO,EACL,UAAU,EACV,sBAAsB,EACtB,kCAAkC,EAClC,+BAA+B,EAC/B,WAAW,GACZ,MAAM,eAAe,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;AAGrD,gDAAgF;AAAnC,0GAAA,WAAW,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":";AAAA,qDAAqD;;;AAGrD,gDAMuB;AADrB,0GAAA,WAAW,OAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;OAG9C,EAAsC,WAAW,EAAE"}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/resources/index.ts"],"names":[],"mappings":"AAAA,qDAAqD;OAG9C,EAKL,WAAW,GACZ"}
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+
5
+ /**
6
+ * >>> Confused? <<<
7
+ *
8
+ * If you're getting errors from these types, try adding "lib": ["DOM"]
9
+ * to your tsconfig.json, or otherwise configure the appropriate builtin
10
+ * `ReadableStream` type for your environment.
11
+ */
12
+
13
+ // @ts-ignore
14
+ type _ReadableStream<R = any> = unknown extends ReadableStream ? never : ReadableStream<R>;
15
+ declare const _ReadableStream: {
16
+ prototype: _ReadableStream;
17
+ new (
18
+ underlyingSource: _UnderlyingByteSource,
19
+ strategy?: { highWaterMark?: number },
20
+ ): _ReadableStream<Uint8Array>;
21
+ new <R = any>(
22
+ underlyingSource: _UnderlyingDefaultSource<R>,
23
+ strategy?: _QueuingStrategy<R>,
24
+ ): _ReadableStream<R>;
25
+ new <R = any>(underlyingSource?: _UnderlyingSource<R>, strategy?: _QueuingStrategy<R>): _ReadableStream<R>;
26
+ };
27
+
28
+ // @ts-ignore
29
+ type _UnderlyingSource<R = any> = unknown extends UnderlyingSource ? never : UnderlyingSource<R>;
30
+ // @ts-ignore
31
+ type _UnderlyingByteSource = unknown extends UnderlyingByteSource ? never : UnderlyingByteSource;
32
+ type _UnderlyingDefaultSource<R = any> =
33
+ // @ts-ignore
34
+ unknown extends UnderlyingDefaultSource ? never : UnderlyingDefaultSource<R>;
35
+ // @ts-ignore
36
+ type _QueuingStrategy<R = any> = unknown extends QueuingStrategy ? never : QueuingStrategy<R>;
37
+
38
+ export { _ReadableStream as ReadableStream };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+
5
+ exports.ReadableStream = ReadableStream;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+
5
+ const _ReadableStream = ReadableStream;
6
+
7
+ export { _ReadableStream as ReadableStream };
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Disclaimer: modules in _shims aren't intended to be imported by SDK users.
3
+ */
4
+ import { ReadableStream } from 'web-streams-polyfill';
5
+
6
+ export { ReadableStream };
@@ -26,6 +26,8 @@ type _Response = unknown extends Response ? never : Response;
26
26
  // @ts-ignore
27
27
  type _ResponseInit = unknown extends ResponseInit ? never : ResponseInit;
28
28
  // @ts-ignore
29
+ type _ResponseType = unknown extends ResponseType ? never : ResponseType;
30
+ // @ts-ignore
29
31
  type _BodyInit = unknown extends BodyInit ? never : BodyInit;
30
32
  // @ts-ignore
31
33
  type _Headers = unknown extends Headers ? never : Headers;
@@ -49,4 +51,9 @@ declare const _Headers: {
49
51
  export const isPolyfilled = false;
50
52
 
51
53
  export { _fetch as fetch, _Request as Request, _Response as Response, _Headers as Headers };
52
- export type { _RequestInit as RequestInit, _RequestInfo as RequestInfo, _BodyInit as BodyInit };
54
+ export type {
55
+ _RequestInit as RequestInit,
56
+ _RequestInfo as RequestInfo,
57
+ _ResponseType as ResponseType,
58
+ _BodyInit as BodyInit,
59
+ };
@@ -26,6 +26,11 @@ type _RequestInit = unknown extends RequestInit ? nf.RequestInit : RequestInit;
26
26
  type _Response = unknown extends Response ? nf.Response : Response;
27
27
  // @ts-ignore
28
28
  type _ResponseInit = unknown extends ResponseInit ? nf.ResponseInit : ResponseInit;
29
+ type _ResponseType =
30
+ // @ts-ignore
31
+ unknown extends ResponseType ? 'basic' | 'cors' | 'default' | 'error' | 'opaque' | 'opaqueredirect'
32
+ : // @ts-ignore
33
+ ResponseType;
29
34
  // @ts-ignore
30
35
  type _BodyInit = unknown extends BodyInit ? nf.BodyInit : BodyInit;
31
36
  // @ts-ignore
@@ -50,4 +55,9 @@ declare const _Headers: {
50
55
  export const isPolyfilled = false;
51
56
 
52
57
  export { _fetch as fetch, _Request as Request, _Response as Response, _Headers as Headers };
53
- export type { _RequestInit as RequestInit, _RequestInfo as RequestInfo, _BodyInit as BodyInit };
58
+ export type {
59
+ _RequestInit as RequestInit,
60
+ _RequestInfo as RequestInfo,
61
+ _ResponseType as ResponseType,
62
+ _BodyInit as BodyInit,
63
+ };