Skip to content

"Get latest changes from dart-archive/ts2dart master #1" #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 110 commits into from
Dec 24, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
96e387b
fix(test): Move e2e tests from deprecated Dart unittest package to te…
vikerman Feb 1, 2016
78914a0
feat: add .idea/ as an IDE file to ignore in gitignore.
hansl Jan 31, 2016
f03eeb8
feat(): Support for-of statements.
hansl Feb 1, 2016
93e4ee5
Integrate Dart Formatter directly into ts2dart for cleaner output
jacob314 Jan 27, 2016
6150311
fix(test): Move e2e tests from deprecated Dart unittest package to te…
vikerman Feb 1, 2016
6f52182
feat: add .idea/ as an IDE file to ignore in gitignore.
hansl Jan 31, 2016
894aac0
feat(): Support for-of statements.
hansl Feb 1, 2016
a560bce
feat(): Add support for void generic argument, which translates to dy…
hansl Feb 1, 2016
917e01a
fix(decorators): support decorators applied to abstract classes
vsavkin Feb 4, 2016
3a18077
feat(): Add support for void generic argument, which translates to dy…
hansl Feb 1, 2016
05e49ea
fix(decorators): support decorators applied to abstract classes
vsavkin Feb 4, 2016
4afcb15
rel: 0.7.23
vikerman Feb 4, 2016
f5da225
rel: 0.8.1
vikerman Feb 4, 2016
42cc4c2
feat(facade): translate the Promise type without explicit export
alexeagle Feb 7, 2016
eb70bf8
feat(facade): translate the Promise type without explicit export
alexeagle Feb 7, 2016
e7f7317
fix(): allow facades to be in node_modules.
hansl Feb 5, 2016
672422a
fix(): allow facades to be in node_modules.
hansl Feb 5, 2016
e9dbe7c
feat(build): add npm run release shortcut
alexeagle Feb 8, 2016
067f634
Release v0.8.2.
alexeagle Feb 8, 2016
ac00885
feat(build): add npm run release shortcut
alexeagle Feb 8, 2016
5858b8f
Release v0.7.24.
alexeagle Feb 8, 2016
d9bdd42
fix(): remove `(../)*node_modules` from every file name, and use FC for
hansl Feb 8, 2016
bc0d538
fix(): remove `(../)*node_modules` from every file name, and use FC for
hansl Feb 8, 2016
d9b881f
Release v0.8.3
vikerman Feb 13, 2016
a3f457f
fix(): remove `(../)*node_modules` from every file name, and use FC for
hansl Feb 8, 2016
6dcab16
fix(): remove `(../)*node_modules` from every file name, and use FC for
hansl Feb 8, 2016
076fd23
Release v0.7.25
vikerman Feb 13, 2016
08999cc
Sanitize TypeScript doc strings to remove tags not recognized by dartdoc
vikerman Feb 17, 2016
0605f34
Release v0.8.4
vikerman Feb 17, 2016
cc27423
Sanitize TypeScript doc strings to remove tags not recognized by dartdoc
vikerman Feb 17, 2016
b0261d3
Release v0.7.26
vikerman Feb 17, 2016
8c2e9a9
fix(): allow the caller (or CLI) to specify a root directory for typi…
hansl Feb 18, 2016
708de54
fix(): allow the caller (or CLI) to specify a root directory for typi…
hansl Feb 18, 2016
dafa407
Release v0.7.27
vikerman Feb 25, 2016
cbd75fe
Release v0.8.5
vikerman Feb 25, 2016
e1b1502
feat(): support DDC style generic methods.
mprobst Mar 1, 2016
a7df0b7
feat(): support DDC style generic methods.
mprobst Mar 1, 2016
4342332
rel: 0.7.28.
mprobst Mar 3, 2016
32e8003
Release v0.8.5
vikerman Mar 3, 2016
a0ec02b
feat(): support generic method calls.
mprobst Mar 4, 2016
841e884
rel: 0.7.29.
mprobst Mar 4, 2016
49259a8
Merge branch 'v0.7'
mprobst Mar 4, 2016
22b2716
fix(): handle significant whitespace in DDC generic functions.
mprobst Mar 4, 2016
a594d02
rel: 0.7.30.
mprobst Mar 4, 2016
935d453
rel: 0.7.31.
mprobst Mar 4, 2016
7048bdf
Merge branch 'v0.7'
mprobst Mar 4, 2016
4f5a67e
Release v0.8.7
vikerman Mar 9, 2016
c313fbb
Pull in version of dart-style that does not pollute global with a stu…
jacob314 Mar 2, 2016
ac5ac86
fix: ensure that numbers are temporarily casted to ints for bitwise o…
matsko Mar 9, 2016
87d5419
rel: 0.8.8.
mprobst Mar 10, 2016
0a8aed9
chore: make a slightly cleaner bitwise comparison.
mprobst Mar 15, 2016
f356942
feat: log errors to stderr.
mprobst Mar 15, 2016
1abcc3c
feat: support container literals with reified types.
mprobst Mar 23, 2016
8d94b24
rel: 0.8.9.
mprobst Mar 23, 2016
36dca3a
feat: support types on named parameters.
mprobst Apr 4, 2016
09b7fde
feat: handle const reified generics.
mprobst Apr 4, 2016
c035ef3
feat: support function types in parameters.
mprobst Apr 4, 2016
3923645
rel: 0.8.10.
mprobst Apr 4, 2016
b0aba1e
chore: upgrade clang-format to 1.0.37.
mprobst Apr 7, 2016
ab74a71
chore: base arc diffs on v0.7 on this branch.
mprobst Apr 8, 2016
0e81424
Automatically run unit tests on "arc diff".
mprobst Apr 9, 2016
ae3c9a8
feat: test case for function typed fields.
mprobst Apr 8, 2016
2cbaf79
feat: translate function parameters taking rest parameters to `Functi…
mprobst Apr 8, 2016
2d6f8bb
feat: do not cast numeric literals to ints for bit fiddling.
mprobst Apr 8, 2016
34f0ed9
refactor: extract initialiser extraction.
mprobst Apr 8, 2016
0de9712
rel: 0.8.11.
mprobst Apr 10, 2016
e23f45a
feat: ignore return types on function expressions.
mprobst Apr 20, 2016
d2a01df
feat: prohibit use of `substr`.
mprobst Apr 21, 2016
3fe41fb
feat: support reference constness.
mprobst Apr 21, 2016
93ccbb0
rel: 0.8.12.
mprobst Apr 21, 2016
f4cdc39
feat: transpile console.log to print (#352) (#364)
ochafik Apr 23, 2016
7c1ffdb
Fix RegExp.exec (#194) (#365)
ochafik Apr 23, 2016
f59ea69
feat: move to the TypeScript 1.9 preview.
mprobst Apr 23, 2016
9d7adfe
rel: 0.9.0.
mprobst Apr 23, 2016
3cc8fb6
fix: support declared but untyped properties in named parameters.
mprobst Apr 11, 2016
966d58b
rel: 0.9.1.
mprobst Apr 23, 2016
dd1bc08
chore: fix .arcconfig.
mprobst Apr 23, 2016
191b562
feat: support passing in a tsconfig.json.
mprobst Apr 23, 2016
a00f9b8
rel: 0.9.2.
mprobst Apr 23, 2016
6ba84d0
feat: translate 'angular/' imports to 'angular2/'.
mprobst Apr 23, 2016
13941e4
rel: 0.9.3.
mprobst Apr 23, 2016
d757fc3
feat: strip leading at signs for library names.
mprobst Apr 24, 2016
07b6c55
fix: depend on test.compile before tsc_e2e.
mprobst Apr 25, 2016
55a7052
rel: 0.9.4.
mprobst Apr 25, 2016
f261cc2
feat: support /* @ts2dart_const */ expressions.
mprobst Apr 25, 2016
195b2b6
rel: 0.9.5.
mprobst Apr 26, 2016
1d6e6b1
feat: support comments in place of @CONST.
mprobst Apr 26, 2016
be66f24
rel: 0.9.6.
mprobst Apr 26, 2016
204d17e
feat: allow /* @ts2dart_const */ without parens.
mprobst Apr 26, 2016
9b6e665
rel: 0.9.7.
mprobst Apr 26, 2016
3c8e3f9
fix: move to a newer Dart `test` package to fix build failures.
mprobst Apr 26, 2016
20b521d
chore: configure arc to land on master.
mprobst Apr 26, 2016
3a7a40d
feat: mark all parameter initialisers as const.
mprobst Apr 26, 2016
b92b787
fix: only apply const comments within an expression.
mprobst Apr 27, 2016
cb0f538
rel: 0.9.8.
mprobst Apr 27, 2016
78d37e4
Merge pull request #367 from ochafik/fix-future-ctors
ochafik Apr 27, 2016
31f9b38
feat: clean up path handling.
mprobst Apr 27, 2016
d5a5103
feat: map immediate literals to const expressions.
mprobst Apr 29, 2016
2752ef9
feat: report last location on crashes.
mprobst Apr 29, 2016
764a50c
chore: report right source for erroneous tests.
mprobst Apr 29, 2016
a832f10
feat: translate /* @ts2dart_Provider */ comments.
mprobst Apr 29, 2016
e61af88
chore: fix integration test.
mprobst Apr 29, 2016
7eec6e8
rel: 0.9.9.
mprobst Apr 29, 2016
b508238
fix: support generic methods.
mprobst Apr 30, 2016
70caeff
rel: 0.9.10.
mprobst Apr 30, 2016
6da6640
Add ability to install globally and execute as command line app (#372)
luisvt Aug 16, 2016
67e6cd0
rel: 0.9.11.
mprobst Aug 16, 2016
f19eb49
init for keikai project
jumperchen Nov 29, 2016
3ac0315
add build/*.js
jumperchen Nov 29, 2016
65073d2
fix import syntax.
jumperchen Nov 30, 2016
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .arc/npm-test/__phutil_library_init__.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<?php

phutil_register_library('npm-test', __FILE__);
18 changes: 18 additions & 0 deletions .arc/npm-test/__phutil_library_map__.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php

/**
* This file is automatically generated. Use 'arc liberate' to rebuild it.
*
* @generated
* @phutil-library-version 2
*/
phutil_register_library_map(array(
'__library_version__' => 2,
'class' => array(
'NpmUnitTestEngine' => 'src/NpmUnitTestEngine.php',
),
'function' => array(),
'xmap' => array(
'NpmUnitTestEngine' => 'ArcanistUnitTestEngine',
),
));
20 changes: 20 additions & 0 deletions .arc/npm-test/src/NpmUnitTestEngine.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php
class NpmUnitTestEngine extends ArcanistUnitTestEngine {
public function run() {
$retval = 0;
system('npm test', $retval);
$result = new ArcanistUnitTestResult();
$result->setName('npm test');
if ($retval == 0) {
$result->setResult(ArcanistUnitTestResult::RESULT_PASS);
} else {
$result->setResult(ArcanistUnitTestResult::RESULT_FAIL);
}
return array($result);
}

public function shouldEchoTestResults() {
return false;
}
}
?>
8 changes: 8 additions & 0 deletions .arcconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"base": "git:origin/master",
"phabricator.uri" : "https://reviews.angular.io/",
"load": [
".arc/npm-test"
],
"unit.engine": "NpmUnitTestEngine"
}
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Compiled JS
build

# Logs
logs
Expand All @@ -9,6 +8,7 @@ logs
pids
*.pid
*.seed
.phutil_module_cache

# Type definitions installed with tsd
typings
Expand All @@ -30,3 +30,7 @@ node_modules

# Users Environment Variables
.lock-wscript

# IDEs
.idea/
/ts2dart.iml
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
# TypeScript to Dart transpiler [![Build Status](https://travis-ci.org/angular/ts2dart.svg?branch=master)](https://travis-ci.org/angular/ts2dart)

ts2dart is a TypeScript to Dart transpiler. It's mainly used to translate Angular 2 from TypeScript
to Dart for its Dart user base.

ts2dart is a TypeScript to Dart transpiler. It's in its very early days and under heavy development,
not ready for production use.
## Usage

- To install as Command Line Tool execute: `npm i -g ts2dart`
- Once installed you could run it doing: `ts2dart inputFile.ts`

## Installation

Expand All @@ -15,3 +19,15 @@ not ready for production use.
- `gulp test.e2e` executes the e2e tests,
- `gulp test.check-format` checks the source code formatting using `clang-format`,
- `gulp test` runs unit tests, e2e tests and checks the source code formatting.

## Phabricator Reviews

You can send pull requests via Github, or by creating a Phabricator diff on
https://reviews.angular.io. Both are fine, though Phabricator has a nicer code review UI.

To create a Phabricator diff:

- create an account on https://reviews.angular.io
- install [Arcanist](https://secure.phabricator.com/book/phabricator/article/arcanist/)
- run `arc diff` to upload a diff (= pull request). This will also run all tests.
- get it reviewed by entering a "Reviewer", e.g. "mprobst", "alexeagle", "viks", ...
31 changes: 31 additions & 0 deletions build/definitions/base.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import * as ts from 'typescript';
import { Transpiler } from './main';
export declare type ClassLike = ts.ClassDeclaration | ts.InterfaceDeclaration;
export declare function ident(n: ts.Node): string;
export declare class TranspilerBase {
private transpiler;
private idCounter;
constructor(transpiler: Transpiler);
visit(n: ts.Node): void;
emit(s: string): void;
emitBefore(s: string, search: string): void;
emitNoSpace(s: string): void;
reportError(n: ts.Node, message: string): void;
visitNode(n: ts.Node): boolean;
visitEach(nodes: ts.Node[]): void;
visitEachIfPresent(nodes?: ts.Node[]): void;
visitList(nodes: ts.Node[], separator?: string): void;
uniqueId(name: string): string;
assert(c: ts.Node, condition: boolean, reason: string): void;
getAncestor(n: ts.Node, kind: ts.SyntaxKind): ts.Node;
hasAncestor(n: ts.Node, kind: ts.SyntaxKind): boolean;
hasAnnotation(decorators: ts.NodeArray<ts.Decorator>, name: string): boolean;
hasFlag(n: {
flags: number;
}, flag: ts.NodeFlags): boolean;
maybeDestructureIndexType(node: ts.TypeLiteralNode): [ts.TypeNode, ts.TypeNode];
getRelativeFileName(fileName: string): string;
maybeVisitTypeArguments(n: {
typeArguments?: ts.NodeArray<ts.TypeNode>;
}): void;
}
28 changes: 28 additions & 0 deletions build/definitions/call.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import ts = require('typescript');
import base = require('./base');
import ts2dart = require('./main');
import { FacadeConverter } from './facade_converter';
export default class CallTranspiler extends base.TranspilerBase {
private fc;
constructor(tr: ts2dart.Transpiler, fc: FacadeConverter);
visitNode(node: ts.Node): boolean;
private visitCall(c);
private handleNamedParamsCall(c);
/**
* Handles constructor initializer lists and bodies.
*
* <p>Dart's super() ctor calls have to be moved to the constructors initializer list, and `const`
* constructors must be completely empty, only assigning into fields through the initializer list.
* The code below finds super() calls and handles const constructors, marked with the special
* `@CONST` annotation on the class.
*
* <p>Not emitting super() calls when traversing the ctor body is handled by maybeHandleSuperCall
* below.
*/
private visitConstructorBody(ctor);
/**
* Checks whether `callExpr` is a super() call that should be ignored because it was already
* handled by `maybeEmitSuperInitializer` above.
*/
private maybeHandleSuperCall(callExpr);
}
29 changes: 29 additions & 0 deletions build/definitions/declaration.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import * as ts from 'typescript';
import * as base from './base';
import { FacadeConverter } from './facade_converter';
import { Transpiler } from './main';
export default class DeclarationTranspiler extends base.TranspilerBase {
private fc;
private enforceUnderscoreConventions;
constructor(tr: Transpiler, fc: FacadeConverter, enforceUnderscoreConventions: boolean);
visitNode(node: ts.Node): boolean;
private visitVariableDeclarationType(varDecl);
private visitFunctionLike(fn, accessor?);
private visitParameters(parameters);
/**
* Visit a property declaration.
* In the special case of property parameters in a constructor, we also allow a parameter to be
* emitted as a property.
*/
private visitProperty(decl, isParameter?);
private visitClassLike(keyword, decl);
private visitDecorators(decorators);
private visitDeclarationMetadata(decl);
private visitNamedParameter(paramDecl);
private getInitializers(paramDecl);
/**
* Handles a function typedef-like interface, i.e. an interface that only declares a single
* call signature, by translating to a Dart `typedef`.
*/
private visitFunctionTypedefInterface(name, signature, typeParameters);
}
10 changes: 10 additions & 0 deletions build/definitions/expression.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import * as ts from 'typescript';
import * as base from './base';
import { FacadeConverter } from './facade_converter';
import { Transpiler } from './main';
export default class ExpressionTranspiler extends base.TranspilerBase {
private fc;
constructor(tr: Transpiler, fc: FacadeConverter);
visitNode(node: ts.Node): boolean;
visitAndWrapAsInt(n: ts.Expression): void;
}
69 changes: 69 additions & 0 deletions build/definitions/facade_converter.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
import * as ts from 'typescript';
import * as base from './base';
import { Transpiler } from './main';
export declare class FacadeConverter extends base.TranspilerBase {
private tc;
private defaultLibLocation;
private candidateProperties;
private candidateTypes;
private genericMethodDeclDepth;
constructor(transpiler: Transpiler);
initializeTypeBasedConversion(tc: ts.TypeChecker, opts: ts.CompilerOptions, host: ts.CompilerHost): void;
private extractPropertyNames(m, candidates);
private resolveModuleNames(opts, host, m);
/**
* To avoid strongly referencing the Provider class (which could bloat binary size), Angular 2
* write providers as object literals. However the Dart transformers don't recognize this, so
* ts2dart translates the special syntax `/* @ts2dart_Provider * / {provide: Class, param1: ...}`
* into `const Provider(Class, param1: ...)`.
*/
maybeHandleProvider(ole: ts.ObjectLiteralExpression): boolean;
maybeHandleCall(c: ts.CallExpression): boolean;
handlePropertyAccess(pa: ts.PropertyAccessExpression): boolean;
/**
* Searches for type references that require extra imports and emits the imports as necessary.
*/
emitExtraImports(sourceFile: ts.SourceFile): void;
private emitImports(n, libraries, emitted, sourceFile);
pushTypeParameterNames(n: ts.FunctionLikeDeclaration): void;
popTypeParameterNames(n: ts.FunctionLikeDeclaration): void;
resolvePropertyTypes(tn: ts.TypeNode): ts.Map<ts.PropertyDeclaration>;
/**
* The Dart Development Compiler (DDC) has a syntax extension that uses comments to emulate
* generic methods in Dart. ts2dart has to hack around this and keep track of which type names
* in the current scope are actually DDC type parameters and need to be emitted in comments.
*
* TODO(martinprobst): Remove this once the DDC hack has made it into Dart proper.
*/
private isGenericMethodTypeParameterName(name);
visitTypeName(typeName: ts.EntityName): void;
shouldEmitNew(c: ts.CallExpression): boolean;
private getCallInformation(c);
private getHandler<T>(n, symbol, m);
private getFileAndName(n, originalSymbol);
private isNamedDefaultLibType(node, qname);
private reportMissingType(n, ident);
private static DECLARATIONS;
isInsideConstExpr(node: ts.Node): boolean;
isConstClass(decl: base.ClassLike): boolean;
/**
* isConstExpr returns true if the passed in expression itself is a const expression. const
* expressions are marked by the special comment @ts2dart_const (expr), or by the special
* function call CONST_EXPR.
*/
isConstExpr(node: ts.Node): boolean;
hasConstComment(node: ts.Node): boolean;
private hasMarkerComment(node, markerText);
private emitMethodCall(name, args?);
private emitCall(name, args?);
private stdlibTypeReplacements;
private tsToDartTypeNames;
private es6Promises;
private es6Collections;
private stdlibHandlers;
private callHandlerReplaceNew;
private callHandlers;
private es6CollectionsProp;
private es6PromisesProp;
private propertyHandlers;
}
13 changes: 13 additions & 0 deletions build/definitions/literal.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as ts from 'typescript';
import * as base from './base';
import { FacadeConverter } from './facade_converter';
import { Transpiler } from './main';
export default class LiteralTranspiler extends base.TranspilerBase {
private fc;
constructor(tr: Transpiler, fc: FacadeConverter);
visitNode(node: ts.Node): boolean;
private shouldBeConst(n);
private escapeTextForTemplateString(n);
private handleReifiedArray(node);
private handleReifiedMap(node);
}
68 changes: 68 additions & 0 deletions build/definitions/main.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
import * as ts from 'typescript';
export interface TranspilerOptions {
/**
* Fail on the first error, do not collect multiple. Allows easier debugging as stack traces lead
* directly to the offending line.
*/
failFast?: boolean;
/** Whether to generate 'library a.b.c;' names from relative file paths. */
generateLibraryName?: boolean;
/** Whether to generate source maps. */
generateSourceMap?: boolean;
/** A tsconfig.json to use to configure TypeScript compilation. */
tsconfig?: string;
/**
* A base path to relativize absolute file paths against. This is useful for library name
* generation (see above) and nicer file names in error messages.
*/
basePath?: string;
/**
* Translate calls to builtins, i.e. seemlessly convert from `Array` to `List`, and convert the
* corresponding methods. Requires type checking.
*/
translateBuiltins?: boolean;
/**
* Enforce conventions of public/private keyword and underscore prefix
*/
enforceUnderscoreConventions?: boolean;
}
export declare const COMPILER_OPTIONS: ts.CompilerOptions;
export declare class Transpiler {
private options;
private output;
private currentFile;
private lastCommentIdx;
private errors;
private transpilers;
private fc;
constructor(options?: TranspilerOptions);
/**
* Transpiles the given files to Dart.
* @param fileNames The input files.
* @param destination Location to write files to. Creates files next to their sources if absent.
*/
transpile(fileNames: string[], destination?: string): void;
translateProgram(program: ts.Program, host: ts.CompilerHost): {
[path: string]: string;
};
private getCompilerOptions();
private createCompilerHost();
getOutputPath(filePath: string, destinationRoot: string): string;
private translate(sourceFile);
private formatCode(code, context);
private checkForErrors(program);
private diagnosticToString(diagnostic);
/**
* Returns `filePath`, relativized to the program's `basePath`.
* @param filePath path to relativize.
*/
getRelativeFileName(filePath: string): string;
emit(s: string): void;
emitBefore(s: string, search: string): void;
emitNoSpace(s: string): void;
reportError(n: ts.Node, message: string): void;
visit(node: ts.Node): void;
private normalizeSlashes(path);
private translateComment(comment);
}
export declare function getModuleResolver(compilerHost: ts.CompilerHost): (moduleNames: string[], containingFile: string) => ts.ResolvedModule[];
1 change: 1 addition & 0 deletions build/definitions/mkdirp.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export default function mkdirP(p: string): void;
16 changes: 16 additions & 0 deletions build/definitions/module.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import * as ts from 'typescript';
import * as base from './base';
import { FacadeConverter } from './facade_converter';
import { Transpiler } from './main';
export default class ModuleTranspiler extends base.TranspilerBase {
private fc;
private generateLibraryName;
constructor(tr: Transpiler, fc: FacadeConverter, generateLibraryName: boolean);
visitNode(node: ts.Node): boolean;
private static isIgnoredImport(e);
private visitExternalModuleReferenceExpr(expr);
private isEmptyImport(n);
private filterImports(ns);
private static DART_RESERVED_WORDS;
getLibraryName(fileName: string): string;
}
7 changes: 7 additions & 0 deletions build/definitions/statement.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import * as ts from 'typescript';
import * as base from './base';
import { Transpiler } from './main';
export default class StatementTranspiler extends base.TranspilerBase {
constructor(tr: Transpiler);
visitNode(node: ts.Node): boolean;
}
10 changes: 10 additions & 0 deletions build/definitions/type.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import * as ts from 'typescript';
import * as base from './base';
import { FacadeConverter } from './facade_converter';
import { Transpiler } from './main';
export default class TypeTranspiler extends base.TranspilerBase {
private fc;
constructor(tr: Transpiler, fc: FacadeConverter);
visitNode(node: ts.Node): boolean;
isReifiedTypeLiteral(node: ts.TypeAssertion): boolean;
}
Loading