UNPKG

5.61 kBTypeScriptView Raw
1import { CompilerHost, CompilerOptions, Program } from 'typescript';
2import { FileCache } from './file-cache';
3import { VirtualDirStats, VirtualFileStats } from './virtual-file-utils';
4export interface SemverVersion {
5 major: number;
6 minor: number;
7 patch: number;
8}
9export interface BuildContext {
10 rootDir?: string;
11 tmpDir?: string;
12 srcDir?: string;
13 pagesDir?: string;
14 componentsDir?: string;
15 directivesDir?: string;
16 pipesDir?: string;
17 providersDir?: string;
18 wwwDir?: string;
19 wwwIndex?: string;
20 buildDir?: string;
21 outputJsFileName?: string;
22 outputCssFileName?: string;
23 nodeModulesDir?: string;
24 angularCoreDir?: string;
25 typescriptDir?: string;
26 ionicAngularDir?: string;
27 coreCompilerFilePath?: string;
28 coreDir?: string;
29 bundledFilePaths?: string[];
30 moduleFiles?: string[];
31 appNgModulePath?: string;
32 componentsNgModulePath?: string;
33 pipesNgModulePath?: string;
34 directivesNgModulePath?: string;
35 isProd?: boolean;
36 isWatch?: boolean;
37 runAot?: boolean;
38 runMinifyJs?: boolean;
39 runMinifyCss?: boolean;
40 optimizeJs?: boolean;
41 bundler?: string;
42 fileCache?: FileCache;
43 inlineTemplates?: boolean;
44 webpackWatch?: any;
45 ionicGlobal?: any;
46 sourcemapDir?: string;
47 sassState?: BuildState;
48 transpileState?: BuildState;
49 templateState?: BuildState;
50 bundleState?: BuildState;
51 deepLinkState?: BuildState;
52 target?: string;
53 platform?: string;
54 angularVersion?: SemverVersion;
55 ionicAngularVersion?: SemverVersion;
56 typescriptVersion?: SemverVersion;
57}
58export declare enum BuildState {
59 SuccessfulBuild = 0,
60 RequiresUpdate = 1,
61 RequiresBuild = 2,
62}
63export interface WorkerMessage {
64 taskModule?: string;
65 taskWorker?: string;
66 context?: BuildContext;
67 workerConfig?: any;
68 resolve?: any;
69 reject?: any;
70 error?: any;
71 pid?: number;
72}
73export interface WorkerProcess {
74 task: string;
75 worker: any;
76}
77export interface TaskInfo {
78 fullArg: string;
79 shortArg: string;
80 envVar: string;
81 packageConfig: string;
82 defaultConfigFile: string;
83}
84export interface File {
85 path: string;
86 content: string;
87 timestamp?: number;
88}
89export interface Diagnostic {
90 level: string;
91 type: string;
92 language: string;
93 header: string;
94 code: string;
95 messageText: string;
96 absFileName: string;
97 relFileName: string;
98 lines: PrintLine[];
99}
100export interface PrintLine {
101 lineIndex: number;
102 lineNumber: number;
103 text: string;
104 html: string;
105 errorCharStart: number;
106 errorLength: number;
107}
108export interface WsMessage {
109 category: string;
110 type: string;
111 data: any;
112}
113export interface BuildUpdateMessage {
114 buildId: number;
115 reloadApp: boolean;
116}
117export interface ChangedFile {
118 event: string;
119 filePath: string;
120 ext: string;
121}
122export interface FileSystem {
123 isSync(): boolean;
124 stat(path: string, callback: Function): any;
125 readdir(path: string, callback: Function): any;
126 readFile(path: string, callback: Function): any;
127 readJson(path: string, callback: Function): any;
128 readlink(path: string, callback: Function): any;
129 purge(what: any): void;
130 writeFile(filePath: string, fileContent: Buffer, callback: Function): void;
131 mkdirp(filePath: string, callback: Function): void;
132 mkdir(filePath: string, callback: Function): void;
133 rmdir(filePath: string, callback: Function): void;
134 unlink(filePath: string, callback: Function): void;
135}
136export interface VirtualFileSystem {
137 addVirtualFile(filePath: string, fileContent: string): void;
138 getFileContent(filePath: string): string;
139 getDirectoryStats(path: string): VirtualDirStats;
140 getSubDirs(directoryPath: string): string[];
141 getFileNamesInDirectory(directoryPath: string): string[];
142 getAllFileStats(): {
143 [filePath: string]: VirtualFileStats;
144 };
145 getAllDirStats(): {
146 [filePath: string]: VirtualDirStats;
147 };
148}
149export interface DeepLinkDecoratorAndClass {
150 name: string;
151 segment: string;
152 defaultHistory: string[];
153 priority: string;
154 rawString: string;
155 className: string;
156}
157export interface DeepLinkPathInfo {
158 absolutePath: string;
159 userlandModulePath: string;
160 className: string;
161}
162export interface DeepLinkConfigEntry extends DeepLinkDecoratorAndClass, DeepLinkPathInfo {
163}
164export interface AppNgModuleInfo {
165 absolutePath: string;
166 className: string;
167}
168export interface CodegenOptions {
169 angularCompilerOptions: any;
170 cliOptions: any;
171 program: Program;
172 compilerHost: CompilerHost;
173 compilerOptions: CompilerOptions;
174}
175export interface TreeShakeCalcResults {
176 updatedDependencyMap: Map<string, Set<string>>;
177 purgedModules: Map<string, Set<string>>;
178}
179export interface WebpackStats {
180 modules: WebpackModule[];
181}
182export interface WebpackModule {
183 identifier: string;
184 reasons: WebpackDependency[];
185}
186export interface WebpackDependency {
187 moduleIdentifier: string;
188}
189export interface MagicString {
190 overwrite(startIndex: number, endIndex: number, newContent: string): void;
191 toString(): string;
192 prependLeft(index: number, contentToPrepend: string): string;
193}
194export interface CoreCompiler {
195 bundle: {
196 (config: {
197 srcDir: string;
198 destDir: string;
199 packages: Packages;
200 debug?: boolean;
201 }): Promise<any>;
202 };
203}
204export interface Packages {
205 path?: any;
206 fs?: any;
207 typescript?: any;
208 nodeSass?: any;
209 rollup?: any;
210 uglify?: any;
211}