headers.d.ts 916 B

1234567891011121314151617181920
  1. type HeaderValue = string | undefined | null;
  2. export type HeadersLike = Headers | readonly HeaderValue[][] | Record<string, HeaderValue | readonly HeaderValue[]> | undefined | null | NullableHeaders;
  3. declare const brand_privateNullableHeaders: unique symbol;
  4. /**
  5. * @internal
  6. * Users can pass explicit nulls to unset default headers. When we parse them
  7. * into a standard headers type we need to preserve that information.
  8. */
  9. export type NullableHeaders = {
  10. /** Brand check, prevent users from creating a NullableHeaders. */
  11. [brand_privateNullableHeaders]: true;
  12. /** Parsed headers. */
  13. values: Headers;
  14. /** Set of lowercase header names explicitly set to null. */
  15. nulls: Set<string>;
  16. };
  17. export declare const buildHeaders: (newHeaders: HeadersLike[]) => NullableHeaders;
  18. export declare const isEmptyHeaders: (headers: HeadersLike) => boolean;
  19. export {};
  20. //# sourceMappingURL=headers.d.ts.map