-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
141 lines (119 loc) · 4.28 KB
/
Copy pathindex.d.ts
File metadata and controls
141 lines (119 loc) · 4.28 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
declare module 'frostbyte-api' {
export class FrostbyteError extends Error {
status: number;
body: any;
constructor(message: string, status: number, body?: any);
}
export interface GeoResult {
ip: string;
city: string;
region: string;
country: string;
country_name: string;
continent: string;
latitude: number;
longitude: number;
timezone: string;
isp: string;
org: string;
as: string;
}
export interface CryptoPrice {
symbol: string;
price: number;
change_24h: number;
market_cap: number;
volume_24h: number;
}
export interface DnsRecord {
type: string;
name: string;
value: string;
ttl: number;
}
export interface BalanceResult {
credits: number;
usage: string;
expiresAt: string;
}
export class GeoService {
lookup(ip: string): Promise<GeoResult>;
me(): Promise<GeoResult>;
batch(ips: string[]): Promise<GeoResult[]>;
distance(ip1: string, ip2: string): Promise<{ distance_km: number; distance_mi: number }>;
}
export class CryptoService {
prices(): Promise<CryptoPrice[]>;
price(symbol: string): Promise<CryptoPrice>;
}
export class DnsService {
resolve(domain: string): Promise<{ records: DnsRecord[] }>;
all(domain: string): Promise<{ records: DnsRecord[] }>;
whois(domain: string): Promise<Record<string, any>>;
}
export class ScreenshotService {
capture(url: string, options?: { width?: number; height?: number; fullPage?: boolean }): Promise<Buffer>;
}
export class ScraperService {
scrape(url: string, options?: Record<string, any>): Promise<Record<string, any>>;
extract(url: string, selectors: Record<string, string>): Promise<Record<string, any>>;
}
export class WalletService {
create(chain?: string, options?: Record<string, any>): Promise<Record<string, any>>;
balance(id: string): Promise<Record<string, any>>;
}
export class CodeService {
execute(language: string, code: string, options?: Record<string, any>): Promise<{ output: string; exitCode: number }>;
languages(): Promise<string[]>;
}
export class PdfService {
fromHtml(html: string, options?: Record<string, any>): Promise<Buffer>;
fromUrl(url: string, options?: Record<string, any>): Promise<Buffer>;
fromMarkdown(markdown: string, options?: Record<string, any>): Promise<Buffer>;
}
export class ShortUrlService {
shorten(url: string, options?: Record<string, any>): Promise<{ slug: string; shortUrl: string }>;
stats(slug: string): Promise<Record<string, any>>;
}
export class SearchService {
search(query: string, options?: Record<string, any>): Promise<Record<string, any>>;
}
export class PasteService {
create(content: string, options?: Record<string, any>): Promise<{ id: string; url: string }>;
get(id: string): Promise<Record<string, any>>;
}
export class EmailService {
send(to: string, subject: string, body: string, options?: Record<string, any>): Promise<Record<string, any>>;
}
export class TransformService {
transform(data: any, options?: Record<string, any>): Promise<Record<string, any>>;
}
export class ImageService {
resize(image: string | Buffer, width: number, height: number, options?: Record<string, any>): Promise<Buffer>;
convert(image: string | Buffer, format: string, options?: Record<string, any>): Promise<Buffer>;
}
export class Frostbyte {
constructor(apiKey: string);
static create(options?: { email?: string }): Promise<Frostbyte>;
readonly key: string;
readonly geo: GeoService;
readonly crypto: CryptoService;
readonly dns: DnsService;
readonly screenshot: ScreenshotService;
readonly scraper: ScraperService;
readonly wallet: WalletService;
readonly code: CodeService;
readonly pdf: PdfService;
readonly shorturl: ShortUrlService;
readonly search: SearchService;
readonly paste: PasteService;
readonly email: EmailService;
readonly transform: TransformService;
readonly image: ImageService;
balance(): Promise<BalanceResult>;
usage(hours?: number): Promise<Record<string, any>>;
services(): Promise<Record<string, any>>;
request(method: string, path: string, body?: any, options?: { timeout?: number; raw?: boolean }): Promise<any>;
}
export default Frostbyte;
}