-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathindex.d.ts
More file actions
67 lines (57 loc) · 2.48 KB
/
index.d.ts
File metadata and controls
67 lines (57 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import type { File } from '../file-system';
import type { ImageSource } from '../image-source';
import type { HttpRequestOptions } from './http-interfaces';
export { request } from './http-request';
export * from './http-interfaces';
/**
* Downloads the content from the specified URL as a string.
* @param url The URL to request from.
*/
export function getString(url: string): Promise<string>;
/**
* Downloads the content from the specified URL as a string.
* @param options An object that specifies various request options.
*/
export function getString(options: HttpRequestOptions): Promise<string>;
/**
* Downloads the content from the specified URL as a string and returns its JSON.parse representation.
* @param url The URL to request from.
*/
export function getJSON<T>(url: string): Promise<T>;
/**
* Downloads the content from the specified URL as a string and returns its JSON.parse representation.
* @param options An object that specifies various request options.
*/
export function getJSON<T>(options: HttpRequestOptions): Promise<T>;
/**
* Downloads the content from the specified URL and attempts to decode it as an image.
* @param url The URL to request from.
*/
export function getImage(url: string): Promise<ImageSource>;
/**
* Downloads the content from the specified URL and attempts to decode it as an image.
* @param options An object that specifies various request options.
*/
export function getImage(options: HttpRequestOptions): Promise<ImageSource>;
/**
* Downloads the content from the specified URL and attempts to save it as file.
* @param url The URL to request from.
* @param destinationFilePath Optional. The downloaded file path.
*/
export function getFile(url: string, destinationFilePath?: string): Promise<any>;
/**
* Downloads the content from the specified URL and attempts to save it as file.
* @param options An object that specifies various request options.
* @param destinationFilePath Optional. The downloaded file path.
*/
export function getFile(options: HttpRequestOptions, destinationFilePath?: string): Promise<File>;
/**
* Downloads the content from the specified URL as binary and returns an ArrayBuffer.
* @param url The URL to request from.
*/
export function getBinary(url: string): Promise<ArrayBuffer>;
/**
* Downloads the content from the specified URL as binary and returns an ArrayBuffer.
* @param options An object that specifies various request options.
*/
export function getBinary(options: HttpRequestOptions): Promise<ArrayBuffer>;