fetch-proxy.d.ts 583 B

1234567891011121314151617181920212223
  1. declare const weexFetch: any;
  2. export interface WeexFetchResponse {
  3. ok: boolean;
  4. status: number;
  5. statusText: string;
  6. data: string;
  7. headers: object;
  8. }
  9. export declare const wrapResponse: (res: WeexFetchResponse) => {
  10. ok: boolean;
  11. status: number;
  12. statusText: string;
  13. body: string;
  14. headers: object;
  15. clone: () => any;
  16. text: () => Promise<unknown>;
  17. json: () => Promise<unknown>;
  18. };
  19. /**
  20. * 将 weex 的 fetch 封装成标准 fetch
  21. */
  22. declare const fetch: (url: string, options?: object) => Promise<unknown>;
  23. export { fetch, weexFetch, };