errors: inline headers type

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2022-07-14 15:32:41 +02:00
parent 0d0fde9f69
commit c1a8bbf5e5
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;