response.d.ts 905 B

1234567891011121314151617181920212223242526
  1. import { OutgoingHttpHeaders } from 'node:http';
  2. declare const getResponseCache: unique symbol;
  3. declare const cacheKey: unique symbol;
  4. type InternalCache = [
  5. number,
  6. string | ReadableStream,
  7. Record<string, string> | [string, string][] | Headers | OutgoingHttpHeaders | undefined
  8. ];
  9. declare const GlobalResponse: {
  10. new (body?: BodyInit | null, init?: ResponseInit): globalThis.Response;
  11. prototype: globalThis.Response;
  12. error(): globalThis.Response;
  13. json(data: any, init?: ResponseInit): globalThis.Response;
  14. redirect(url: string | URL, status?: number): globalThis.Response;
  15. };
  16. declare class Response {
  17. #private;
  18. [getResponseCache](): globalThis.Response;
  19. constructor(body?: BodyInit | null, init?: ResponseInit);
  20. get headers(): Headers;
  21. get status(): number;
  22. get ok(): boolean;
  23. }
  24. export { GlobalResponse, type InternalCache, Response, cacheKey };