1 |
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | import ts from 'typescript';
|
10 | import { AstFactory, BinaryOperator, LeadingComment, ObjectLiteralProperty, SourceMapRange, TemplateLiteral, UnaryOperator, VariableDeclarationType } from './api/ast_factory';
|
11 |
|
12 |
|
13 |
|
14 | export declare class TypeScriptAstFactory implements AstFactory<ts.Statement, ts.Expression> {
|
15 | private annotateForClosureCompiler;
|
16 | private externalSourceFiles;
|
17 | constructor(annotateForClosureCompiler: boolean);
|
18 | attachComments: typeof attachComments;
|
19 | createArrayLiteral: (elements?: readonly ts.Expression[] | undefined, multiLine?: boolean | undefined) => ts.ArrayLiteralExpression;
|
20 | createAssignment(target: ts.Expression, value: ts.Expression): ts.Expression;
|
21 | createBinaryExpression(leftOperand: ts.Expression, operator: BinaryOperator, rightOperand: ts.Expression): ts.Expression;
|
22 | createBlock(body: ts.Statement[]): ts.Statement;
|
23 | createCallExpression(callee: ts.Expression, args: ts.Expression[], pure: boolean): ts.Expression;
|
24 | createConditional: {
|
25 | (condition: ts.Expression, whenTrue: ts.Expression, whenFalse: ts.Expression): ts.ConditionalExpression;
|
26 | (condition: ts.Expression, questionToken: ts.QuestionToken, whenTrue: ts.Expression, colonToken: ts.ColonToken, whenFalse: ts.Expression): ts.ConditionalExpression;
|
27 | };
|
28 | createElementAccess: (expression: ts.Expression, index: number | ts.Expression) => ts.ElementAccessExpression;
|
29 | createExpressionStatement: (expression: ts.Expression) => ts.ExpressionStatement;
|
30 | createFunctionDeclaration(functionName: string, parameters: string[], body: ts.Statement): ts.Statement;
|
31 | createFunctionExpression(functionName: string | null, parameters: string[], body: ts.Statement): ts.Expression;
|
32 | createIdentifier: (text: string) => ts.Identifier;
|
33 | createIfStatement(condition: ts.Expression, thenStatement: ts.Statement, elseStatement: ts.Statement | null): ts.Statement;
|
34 | createLiteral(value: string | number | boolean | null | undefined): ts.Expression;
|
35 | createNewExpression(expression: ts.Expression, args: ts.Expression[]): ts.Expression;
|
36 | createObjectLiteral(properties: ObjectLiteralProperty<ts.Expression>[]): ts.Expression;
|
37 | createParenthesizedExpression: (expression: ts.Expression) => ts.ParenthesizedExpression;
|
38 | createPropertyAccess: (expression: ts.Expression, name: string | ts.MemberName) => ts.PropertyAccessExpression;
|
39 | createReturnStatement(expression: ts.Expression | null): ts.Statement;
|
40 | createTaggedTemplate(tag: ts.Expression, template: TemplateLiteral<ts.Expression>): ts.Expression;
|
41 | createThrowStatement: (expression: ts.Expression) => ts.ThrowStatement;
|
42 | createTypeOfExpression: (expression: ts.Expression) => ts.TypeOfExpression;
|
43 | createUnaryExpression(operator: UnaryOperator, operand: ts.Expression): ts.Expression;
|
44 | createVariableDeclaration(variableName: string, initializer: ts.Expression | null, type: VariableDeclarationType): ts.Statement;
|
45 | setSourceMapRange<T extends ts.Node>(node: T, sourceMapRange: SourceMapRange | null): T;
|
46 | }
|
47 | export declare function createTemplateMiddle(cooked: string, raw: string): ts.TemplateMiddle;
|
48 | export declare function createTemplateTail(cooked: string, raw: string): ts.TemplateTail;
|
49 |
|
50 |
|
51 |
|
52 |
|
53 |
|
54 |
|
55 | export declare function attachComments(statement: ts.Statement, leadingComments: LeadingComment[]): void;
|