-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathindex.d.ts
55 lines (50 loc) · 1.14 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
53
54
55
type Callback<T> = (err: NodeJS.ErrnoException | null, data: T) => void;
interface External {
global: string | string[];
url: string;
}
interface ExtendedExternal extends External {
name: string;
devUrl?: string;
}
interface TemplateRenderer {
getInfo: () => {
externals: ExtendedExternal[];
type: string;
version: string;
};
}
type Template = {
externals: External[];
};
interface CompileOptions {
templates?: Record<string, Template> | TemplateRenderer[];
retryInterval?: number;
retryLimit?: number;
disableLoader?: boolean;
disableLegacyTemplates?: boolean;
externals?: External[];
}
type Compiled = { code: string; map: string; dev: string };
declare const ocClient: {
compile: {
(options?: CompileOptions): Promise<Compiled>;
};
compileSync: {
(options?: CompileOptions): Compiled;
};
getLib: {
(cb: Callback<string>): void;
(): Promise<string>;
};
getLibs: {
(cb: Callback<{ dev: string; prod: string }>): void;
(): Promise<{ dev: string; prod: string }>;
};
getMap: {
(cb: Callback<string>): void;
(): Promise<string>;
};
version: string;
};
export = ocClient;