diff --git a/gulpfile.js b/gulpfile.js index 6e211023..72c74651 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -39,7 +39,10 @@ gulp.task('tsc', function () { // Build all TypeScript files (including tests) to ${outDir}/, based on the configuration defined in // `tsconfig.json`. let tsResult = tsProject.src().pipe(sourcemaps.init()).pipe(tsProject()); - let tsc = tsResult.js.pipe(sourcemaps.write('.', {includeContent: false, sourceRoot: ''})).pipe(gulp.dest(outDir)); + let tsc = merge( + tsResult.js.pipe(sourcemaps.write('.', {includeContent: false, sourceRoot: ''})).pipe(gulp.dest(outDir)), + tsResult.dts.pipe(sourcemaps.write('.', {includeContent: false, sourceRoot: ''})).pipe(gulp.dest(outDir)) + ); fs.emptyDirSync(`${outDir}/addons/search`); let tsResultSearchAddon = tsProjectSearchAddon.src().pipe(sourcemaps.init()).pipe(tsProjectSearchAddon()); diff --git a/package.json b/package.json index d0ba5c01..a5f0bd75 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "test", ".gitignore" ], - "main": "lib/xterm.js", + "main": "lib/Terminal.js", + "types": "lib/Terminal.d.ts", "repository": "https://github.com/sourcelair/xterm.js", "license": "MIT", "files": [ @@ -21,8 +22,10 @@ "dist/**/*.js.map", "lib/*.css", "lib/**/*.css", + "lib/*.d.ts", "lib/*.js", "lib/*.js.map", + "lib/**/*.d.ts", "lib/**/*.js", "lib/**/*.js.map", "src/*.css", diff --git a/src/Parser.ts b/src/Parser.ts index 90d413a7..3f05992b 100644 --- a/src/Parser.ts +++ b/src/Parser.ts @@ -148,7 +148,7 @@ csiStateHandler['s'] = (handler, params) => handler.saveCursor(params); csiStateHandler['u'] = (handler, params) => handler.restoreCursor(params); csiStateHandler[C0.CAN] = (handler, params, prefix, postfix, parser) => parser.setState(ParserState.NORMAL); -enum ParserState { +export enum ParserState { NORMAL = 0, ESCAPED = 1, CSI_PARAM = 2, diff --git a/tsconfig.json b/tsconfig.json index 2e9703dd..a3aa790c 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,10 +3,10 @@ "module": "commonjs", "target": "es5", "rootDir": "src", - "allowJs": true, "outDir": "lib", "sourceMap": true, - "removeComments": true + "removeComments": true, + "declaration": true }, "include": [ "src/**/*" diff --git a/typings.json b/typings.json deleted file mode 100644 index 8210c007..00000000 --- a/typings.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "xterm", - "globalDependencies": { - "node": "registry:env/node#6.0.0+20160918225031" - } -}