Merge pull request #12635 from backstage/rugvip/headers

errors: inline headers type
This commit is contained in:
Patrik Oldsberg
2022-07-14 16:27:02 +02:00
committed by GitHub
3 changed files with 30 additions and 2 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/errors': patch
---
Inline the type of `ConsumedResponse.headers` and tweaked it to be the intersection of the built-in type and `node-fetch` type.
+12 -1
View File
@@ -16,7 +16,18 @@ export class ConflictError extends CustomErrorBase {}
// @public
export type ConsumedResponse = {
readonly headers: Headers;
readonly headers: {
append(name: string, value: string): void;
delete(name: string): void;
get(name: string): string | null;
has(name: string): boolean;
set(name: string, value: string): void;
forEach(callback: (value: string, name: string) => void): void;
entries(): IterableIterator<[string, string]>;
keys(): IterableIterator<string>;
values(): IterableIterator<string>;
[Symbol.iterator](): Iterator<[string, string]>;
};
readonly ok: boolean;
readonly redirected: boolean;
readonly status: number;
+13 -1
View File
@@ -21,7 +21,19 @@
* @public
*/
export type ConsumedResponse = {
readonly headers: Headers;
readonly headers: {
append(name: string, value: string): void;
delete(name: string): void;
get(name: string): string | null;
has(name: string): boolean;
set(name: string, value: string): void;
forEach(callback: (value: string, name: string) => void): void;
entries(): IterableIterator<[string, string]>;
keys(): IterableIterator<string>;
values(): IterableIterator<string>;
[Symbol.iterator](): Iterator<[string, string]>;
};
readonly ok: boolean;
readonly redirected: boolean;
readonly status: number;