fetch-inline-assets.d.ts 571 B

123456789101112131415
  1. import type { EdgeFunctionDefinition } from '../../../build/webpack/plugins/middleware-plugin';
  2. /**
  3. * Short-circuits the `fetch` function
  4. * to return a stream for a given asset, if a user used `new URL("file", import.meta.url)`.
  5. * This allows to embed assets in Edge Runtime.
  6. */
  7. export declare function fetchInlineAsset(options: {
  8. input: RequestInfo | URL;
  9. distDir: string;
  10. assets: EdgeFunctionDefinition['assets'];
  11. context: {
  12. Response: typeof Response;
  13. ReadableStream: typeof ReadableStream;
  14. };
  15. }): Promise<Response | undefined>;