1 | import * as log4js from "log4js";
|
2 | import * as ts from "typescript";
|
3 | import { Configuration } from "../shared/configuration";
|
4 | export interface TransformResult {
|
5 | dirty?: boolean;
|
6 | transpile?: boolean;
|
7 | transformedScript?: boolean;
|
8 | }
|
9 | export interface TransformCallback {
|
10 | (error: Error, dirty: boolean, transpile?: boolean): void;
|
11 | (error: Error, result: TransformResult): void;
|
12 | }
|
13 | export interface TransformContextJs {
|
14 | ast: acorn.Node;
|
15 | }
|
16 | export interface TransformContextTs {
|
17 | version: string;
|
18 | ast: ts.SourceFile;
|
19 | transpiled: string;
|
20 | }
|
21 | export interface TransformContext {
|
22 | config: Configuration;
|
23 | js?: TransformContextJs;
|
24 | filename: string;
|
25 | module: string;
|
26 | source: string;
|
27 | ts?: TransformContextTs;
|
28 | }
|
29 | export interface TransformInitializeLogOptions {
|
30 | appenders: {
|
31 | [name: string]: log4js.Appender;
|
32 | };
|
33 | level: string;
|
34 | }
|
35 | export type TransformInitialize = (log: TransformInitializeLogOptions) => void;
|
36 | export interface Transform {
|
37 | (context: TransformContext, callback: TransformCallback): void;
|
38 | initialize?: TransformInitialize;
|
39 | }
|