-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
52 lines (45 loc) · 1.36 KB
/
index.d.ts
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
declare namespace Miyako
{
export function create(url: string, options?: Miyako.DownloaderOptions): Miyako.Downloader;
export const version: string;
export class Downloader
{
constructor(url: string, options?: Miyako.DownloaderOptions);
public url: string;
public options: Readonly<Miyako.DownloaderOptions>;
public download(): Promise<void>;
}
export interface DownloaderOptions
{
maxBytes?: number;
}
export namespace Terminal
{
export class Terminal
{
constructor();
public commands: Miyako.Terminal.Collection<Miyako.Terminal.Command>;
}
export class Collection<T> extends Map<string, T>
{
public filter(func: (i: T) => boolean): T[];
public map(func: (i: T) => any): T[];
}
export class Command
{
constructor(info: Miyako.Terminal.CommandInfo);
public command: string;
public description: string;
public usage: string;
public run: (args: string[]) => Promise<string>;
}
export interface CommandInfo
{
command: string;
description: string;
run: (args: string[]) => Promise<string>;
usage?: string;
}
}
}
export = Miyako;