Compare commits
60 Commits
Author | SHA1 | Date | |
---|---|---|---|
|
93dc1fa0ac | ||
|
7134401f57 | ||
|
ece8c23d11 | ||
|
26fbd15f84 | ||
|
75db29c275 | ||
|
ed511323bd | ||
|
6ddb7f5976 | ||
|
e748236080 | ||
|
627bc176e7 | ||
|
c868c8793f | ||
|
e5813bb8d4 | ||
|
e073d9511e | ||
|
804dc54e7d | ||
|
4abbe28147 | ||
|
4f1ef9bfad | ||
|
367912bec1 | ||
|
f20a2f0f4a | ||
|
8dbc6ca926 | ||
|
32acc38a03 | ||
|
ea11d50d80 | ||
|
8a9234f6d0 | ||
|
67882ccd33 | ||
|
4f5e9f08b5 | ||
|
0214ebe45a | ||
|
8ed8989763 | ||
|
26b162dcd5 | ||
|
2fd8687d9e | ||
|
9ebc317931 | ||
|
d8b4300a9b | ||
|
730382da98 | ||
|
7dfd1785fd | ||
|
64fe672217 | ||
|
3ce9bc9306 | ||
|
8f705318d9 | ||
|
0867cc2788 | ||
|
603a5ff444 | ||
|
178f68cc8b | ||
|
fa87b1ca1d | ||
|
bd2db00025 | ||
|
a37aea85b5 | ||
|
eb1cc7b5e6 | ||
|
6dfaec86da | ||
|
20e7861f5a | ||
|
22ccb660ae | ||
|
778c095433 | ||
|
dae66a61b4 | ||
|
bceefa9096 | ||
|
2e9f102d8e | ||
|
6c8a2958e5 | ||
|
cbb9cf58b1 | ||
|
86a3596557 | ||
|
6f4e366099 | ||
|
36d8c8cf44 | ||
|
d660c7c15d | ||
|
721a97ff46 | ||
|
155fa12831 | ||
|
bb1b6c6499 | ||
|
b135fa4066 | ||
|
a055feeb7e | ||
|
8cf09612cb |
2
.gitignore
vendored
2
.gitignore
vendored
@@ -15,4 +15,4 @@
|
||||
/node_modules/
|
||||
/typescript/
|
||||
/coverage/
|
||||
/lib/
|
||||
/dist/
|
||||
|
@@ -1,4 +1,5 @@
|
||||
sudo: false
|
||||
language: node_js
|
||||
node_js:
|
||||
- "0.10"
|
||||
- 6
|
||||
- 4
|
||||
|
23
.vscode/launch.json
vendored
Normal file
23
.vscode/launch.json
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible Node.js debug attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
{
|
||||
"type": "node",
|
||||
"request": "launch",
|
||||
"name": "Launch Program",
|
||||
"program": "${workspaceRoot}/node_modules/mocha/bin/_mocha",
|
||||
"cwd": "${workspaceRoot}",
|
||||
"args": [
|
||||
"--no-timeouts"
|
||||
],
|
||||
"outFiles": [
|
||||
"${workspaceRoot}/lib/**/*.js",
|
||||
"${workspaceRoot}/test/**/*.js"
|
||||
],
|
||||
"sourceMaps": true
|
||||
}
|
||||
]
|
||||
}
|
3
.vscode/settings.json
vendored
Normal file
3
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"typescript.tsdk": "./node_modules/typescript/lib"
|
||||
}
|
11
.vscode/tasks.json
vendored
Normal file
11
.vscode/tasks.json
vendored
Normal file
@@ -0,0 +1,11 @@
|
||||
{
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||
// for the documentation about the tasks.json format
|
||||
"version": "0.1.0",
|
||||
"command": "tsc",
|
||||
"isShellCommand": true,
|
||||
"args": ["-w", "-p", "."],
|
||||
"showOutput": "silent",
|
||||
"isWatching": true,
|
||||
"problemMatcher": "$tsc-watch"
|
||||
}
|
32
README.md
32
README.md
@@ -2,8 +2,9 @@
|
||||
|
||||
> Documentation generator for TypeScript projects.
|
||||
|
||||
[](https://travis-ci.org/TypeStrong/typedoc) [](http://badge.fury.io/js/typedoc)
|
||||
|
||||
[](https://travis-ci.org/TypeStrong/typedoc)
|
||||
[](http://badge.fury.io/js/typedoc)
|
||||
[](https://gitter.im/TypeStrong/typedoc?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
|
||||
|
||||
## Installation
|
||||
|
||||
@@ -22,18 +23,6 @@ $ npm install typedoc --global
|
||||
$ typedoc
|
||||
```
|
||||
|
||||
|
||||
## Preview
|
||||
|
||||
If you want to know what a documentation created with TypeDoc looks like, head over
|
||||
to the homepage of the project. We've setup examples demonstrating the two default
|
||||
themes shipped with the package:
|
||||
|
||||
[http://typedoc.io/themes/default](http://typedoc.io/themes/default)<br>
|
||||
[http://typedoc.io/themes/minimal](http://typedoc.io/themes/minimal)
|
||||
|
||||
The default themes can be found here: [https://github.com/TypeStrong/typedoc-default-themes](https://github.com/TypeStrong/typedoc-default-themes)
|
||||
|
||||
## Usage
|
||||
|
||||
### Shell
|
||||
@@ -71,6 +60,9 @@ in order to change the behaviour of TypeDoc.
|
||||
Define a pattern for files that should be considered being external.
|
||||
* `--excludeExternals`<br>
|
||||
Prevent externally resolved TypeScript files from being documented.
|
||||
* `--excludePrivate`<br>
|
||||
Prevent private members from being included in the generated documentation.
|
||||
|
||||
|
||||
#### TypeScript compiler
|
||||
* `--module <commonjs, amd, system or umd>`<br>
|
||||
@@ -110,6 +102,11 @@ in order to change the behaviour of TypeDoc.
|
||||
* `--help`<br>
|
||||
Display a simple cheat sheet.
|
||||
|
||||
### Webpack
|
||||
|
||||
There is a plugin available to run TypeDoc with Webpack created by Microsoft. You can find it on NPM:<br>
|
||||
[https://www.npmjs.com/package/typedoc-webpack-plugin](https://www.npmjs.com/package/typedoc-webpack-plugin)
|
||||
|
||||
|
||||
### Gulp
|
||||
|
||||
@@ -122,11 +119,14 @@ There is a plugin available to run TypeDoc with Gulp created by Rogier Schouten.
|
||||
There is a plugin available to run TypeDoc with Grunt created by Bart van der Schoor. You can find it on NPM:<br>
|
||||
[https://www.npmjs.org/package/grunt-typedoc](https://www.npmjs.org/package/grunt-typedoc)
|
||||
|
||||
## Plugins
|
||||
|
||||
* [External Module Name](https://github.com/christopherthielen/typedoc-plugin-external-module-name) - Set the name of TypeDoc external modules
|
||||
|
||||
## Advanced guides and docs
|
||||
|
||||
Visit our homepage for advanced guides and an extensive API documentation:<br>
|
||||
[http://typedoc.io](http://typedoc.io)
|
||||
[http://typedoc.org](http://typedoc.org)
|
||||
|
||||
|
||||
## Contributing
|
||||
@@ -138,5 +138,5 @@ an issue or create a pull requests:<br>
|
||||
|
||||
## License
|
||||
|
||||
Copyright (c) 2015 [Sebastian Lenz](http://www.TypeDoc.de).<br>
|
||||
Copyright (c) 2015 [Sebastian Lenz](http://typedoc.org).<br>
|
||||
Licensed under the Apache License 2.0.
|
||||
|
@@ -1,4 +1,4 @@
|
||||
#!/usr/bin/env node
|
||||
|
||||
var td = require('../lib/cli.js');
|
||||
var td = require('../dist/lib/cli.js');
|
||||
new td.CliApplication();
|
||||
|
@@ -1,3 +1,3 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*}
|
||||
node ../../bin/typedoc --module commonjs --includes inc/ --media media/ --target ES5 --noLib --out doc/ src/
|
||||
node ../../bin/typedoc --module commonjs --includes inc/ --media media/ --target ES5 --out doc/ src/
|
||||
|
3840
examples/basic/src/lib.core.d.ts
vendored
3840
examples/basic/src/lib.core.d.ts
vendored
File diff suppressed because it is too large
Load Diff
10
gruntfile.js
10
gruntfile.js
@@ -4,7 +4,7 @@ module.exports = function(grunt)
|
||||
pkg: grunt.file.readJSON('package.json'),
|
||||
ts: {
|
||||
typedoc: {
|
||||
tsconfig: true
|
||||
tsconfig: { passThrough: true }
|
||||
},
|
||||
typescript: {
|
||||
options: {
|
||||
@@ -70,7 +70,8 @@ module.exports = function(grunt)
|
||||
coverage: {
|
||||
src: 'test',
|
||||
options: {
|
||||
mask: '*.js'
|
||||
mask: '*.js',
|
||||
timeout: 4000
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -90,14 +91,13 @@ module.exports = function(grunt)
|
||||
grunt.registerTask('build-specs', function() {
|
||||
var FS = require('fs-extra');
|
||||
var Path = require('path');
|
||||
var TypeDoc = require('./index.js');
|
||||
var TypeDoc = require('./');
|
||||
|
||||
var base = Path.join(__dirname, 'test', 'converter');
|
||||
var app = new TypeDoc.Application({
|
||||
mode: 'Modules',
|
||||
target: 'ES5',
|
||||
module: 'CommonJS',
|
||||
noLib: true,
|
||||
experimentalDecorators: true,
|
||||
jsx: 'react'
|
||||
});
|
||||
@@ -147,4 +147,4 @@ module.exports = function(grunt)
|
||||
FS.writeFileSync(file, FS.readFileSync(file, {encoding:'utf-8'}).replace(gitHubRegExp, 'https://github.com/sebastian-lenz/typedoc/blob/master/examples'));
|
||||
});
|
||||
});
|
||||
};
|
||||
};
|
||||
|
14
index.js
14
index.js
@@ -1,14 +0,0 @@
|
||||
"use strict";
|
||||
var application_1 = require("./lib/application");
|
||||
exports.Application = application_1.Application;
|
||||
var cli_1 = require("./lib/cli");
|
||||
exports.CliApplication = cli_1.CliApplication;
|
||||
var events_1 = require("./lib/utils/events");
|
||||
exports.EventDispatcher = events_1.EventDispatcher;
|
||||
exports.Event = events_1.Event;
|
||||
var abstract_1 = require("./lib/models/reflections/abstract");
|
||||
exports.resetReflectionID = abstract_1.resetReflectionID;
|
||||
var fs_1 = require("./lib/utils/fs");
|
||||
exports.normalizePath = fs_1.normalizePath;
|
||||
var project_1 = require("./lib/models/reflections/project");
|
||||
exports.ProjectReflection = project_1.ProjectReflection;
|
31
package.json
31
package.json
@@ -1,12 +1,13 @@
|
||||
{
|
||||
"name": "typedoc",
|
||||
"description": "Create api documentations for typescript projects.",
|
||||
"version": "0.4.3",
|
||||
"homepage": "http://typedoc.io",
|
||||
"version": "0.5.7",
|
||||
"homepage": "http://typedoc.org",
|
||||
"main": "dist/index.js",
|
||||
"typings": "dist/index.d.ts",
|
||||
"bin": {
|
||||
"typedoc": "bin/typedoc"
|
||||
},
|
||||
"main": "bin/typedoc.js",
|
||||
"author": {
|
||||
"name": "Sebastian Lenz",
|
||||
"url": "http://www.sebastian-lenz.de/"
|
||||
@@ -26,10 +27,17 @@
|
||||
}
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
"node": ">= 4"
|
||||
},
|
||||
"dependencies": {
|
||||
"fs-extra": "^0.30.0",
|
||||
"@types/fs-extra": "0.0.33",
|
||||
"@types/handlebars": "^4.0.31",
|
||||
"@types/highlight.js": "^9.1.8",
|
||||
"@types/lodash": "^4.14.37",
|
||||
"@types/marked": "0.0.28",
|
||||
"@types/minimatch": "^2.0.29",
|
||||
"@types/shelljs": "^0.3.32",
|
||||
"fs-extra": "^2.0.0",
|
||||
"handlebars": "4.0.5",
|
||||
"highlight.js": "^9.0.0",
|
||||
"lodash": "^4.13.1",
|
||||
@@ -37,8 +45,8 @@
|
||||
"minimatch": "^3.0.0",
|
||||
"progress": "^1.1.8",
|
||||
"shelljs": "^0.7.0",
|
||||
"typedoc-default-themes": "^0.4.0",
|
||||
"typescript": "1.8.10"
|
||||
"typedoc-default-themes": "^0.4.2",
|
||||
"typescript": "2.1.6"
|
||||
},
|
||||
"devDependencies": {
|
||||
"grunt": "^1.0.1",
|
||||
@@ -47,19 +55,18 @@
|
||||
"grunt-contrib-watch": "^1.0.0",
|
||||
"grunt-mocha-istanbul": "^5.0.1",
|
||||
"grunt-string-replace": "^1.2.0",
|
||||
"grunt-ts": "^5.3.0-beta.2",
|
||||
"grunt-ts": "^5.5.1",
|
||||
"istanbul": "^0.4.1",
|
||||
"mocha": "^2.3.4"
|
||||
"mocha": "^3.0.2"
|
||||
},
|
||||
"files": [
|
||||
"bin",
|
||||
"lib",
|
||||
"dist",
|
||||
"tasks",
|
||||
"index.js",
|
||||
"LICENSE"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "mocha",
|
||||
"test": "mocha -t 4000",
|
||||
"build": "grunt build_and_test",
|
||||
"prepublish": "npm run build"
|
||||
},
|
||||
|
@@ -272,7 +272,7 @@ export class Application extends ChildableComponent<Application, AbstractCompone
|
||||
file = Path.resolve(file);
|
||||
if (FS.statSync(file).isDirectory()) {
|
||||
add(file);
|
||||
} else {
|
||||
} else if (!exclude || !exclude.match(file)) {
|
||||
files.push(file);
|
||||
}
|
||||
});
|
||||
|
@@ -55,7 +55,7 @@ export class Context
|
||||
/**
|
||||
* The currently set type parameters.
|
||||
*/
|
||||
typeParameters:ts.Map<Type>;
|
||||
typeParameters:ts.MapLike<Type>;
|
||||
|
||||
/**
|
||||
* The currently set type arguments.
|
||||
@@ -138,17 +138,21 @@ export class Context
|
||||
* @returns The type declaration of the given node.
|
||||
*/
|
||||
getTypeAtLocation(node:ts.Node):ts.Type {
|
||||
var nodeType:ts.Type;
|
||||
try {
|
||||
return this.checker.getTypeAtLocation(node);
|
||||
} catch (error) {
|
||||
try {
|
||||
if (node.symbol) {
|
||||
return this.checker.getDeclaredTypeOfSymbol(node.symbol);
|
||||
}
|
||||
} catch (error) {}
|
||||
nodeType = this.checker.getTypeAtLocation(node);
|
||||
} catch (error) {
|
||||
}
|
||||
|
||||
return null;
|
||||
if (!nodeType) {
|
||||
if (node.symbol) {
|
||||
nodeType = this.checker.getDeclaredTypeOfSymbol(node.symbol);
|
||||
} else if (node.parent && node.parent.symbol) {
|
||||
nodeType = this.checker.getDeclaredTypeOfSymbol(node.parent.symbol);
|
||||
} else if (node.parent && node.parent.parent && node.parent.parent.symbol) {
|
||||
nodeType = this.checker.getDeclaredTypeOfSymbol(node.parent.parent.symbol);
|
||||
}
|
||||
}
|
||||
return nodeType;
|
||||
}
|
||||
|
||||
|
||||
@@ -230,7 +234,7 @@ export class Context
|
||||
return;
|
||||
}
|
||||
|
||||
var isDeclaration = ts.isDeclarationFile(node);
|
||||
var isDeclaration = node.isDeclarationFile;
|
||||
if (isDeclaration) {
|
||||
var lib = this.converter.getDefaultLib();
|
||||
var isLib = node.fileName.substr(-lib.length) == lib;
|
||||
@@ -360,8 +364,8 @@ export class Context
|
||||
* @param preserve Should the currently set type parameters of the context be preserved?
|
||||
* @returns The resulting type mapping.
|
||||
*/
|
||||
private extractTypeParameters(parameters:ts.NodeArray<ts.TypeParameterDeclaration>, preserve?:boolean):ts.Map<Type> {
|
||||
var typeParameters:ts.Map<Type> = {};
|
||||
private extractTypeParameters(parameters:ts.NodeArray<ts.TypeParameterDeclaration>, preserve?:boolean):ts.MapLike<Type> {
|
||||
var typeParameters:ts.MapLike<Type> = {};
|
||||
|
||||
if (preserve) {
|
||||
for (var key in this.typeParameters) {
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import * as ts from "typescript";
|
||||
import * as _ts from "../ts-internal";
|
||||
|
||||
|
||||
/**
|
||||
@@ -29,7 +30,7 @@ export function convertExpression(expression:ts.Expression):string
|
||||
case ts.SyntaxKind.FalseKeyword:
|
||||
return 'false';
|
||||
default:
|
||||
var source = ts.getSourceFileOfNode(<ts.Node>expression);
|
||||
var source = _ts.getSourceFileOfNode(<ts.Node>expression);
|
||||
return source.text.substring(expression.pos, expression.end);
|
||||
}
|
||||
}
|
||||
|
@@ -1,5 +1,7 @@
|
||||
import * as ts from "typescript";
|
||||
import * as _ts from "../ts-internal";
|
||||
import * as Path from "path";
|
||||
import * as _ from "lodash";
|
||||
|
||||
import {Application} from "../application";
|
||||
import {ParameterType} from "../utils/options/declaration";
|
||||
@@ -8,6 +10,7 @@ import {Context} from "./context";
|
||||
import {ConverterComponent, ConverterNodeComponent, ConverterTypeComponent, ITypeTypeConverter, ITypeNodeConverter} from "./components";
|
||||
import {CompilerHost} from "./utils/compiler-host";
|
||||
import {Component, Option, ChildableComponent, IComponentClass} from "../utils/component"
|
||||
import {normalizePath} from "../utils/fs";
|
||||
|
||||
|
||||
/**
|
||||
@@ -122,6 +125,13 @@ export class Converter extends ChildableComponent<Application, ConverterComponen
|
||||
})
|
||||
excludeNotExported:boolean;
|
||||
|
||||
@Option({
|
||||
name: "excludePrivate",
|
||||
help: 'Ignores private variables and methods',
|
||||
type: ParameterType.Boolean
|
||||
})
|
||||
excludePrivate:boolean;
|
||||
|
||||
private compilerHost:CompilerHost;
|
||||
|
||||
private nodeConverters:{[syntaxKind:number]:ConverterNodeComponent<ts.Node>};
|
||||
@@ -323,7 +333,7 @@ export class Converter extends ChildableComponent<Application, ConverterComponen
|
||||
*/
|
||||
convert(fileNames:string[]):IConverterResult {
|
||||
for (var i = 0, c = fileNames.length; i < c; i++) {
|
||||
fileNames[i] = ts.normalizePath(ts.normalizeSlashes(fileNames[i]));
|
||||
fileNames[i] = normalizePath(_ts.normalizeSlashes(fileNames[i]));
|
||||
}
|
||||
|
||||
var program = ts.createProgram(fileNames, this.application.options.getCompilerOptions(), this.compilerHost);
|
||||
@@ -415,19 +425,19 @@ export class Converter extends ChildableComponent<Application, ConverterComponen
|
||||
program.getSourceFiles().forEach((sourceFile) => {
|
||||
this.convertNode(context, sourceFile);
|
||||
});
|
||||
|
||||
|
||||
let diagnostics = program.getOptionsDiagnostics();
|
||||
if (diagnostics.length) return diagnostics;
|
||||
|
||||
|
||||
diagnostics = program.getSyntacticDiagnostics();
|
||||
if (diagnostics.length) return diagnostics;
|
||||
|
||||
|
||||
diagnostics = program.getGlobalDiagnostics();
|
||||
if (diagnostics.length) return diagnostics;
|
||||
|
||||
diagnostics = program.getSemanticDiagnostics();
|
||||
if (diagnostics.length) return diagnostics;
|
||||
|
||||
|
||||
return [];
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import * as ts from "typescript";
|
||||
import * as _ts from "../../ts-internal";
|
||||
|
||||
import {Comment, CommentTag} from "../../models/comments/index";
|
||||
|
||||
@@ -86,8 +87,8 @@ export function getRawComment(node:ts.Node):string {
|
||||
}
|
||||
}
|
||||
|
||||
var sourceFile = ts.getSourceFileOfNode(node);
|
||||
var comments = ts.getJsDocComments(node, sourceFile);
|
||||
var sourceFile = _ts.getSourceFileOfNode(node);
|
||||
var comments = _ts.getJSDocCommentRanges(node, sourceFile.text);
|
||||
if (comments && comments.length) {
|
||||
var comment:ts.CommentRange;
|
||||
if (node.kind == ts.SyntaxKind.SourceFile) {
|
||||
|
@@ -43,6 +43,8 @@ export function createDeclaration(context:Context, node:ts.Node, kind:Reflection
|
||||
}
|
||||
}
|
||||
|
||||
var modifiers = ts.getCombinedModifierFlags(node);
|
||||
|
||||
// Test whether the node is exported
|
||||
var isExported:boolean;
|
||||
if (container.kindOf([ReflectionKind.Module, ReflectionKind.ExternalModule])) {
|
||||
@@ -54,9 +56,10 @@ export function createDeclaration(context:Context, node:ts.Node, kind:Reflection
|
||||
if (kind == ReflectionKind.ExternalModule) {
|
||||
isExported = true; // Always mark external modules as exported
|
||||
} else if (node.parent && node.parent.kind == ts.SyntaxKind.VariableDeclarationList) {
|
||||
isExported = isExported || !!(node.parent.parent.flags & ts.NodeFlags.Export)
|
||||
var parentModifiers = ts.getCombinedModifierFlags(node.parent.parent);
|
||||
isExported = isExported || !!(parentModifiers & ts.ModifierFlags.Export)
|
||||
} else {
|
||||
isExported = isExported || !!(node.flags & ts.NodeFlags.Export);
|
||||
isExported = isExported || !!(modifiers & ts.ModifierFlags.Export);
|
||||
}
|
||||
|
||||
if (!isExported && context.converter.excludeNotExported) {
|
||||
@@ -64,7 +67,7 @@ export function createDeclaration(context:Context, node:ts.Node, kind:Reflection
|
||||
}
|
||||
|
||||
// Test whether the node is private, when inheriting ignore private members
|
||||
var isPrivate = !!(node.flags & ts.NodeFlags.Private);
|
||||
var isPrivate = !!(modifiers & ts.ModifierFlags.Private);
|
||||
if (context.isInherit && isPrivate) {
|
||||
return null;
|
||||
}
|
||||
@@ -73,7 +76,7 @@ export function createDeclaration(context:Context, node:ts.Node, kind:Reflection
|
||||
var isConstructorProperty:boolean = false;
|
||||
var isStatic = false;
|
||||
if (nonStaticKinds.indexOf(kind) == -1) {
|
||||
isStatic = !!(node.flags & ts.NodeFlags.Static);
|
||||
isStatic = !!(modifiers & ts.ModifierFlags.Static);
|
||||
if (container.kind == ReflectionKind.Class) {
|
||||
if (node.parent && node.parent.kind == ts.SyntaxKind.Constructor) {
|
||||
isConstructorProperty = true;
|
||||
@@ -126,9 +129,11 @@ export function createDeclaration(context:Context, node:ts.Node, kind:Reflection
|
||||
* @returns The reflection populated with the values of the given node.
|
||||
*/
|
||||
function setupDeclaration(context:Context, reflection:DeclarationReflection, node:ts.Node) {
|
||||
var modifiers = ts.getCombinedModifierFlags(node);
|
||||
|
||||
reflection.setFlag(ReflectionFlag.External, context.isExternal);
|
||||
reflection.setFlag(ReflectionFlag.Protected, !!(node.flags & ts.NodeFlags.Protected));
|
||||
reflection.setFlag(ReflectionFlag.Public, !!(node.flags & ts.NodeFlags.Public));
|
||||
reflection.setFlag(ReflectionFlag.Protected, !!(modifiers & ts.ModifierFlags.Protected));
|
||||
reflection.setFlag(ReflectionFlag.Public, !!(modifiers & ts.ModifierFlags.Public));
|
||||
reflection.setFlag(ReflectionFlag.Optional, !!(node['questionToken']));
|
||||
|
||||
if (
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import * as ts from "typescript";
|
||||
import * as _ts from "../../ts-internal";
|
||||
|
||||
import {ReflectionFlag, ReflectionKind, ParameterReflection, SignatureReflection} from "../../models/reflections/index";
|
||||
import {Context} from "../context";
|
||||
@@ -22,7 +23,7 @@ export function createParameter(context:Context, node:ts.ParameterDeclaration):P
|
||||
var parameter = new ParameterReflection(signature, node.symbol.name, ReflectionKind.Parameter);
|
||||
context.registerReflection(parameter, node);
|
||||
context.withScope(parameter, () => {
|
||||
if (ts.isBindingPattern(node.name)) {
|
||||
if (_ts.isBindingPattern(node.name)) {
|
||||
parameter.type = context.converter.convertType(context, node.name);
|
||||
parameter.name = '__namedParameters'
|
||||
} else {
|
||||
|
@@ -1,11 +1,11 @@
|
||||
import * as ts from "typescript";
|
||||
import * as _ts from "../../ts-internal";
|
||||
|
||||
import {Reflection, ReflectionKind, DeclarationReflection} from "../../models/index";
|
||||
import {createDeclaration} from "../factories/index";
|
||||
import {Context} from "../context";
|
||||
import {Component, ConverterNodeComponent} from "../components";
|
||||
|
||||
|
||||
@Component({name:'node:class'})
|
||||
export class ClassConverter extends ConverterNodeComponent<ts.ClassDeclaration>
|
||||
{
|
||||
@@ -36,11 +36,17 @@ export class ClassConverter extends ConverterNodeComponent<ts.ClassDeclaration>
|
||||
context.withScope(reflection, node.typeParameters, () => {
|
||||
if (node.members) {
|
||||
node.members.forEach((member) => {
|
||||
this.owner.convertNode(context, member);
|
||||
const modifiers = ts.getCombinedModifierFlags(member);
|
||||
const privateMember = (modifiers & ts.ModifierFlags.Private) > 0;
|
||||
const exclude = context.converter.excludePrivate ? privateMember : false;
|
||||
|
||||
if (!exclude) {
|
||||
this.owner.convertNode(context, member);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
var baseType = ts.getClassExtendsHeritageClauseElement(node);
|
||||
var baseType = _ts.getClassExtendsHeritageClauseElement(node);
|
||||
if (baseType) {
|
||||
var type = context.getTypeAtLocation(baseType);
|
||||
if (!context.isInherit) {
|
||||
@@ -55,7 +61,7 @@ export class ClassConverter extends ConverterNodeComponent<ts.ClassDeclaration>
|
||||
}
|
||||
}
|
||||
|
||||
var implementedTypes = ts.getClassImplementsHeritageClauseElements(node);
|
||||
var implementedTypes = _ts.getClassImplementsHeritageClauseElements(node);
|
||||
if (implementedTypes) {
|
||||
implementedTypes.forEach((implementedType) => {
|
||||
if (!reflection.implementedTypes) {
|
||||
|
@@ -62,9 +62,13 @@ export class ConstructorConverter extends ConverterNodeComponent<ts.ConstructorD
|
||||
* @return The resulting reflection or NULL.
|
||||
*/
|
||||
private addParameterProperty(context:Context, parameter:ts.ParameterDeclaration, comment:Comment) {
|
||||
var visibility = parameter.flags & (ts.NodeFlags.Public | ts.NodeFlags.Protected | ts.NodeFlags.Private);
|
||||
var modifiers = ts.getCombinedModifierFlags(parameter);
|
||||
var visibility = modifiers & (ts.ModifierFlags.Public | ts.ModifierFlags.Protected | ts.ModifierFlags.Private);
|
||||
if (!visibility) return;
|
||||
|
||||
const privateParameter = modifiers & ts.ModifierFlags.Private;
|
||||
if (privateParameter && context.converter.excludePrivate) return;
|
||||
|
||||
var property = createDeclaration(context, parameter, ReflectionKind.Property);
|
||||
if (!property) return;
|
||||
|
||||
|
@@ -15,22 +15,25 @@ export class ExportConverter extends ConverterNodeComponent<ts.ExportAssignment>
|
||||
ts.SyntaxKind.ExportAssignment
|
||||
];
|
||||
|
||||
|
||||
convert(context:Context, node:ts.ExportAssignment):Reflection {
|
||||
if (!node.isExportEquals) {
|
||||
return context.scope;
|
||||
}
|
||||
let symbol: ts.Symbol = undefined;
|
||||
|
||||
var type = context.getTypeAtLocation(node.expression);
|
||||
if (type && type.symbol) {
|
||||
// default export
|
||||
if (node.symbol && (node.symbol.flags & ts.SymbolFlags.Alias) === ts.SymbolFlags.Alias) {
|
||||
symbol = context.checker.getAliasedSymbol(node.symbol);
|
||||
} else {
|
||||
let type = context.getTypeAtLocation(node.expression);
|
||||
symbol = type ? type.symbol : undefined;
|
||||
}
|
||||
if (symbol) {
|
||||
var project = context.project;
|
||||
type.symbol.declarations.forEach((declaration) => {
|
||||
symbol.declarations.forEach((declaration) => {
|
||||
if (!declaration.symbol) return;
|
||||
var id = project.symbolMapping[context.getSymbolID(declaration.symbol)];
|
||||
if (!id) return;
|
||||
|
||||
var reflection = project.reflections[id];
|
||||
if (reflection instanceof DeclarationReflection) {
|
||||
if (node.isExportEquals && reflection instanceof DeclarationReflection) {
|
||||
(<DeclarationReflection>reflection).setFlag(ReflectionFlag.ExportAssignment, true);
|
||||
}
|
||||
markAsExported(reflection);
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import * as ts from "typescript";
|
||||
import * as _ts from "../../ts-internal";
|
||||
|
||||
import {Reflection, ReflectionKind, DeclarationReflection} from "../../models/index";
|
||||
import {createDeclaration} from "../factories/index";
|
||||
@@ -39,7 +40,7 @@ export class InterfaceConverter extends ConverterNodeComponent<ts.InterfaceDecla
|
||||
});
|
||||
}
|
||||
|
||||
var baseTypes = ts.getInterfaceBaseTypeNodes(node);
|
||||
var baseTypes = _ts.getInterfaceBaseTypeNodes(node);
|
||||
if (baseTypes) {
|
||||
baseTypes.forEach((baseType) => {
|
||||
var type = context.getTypeAtLocation(baseType);
|
||||
|
@@ -31,7 +31,7 @@ export class ModuleConverter extends ConverterNodeComponent<ts.ModuleDeclaration
|
||||
context.withScope(reflection, () => {
|
||||
var opt = context.getCompilerOptions();
|
||||
if (parent instanceof ProjectReflection && !context.isDeclaration &&
|
||||
(!opt.module || opt.module == ts.ModuleKind.None)) {
|
||||
(!module || module.valueOf() === ts.ModuleKind.None.valueOf())) {
|
||||
reflection.setFlag(ReflectionFlag.Exported);
|
||||
}
|
||||
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import * as ts from "typescript";
|
||||
import * as _ts from "../../ts-internal";
|
||||
|
||||
import {Reflection, ReflectionKind} from "../../models/index";
|
||||
import {Context} from "../context";
|
||||
@@ -26,7 +27,7 @@ export class VariableStatementConverter extends ConverterNodeComponent<ts.Variab
|
||||
convert(context:Context, node:ts.VariableStatement):Reflection {
|
||||
if (node.declarationList && node.declarationList.declarations) {
|
||||
node.declarationList.declarations.forEach((variableDeclaration) => {
|
||||
if (ts.isBindingPattern(variableDeclaration.name)) {
|
||||
if (_ts.isBindingPattern(variableDeclaration.name)) {
|
||||
this.convertBindingPattern(context, <ts.BindingPattern>variableDeclaration.name);
|
||||
} else {
|
||||
this.owner.convertNode(context, variableDeclaration);
|
||||
@@ -45,10 +46,10 @@ export class VariableStatementConverter extends ConverterNodeComponent<ts.Variab
|
||||
* @param node The binding pattern node that should be analyzed.
|
||||
*/
|
||||
convertBindingPattern(context:Context, node:ts.BindingPattern) {
|
||||
node.elements.forEach((element:ts.BindingElement) => {
|
||||
this.owner.convertNode(context, <any>element);
|
||||
(node.elements as ts.BindingElement[]).forEach((element:ts.BindingElement) => {
|
||||
this.owner.convertNode(context, element);
|
||||
|
||||
if (ts.isBindingPattern(element.name)) {
|
||||
if (_ts.isBindingPattern(element.name)) {
|
||||
this.convertBindingPattern(context, <ts.BindingPattern>element.name);
|
||||
}
|
||||
});
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import * as ts from "typescript";
|
||||
import * as _ts from "../../ts-internal";
|
||||
|
||||
import {Reflection, ReflectionKind, IntrinsicType} from "../../models/index";
|
||||
import {createDeclaration, createComment} from "../factories/index";
|
||||
@@ -50,9 +51,9 @@ export class VariableConverter extends ConverterNodeComponent<ts.VariableDeclara
|
||||
}
|
||||
|
||||
var name:string, isBindingPattern:boolean;
|
||||
if (ts.isBindingPattern(node.name)) {
|
||||
if (_ts.isBindingPattern(node.name)) {
|
||||
if (node['propertyName']) {
|
||||
name = ts.declarationNameToString(node['propertyName']);
|
||||
name = _ts.declarationNameToString(node['propertyName']);
|
||||
isBindingPattern = true;
|
||||
} else {
|
||||
return null;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import * as ts from "typescript";
|
||||
import * as _ts from "../../ts-internal";
|
||||
|
||||
import {ReferenceType} from "../../models/types/index";
|
||||
import {Reflection, IDecorator} from "../../models/reflections/index";
|
||||
@@ -23,6 +24,7 @@ export class DecoratorPlugin extends ConverterComponent
|
||||
this.listenTo(this.owner, {
|
||||
[Converter.EVENT_BEGIN]: this.onBegin,
|
||||
[Converter.EVENT_CREATE_DECLARATION]: this.onDeclaration,
|
||||
[Converter.EVENT_CREATE_PARAMETER]: this.onDeclaration,
|
||||
[Converter.EVENT_RESOLVE]: this.onBeginResolve,
|
||||
});
|
||||
}
|
||||
@@ -40,10 +42,10 @@ export class DecoratorPlugin extends ConverterComponent
|
||||
args.forEach((arg:ts.Expression, index:number) => {
|
||||
if (index < signature.parameters.length) {
|
||||
var parameter = signature.parameters[index];
|
||||
result[parameter.name] = ts.getTextOfNode(arg);
|
||||
result[parameter.name] = _ts.getTextOfNode(arg);
|
||||
} else {
|
||||
if (!result['...']) result['...'] = [];
|
||||
result['...'].push(ts.getTextOfNode(arg));
|
||||
result['...'].push(_ts.getTextOfNode(arg));
|
||||
}
|
||||
});
|
||||
|
||||
@@ -87,7 +89,7 @@ export class DecoratorPlugin extends ConverterComponent
|
||||
}
|
||||
|
||||
var info:IDecorator = {
|
||||
name: ts.getTextOfNode(identifier)
|
||||
name: _ts.getTextOfNode(identifier)
|
||||
};
|
||||
|
||||
var type = context.checker.getTypeAtLocation(identifier);
|
||||
|
@@ -7,6 +7,16 @@ import {BasePath} from "../utils/base-path";
|
||||
import {Converter} from "../converter";
|
||||
import {Context} from "../context";
|
||||
|
||||
// This should be removed when @typings/shelljs typings are updated to the shelljs version being used
|
||||
declare module "shelljs" {
|
||||
// `stdout` was added in:
|
||||
// https://github.com/shelljs/shelljs/commit/8a7f7ceec4d3a77a9309d935755675ac368b1eda#diff-c3bfabb5e6987aa21bc75ffd95a162d6
|
||||
// As of 2016-10-16, DefinitelyTyped's defs are for shelljs v0.3.0, but we're on 0.7.0
|
||||
interface ExecOutputReturnValue {
|
||||
stdout: string;
|
||||
stderr: string;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Stores data of a repository.
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import * as Path from "path";
|
||||
import * as ts from "typescript";
|
||||
import * as _ts from "../../ts-internal";
|
||||
|
||||
import {Reflection, ProjectReflection, DeclarationReflection} from "../../models/reflections/index";
|
||||
import {SourceDirectory, SourceFile} from "../../models/sources/index";
|
||||
@@ -92,7 +93,7 @@ export class SourcePlugin extends ConverterComponent
|
||||
*/
|
||||
private onDeclaration(context:Context, reflection:Reflection, node?:ts.Node) {
|
||||
if (!node) return;
|
||||
var sourceFile = ts.getSourceFileOfNode(node);
|
||||
var sourceFile = _ts.getSourceFileOfNode(node);
|
||||
var fileName = sourceFile.fileName;
|
||||
var file:SourceFile = this.getSourceFile(fileName, context.project);
|
||||
|
||||
@@ -162,7 +163,7 @@ export class SourcePlugin extends ConverterComponent
|
||||
var path = Path.dirname(file.fileName);
|
||||
if (path != '.') {
|
||||
path.split('/').forEach((path) => {
|
||||
if (!directory.directories[path]) {
|
||||
if (!Object.prototype.hasOwnProperty.call(directory, path)) {
|
||||
directory.directories[path] = new SourceDirectory(path, directory);
|
||||
}
|
||||
directory = directory.directories[path];
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import * as ts from "typescript";
|
||||
import * as _ts from "../../ts-internal";
|
||||
|
||||
import {ReferenceType} from "../../models/index";
|
||||
import {Component, ConverterTypeComponent, ITypeNodeConverter} from "../components";
|
||||
@@ -37,7 +38,7 @@ export class AliasConverter extends ConverterTypeComponent implements ITypeNodeC
|
||||
if (!symbolName.length) return false;
|
||||
if (symbolName[0].substr(0, 1) == '"') symbolName.shift();
|
||||
|
||||
var nodeName = ts.getTextOfNode(node.typeName).split('.');
|
||||
var nodeName = _ts.getTextOfNode(node.typeName).split('.');
|
||||
if (!nodeName.length) return false;
|
||||
|
||||
var common = Math.min(symbolName.length, nodeName.length);
|
||||
@@ -65,7 +66,7 @@ export class AliasConverter extends ConverterTypeComponent implements ITypeNodeC
|
||||
* @returns A type reference pointing to the type alias definition.
|
||||
*/
|
||||
convertNode(context:Context, node:ts.TypeReferenceNode):ReferenceType {
|
||||
var name = ts.getTextOfNode(node.typeName);
|
||||
var name = _ts.getTextOfNode(node.typeName);
|
||||
return new ReferenceType(name, ReferenceType.SYMBOL_ID_RESOLVE_BY_NAME);
|
||||
}
|
||||
}
|
||||
|
@@ -26,7 +26,7 @@ export class BindingArrayConverter extends ConverterTypeComponent implements ITy
|
||||
convertNode(context:Context, node:ts.BindingPattern):Type {
|
||||
var types:Type[] = [];
|
||||
|
||||
node.elements.forEach((element) => {
|
||||
(node.elements as ts.BindingElement[]).forEach((element) => {
|
||||
types.push(this.owner.convertType(context, element));
|
||||
});
|
||||
|
||||
|
@@ -33,7 +33,7 @@ export class BindingObjectConverter extends ConverterTypeComponent implements IT
|
||||
context.registerReflection(declaration, null);
|
||||
context.trigger(Converter.EVENT_CREATE_DECLARATION, declaration, node);
|
||||
context.withScope(declaration, () => {
|
||||
node.elements.forEach((element) => {
|
||||
(node.elements as ts.BindingElement[]).forEach((element) => {
|
||||
this.owner.convertNode(context, element);
|
||||
});
|
||||
});
|
||||
|
@@ -4,15 +4,22 @@ import {Type, IntrinsicType} from "../../models/index";
|
||||
import {Component, ConverterTypeComponent, ITypeTypeConverter} from "../components";
|
||||
import {Context} from "../context";
|
||||
|
||||
// TypeScript has an @internal enum set for the intrinsic types:
|
||||
// https://github.com/Microsoft/TypeScript/blob/v2.0.5/src/compiler/types.ts#L2297-L2298
|
||||
// It is not included in the typescript typings, so the enum is cast as `any` to access the `Intrinsic` set.
|
||||
const IntrinsicTypeFlags = (ts.TypeFlags as any).Intrinsic;
|
||||
if (IntrinsicTypeFlags === undefined) {
|
||||
throw new Error("Internal TypeScript API missing: TypeFlags.Intrinsic");
|
||||
}
|
||||
|
||||
@Component({name:'type:intrinsic'})
|
||||
export class IntrinsicConverter extends ConverterTypeComponent implements ITypeTypeConverter<ts.IntrinsicType>
|
||||
export class IntrinsicConverter extends ConverterTypeComponent implements ITypeTypeConverter<ts.Type>
|
||||
{
|
||||
/**
|
||||
* Test whether this converter can handle the given TypeScript type.
|
||||
*/
|
||||
supportsType(context:Context, type:ts.IntrinsicType):boolean {
|
||||
return !!(type.flags & ts.TypeFlags.Intrinsic);
|
||||
supportsType(context:Context, type:ts.Type):boolean {
|
||||
return !!(type.flags & IntrinsicTypeFlags);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,7 +35,8 @@ export class IntrinsicConverter extends ConverterTypeComponent implements ITypeT
|
||||
* @param type The intrinsic type that should be converted.
|
||||
* @returns The type reflection representing the given intrinsic type.
|
||||
*/
|
||||
convertType(context:Context, type:ts.IntrinsicType):IntrinsicType {
|
||||
return new IntrinsicType(type.intrinsicName);
|
||||
convertType(context:Context, type:ts.Type):IntrinsicType {
|
||||
let intrinsicName = context.program.getTypeChecker().typeToString(type);
|
||||
return new IntrinsicType(intrinsicName);
|
||||
}
|
||||
}
|
||||
|
@@ -23,7 +23,7 @@ export class ReferenceConverter extends ConverterTypeComponent implements ITypeN
|
||||
* Test whether this converter can handle the given TypeScript node.
|
||||
*/
|
||||
supportsNode(context:Context, node:ts.TypeReferenceNode, type:ts.TypeReference):boolean {
|
||||
return !!(type.flags & ts.TypeFlags.ObjectType);
|
||||
return !!(type.flags & ts.TypeFlags.Object);
|
||||
}
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ export class ReferenceConverter extends ConverterTypeComponent implements ITypeN
|
||||
* Test whether this converter can handle the given TypeScript type.
|
||||
*/
|
||||
supportsType(context:Context, type:ts.TypeReference):boolean {
|
||||
return !!(type.flags & ts.TypeFlags.ObjectType);
|
||||
return !!(type.flags & ts.TypeFlags.Object);
|
||||
}
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ export class ReferenceConverter extends ConverterTypeComponent implements ITypeN
|
||||
convertNode(context:Context, node:ts.TypeReferenceNode, type:ts.TypeReference):Type {
|
||||
if (!type.symbol) {
|
||||
return new IntrinsicType('Object');
|
||||
} else if (type.symbol.flags & ts.SymbolFlags.TypeLiteral || type.symbol.flags & ts.SymbolFlags.ObjectLiteral) {
|
||||
} else if (type.symbol.declarations && (type.symbol.flags & ts.SymbolFlags.TypeLiteral || type.symbol.flags & ts.SymbolFlags.ObjectLiteral)) {
|
||||
return this.convertLiteral(context, type.symbol, node);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ export class ReferenceConverter extends ConverterTypeComponent implements ITypeN
|
||||
convertType(context:Context, type:ts.TypeReference):Type {
|
||||
if (!type.symbol) {
|
||||
return new IntrinsicType('Object');
|
||||
} else if (type.symbol.flags & ts.SymbolFlags.TypeLiteral || type.symbol.flags & ts.SymbolFlags.ObjectLiteral) {
|
||||
} else if (type.symbol.declarations && (type.symbol.flags & ts.SymbolFlags.TypeLiteral || type.symbol.flags & ts.SymbolFlags.ObjectLiteral)) {
|
||||
return this.convertLiteral(context, type.symbol);
|
||||
}
|
||||
|
||||
|
@@ -6,7 +6,7 @@ import {Context} from "../context";
|
||||
|
||||
|
||||
@Component({name:'type:string-literal'})
|
||||
export class StringLiteralConverter extends ConverterTypeComponent implements ITypeConverter<ts.StringLiteralType, ts.StringLiteral>
|
||||
export class StringLiteralConverter extends ConverterTypeComponent implements ITypeConverter<ts.LiteralType, ts.StringLiteral>
|
||||
{
|
||||
/**
|
||||
* Test whether this converter can handle the given TypeScript node.
|
||||
@@ -19,7 +19,7 @@ export class StringLiteralConverter extends ConverterTypeComponent implements IT
|
||||
/**
|
||||
* Test whether this converter can handle the given TypeScript type.
|
||||
*/
|
||||
supportsType(context:Context, type:ts.StringLiteralType):boolean {
|
||||
supportsType(context:Context, type:ts.LiteralType):boolean {
|
||||
return !!(type.flags & ts.TypeFlags.StringLiteral);
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ export class StringLiteralConverter extends ConverterTypeComponent implements IT
|
||||
* @param node The string literal node that should be converted.
|
||||
* @returns The type reflection representing the given string literal node.
|
||||
*/
|
||||
convertNode(context:Context, node:ts.StringLiteral):StringLiteralType {
|
||||
convertNode(context:Context, node:ts.StringLiteral):Type {
|
||||
return new StringLiteralType(node.text);
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ export class StringLiteralConverter extends ConverterTypeComponent implements IT
|
||||
* @param type The intrinsic type that should be converted.
|
||||
* @returns The type reflection representing the given string literal type.
|
||||
*/
|
||||
convertType(context:Context, type:ts.StringLiteralType):StringLiteralType {
|
||||
convertType(context:Context, type:ts.LiteralType):Type {
|
||||
return new StringLiteralType(type.text);
|
||||
}
|
||||
}
|
||||
|
@@ -6,7 +6,7 @@ import {Context} from "../context";
|
||||
|
||||
|
||||
@Component({name:'type:tuple'})
|
||||
export class TupleConverter extends ConverterTypeComponent implements ITypeConverter<ts.TupleType, ts.TupleTypeNode>
|
||||
export class TupleConverter extends ConverterTypeComponent implements ITypeConverter<ts.TypeReference, ts.TupleTypeNode>
|
||||
{
|
||||
/**
|
||||
* Test whether this converter can handle the given TypeScript node.
|
||||
@@ -19,8 +19,8 @@ export class TupleConverter extends ConverterTypeComponent implements ITypeConve
|
||||
/**
|
||||
* Test whether this converter can handle the given TypeScript type.
|
||||
*/
|
||||
supportsType(context:Context, type:ts.TupleType):boolean {
|
||||
return !!(type.flags & ts.TypeFlags.Tuple);
|
||||
supportsType(context:Context, type:ts.TypeReference):boolean {
|
||||
return !!(type.objectFlags & ts.ObjectFlags.Tuple);
|
||||
}
|
||||
|
||||
|
||||
@@ -62,10 +62,10 @@ export class TupleConverter extends ConverterTypeComponent implements ITypeConve
|
||||
* @param type The tuple type that should be converted.
|
||||
* @returns The type reflection representing the given tuple type.
|
||||
*/
|
||||
convertType(context:Context, type:ts.TupleType):TupleType {
|
||||
convertType(context:Context, type:ts.TypeReference):TupleType {
|
||||
var elements:Type[];
|
||||
if (type.elementTypes) {
|
||||
elements = type.elementTypes.map((t) => this.owner.convertType(context, null, t));
|
||||
if (type.typeArguments) {
|
||||
elements = type.typeArguments.map((t) => this.owner.convertType(context, null, t));
|
||||
} else {
|
||||
elements = [];
|
||||
}
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import * as ts from "typescript";
|
||||
import * as _ts from "../../ts-internal";
|
||||
|
||||
import {Type, TypeParameterType} from "../../models/types/index";
|
||||
import {Component, ConverterTypeComponent, ITypeNodeConverter} from "../components";
|
||||
@@ -41,7 +42,7 @@ export class TypeParameterConverter extends ConverterTypeComponent implements IT
|
||||
*/
|
||||
convertNode(context:Context, node:ts.TypeReferenceNode):Type {
|
||||
if (node.typeName) {
|
||||
var name = ts.getTextOfNode(node.typeName);
|
||||
var name = _ts.getTextOfNode(node.typeName);
|
||||
if (context.typeParameters && context.typeParameters[name]) {
|
||||
return context.typeParameters[name].clone();
|
||||
}
|
||||
|
@@ -1,7 +1,9 @@
|
||||
import * as ts from "typescript";
|
||||
import * as _ts from "../../ts-internal";
|
||||
import * as Path from "path";
|
||||
|
||||
import {ConverterComponent} from "../components";
|
||||
import {normalizePath} from "../../utils/fs";
|
||||
|
||||
|
||||
/**
|
||||
@@ -15,6 +17,7 @@ const ERROR_UNSUPPORTED_FILE_ENCODING = -2147024809;
|
||||
*/
|
||||
export class CompilerHost extends ConverterComponent implements ts.CompilerHost
|
||||
{
|
||||
|
||||
/**
|
||||
* The full path of the current directory. Result cache of [[getCurrentDirectory]].
|
||||
*/
|
||||
@@ -55,10 +58,14 @@ export class CompilerHost extends ConverterComponent implements ts.CompilerHost
|
||||
*/
|
||||
getDefaultLibFileName(options:ts.CompilerOptions):string {
|
||||
var lib = this.owner.getDefaultLib();
|
||||
var path = ts.getDirectoryPath(ts.normalizePath(require.resolve('typescript')));
|
||||
var path = _ts.getDirectoryPath(normalizePath(require.resolve('typescript')));
|
||||
return Path.join(path, lib);
|
||||
}
|
||||
|
||||
getDirectories(path: string): string[] {
|
||||
return ts.sys.getDirectories(path);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the full path of the current directory.
|
||||
@@ -97,6 +104,19 @@ export class CompilerHost extends ConverterComponent implements ts.CompilerHost
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Check whether the given directory exists.
|
||||
*
|
||||
* Implementation of ts.CompilerHost.directoryExists(directoryName)
|
||||
*
|
||||
* @param directoryName
|
||||
* @returns {boolean}
|
||||
*/
|
||||
directoryExists(directoryName:string):boolean {
|
||||
return ts.sys.directoryExists(directoryName);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the contents of the given file.
|
||||
*
|
||||
|
@@ -67,6 +67,19 @@ export class ContainerReflection extends Reflection
|
||||
result['groups'] = groups;
|
||||
}
|
||||
|
||||
if (this.sources) {
|
||||
var sources:any[] = [];
|
||||
this.sources.forEach((source) => {
|
||||
sources.push({
|
||||
fileName: source.fileName,
|
||||
line: source.line,
|
||||
character: source.character
|
||||
});
|
||||
});
|
||||
|
||||
result['sources'] = sources;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
@@ -113,12 +113,18 @@ export class ReferenceType extends Type
|
||||
|
||||
/**
|
||||
* Return a string representation of this type.
|
||||
* @example EventEmitter<any>
|
||||
*/
|
||||
toString() {
|
||||
if (this.reflection) {
|
||||
return this.reflection.name + (this.isArray ? '[]' : '');
|
||||
} else {
|
||||
return this.name + (this.isArray ? '[]' : '');
|
||||
var name = this.reflection ? this.reflection.name : this.name;
|
||||
var arraySuffix = this.isArray ? '[]' : '';
|
||||
var typeArgs = '';
|
||||
if (this.typeArguments) {
|
||||
typeArgs += '<';
|
||||
typeArgs += this.typeArguments.map(arg => arg.toString()).join(', ');
|
||||
typeArgs += '>'
|
||||
}
|
||||
|
||||
return name + typeArgs + arraySuffix;
|
||||
}
|
||||
}
|
||||
|
@@ -2,8 +2,9 @@ import * as Util from "util";
|
||||
|
||||
import {Reflection} from "../../models/reflections/abstract";
|
||||
import {Component, ContextAwareRendererComponent} from "../components";
|
||||
import {MarkdownEvent} from "../events";
|
||||
|
||||
import {MarkdownEvent, RendererEvent} from "../events";
|
||||
import {Option} from "../../utils/component";
|
||||
import {ParameterType} from "../../utils/options/declaration";
|
||||
|
||||
/**
|
||||
* A plugin that builds links in markdown texts.
|
||||
@@ -26,14 +27,24 @@ export class MarkedLinksPlugin extends ContextAwareRendererComponent
|
||||
*/
|
||||
private urlPrefix:RegExp = /^(http|ftp)s?:\/\//;
|
||||
|
||||
@Option({
|
||||
name: 'listInvalidSymbolLinks',
|
||||
help: 'Emits a list of broken symbol [[navigation]] links after documentation generation',
|
||||
type: ParameterType.Boolean
|
||||
})
|
||||
listInvalidSymbolLinks:boolean;
|
||||
|
||||
private warnings: string[] = [];
|
||||
|
||||
/**
|
||||
* Create a new MarkedLinksPlugin instance.
|
||||
*/
|
||||
initialize() {
|
||||
super.initialize();
|
||||
this.listenTo(this.owner, MarkdownEvent.PARSE, this.onParseMarkdown, 100);
|
||||
this.listenTo(this.owner, {
|
||||
[MarkdownEvent.PARSE]: this.onParseMarkdown,
|
||||
[RendererEvent.END]: this.onEndRenderer
|
||||
}, null, 100);
|
||||
}
|
||||
|
||||
|
||||
@@ -101,6 +112,8 @@ export class MarkedLinksPlugin extends ContextAwareRendererComponent
|
||||
if (reflection && reflection.url) {
|
||||
target = this.getRelativeUrl(reflection.url);
|
||||
} else {
|
||||
reflection = this.reflection || this.project;
|
||||
this.warnings.push(`In ${reflection.getFullName()}: ${original}`);
|
||||
return original;
|
||||
}
|
||||
}
|
||||
@@ -122,6 +135,20 @@ export class MarkedLinksPlugin extends ContextAwareRendererComponent
|
||||
event.parsedText = this.replaceInlineTags(this.replaceBrackets(event.parsedText));
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggered when [[Renderer]] is finished
|
||||
*/
|
||||
onEndRenderer(event:RendererEvent) {
|
||||
if (this.listInvalidSymbolLinks && this.warnings.length > 0) {
|
||||
this.application.logger.write('');
|
||||
this.application.logger.warn('[MarkedLinksPlugin]: Found invalid symbol reference(s) in JSDocs, ' +
|
||||
'they will not render as links in the generated documentation.');
|
||||
|
||||
for (var warning of this.warnings) {
|
||||
this.application.logger.write(' ' + warning);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Split the given link into text and target at first pipe or space.
|
||||
|
@@ -88,7 +88,7 @@ export class MarkedPlugin extends ContextAwareRendererComponent
|
||||
|
||||
var that = this;
|
||||
Handlebars.registerHelper('markdown', function(arg:any) { return that.parseMarkdown(arg.fn(this), this); });
|
||||
Handlebars.registerHelper('relativeURL', (url:string) => this.getRelativeUrl(url));
|
||||
Handlebars.registerHelper('relativeURL', (url:string) => url ? this.getRelativeUrl(url) : url);
|
||||
|
||||
Marked.setOptions({
|
||||
highlight: (text:any, lang:any) => this.getHighlighted(text, lang)
|
||||
|
@@ -40,8 +40,9 @@ export class TocPlugin extends RendererComponent
|
||||
model = model.parent;
|
||||
}
|
||||
|
||||
var tocRestriction = this.owner.toc;
|
||||
page.toc = new NavigationItem();
|
||||
TocPlugin.buildToc(model, trail, page.toc);
|
||||
TocPlugin.buildToc(model, trail, page.toc, tocRestriction);
|
||||
}
|
||||
|
||||
|
||||
@@ -51,8 +52,9 @@ export class TocPlugin extends RendererComponent
|
||||
* @param model The models whose children should be written to the toc.
|
||||
* @param trail Defines the active trail of expanded toc entries.
|
||||
* @param parent The parent [[NavigationItem]] the toc should be appended to.
|
||||
* @param restriction The restricted table of contents.
|
||||
*/
|
||||
static buildToc(model:Reflection, trail:Reflection[], parent:NavigationItem) {
|
||||
static buildToc(model:Reflection, trail:Reflection[], parent:NavigationItem, restriction?: string[]) {
|
||||
var index = trail.indexOf(model);
|
||||
var children = model['children'] || [];
|
||||
|
||||
@@ -64,6 +66,9 @@ export class TocPlugin extends RendererComponent
|
||||
TocPlugin.buildToc(child, trail, item);
|
||||
} else {
|
||||
children.forEach((child:DeclarationReflection) => {
|
||||
|
||||
if (restriction && restriction.length > 0 && restriction.indexOf(child.name) === -1) return;
|
||||
|
||||
if (child.kindOf(ReflectionKind.SomeModule)) {
|
||||
return;
|
||||
}
|
||||
|
@@ -103,7 +103,14 @@ export class Renderer extends ChildableComponent<Application, RendererComponent>
|
||||
help: 'Specifies the fully qualified name of the root symbol. Defaults to global namespace.',
|
||||
type: ParameterType.String
|
||||
})
|
||||
entryPoint:string;
|
||||
entryPoint:string;
|
||||
|
||||
@Option({
|
||||
name: 'toc',
|
||||
help: 'Specifies the top level table of contents.',
|
||||
type: ParameterType.Array
|
||||
})
|
||||
toc:string[];
|
||||
|
||||
/**
|
||||
* Create a new Renderer instance.
|
||||
@@ -199,14 +206,7 @@ export class Renderer extends ChildableComponent<Application, RendererComponent>
|
||||
}
|
||||
}
|
||||
|
||||
var filename = Path.join(path, 'theme.js');
|
||||
if (!FS.existsSync(filename)) {
|
||||
this.theme = this.addComponent("theme", new DefaultTheme(this, path));
|
||||
} else {
|
||||
// var themeClass = eval(Renderer.readFile(filename));
|
||||
// this.theme = new themeClass(this, path);
|
||||
this.theme = this.addComponent("theme", new DefaultTheme(this, path));
|
||||
}
|
||||
this.theme = this.addComponent("theme", new DefaultTheme(this, path));
|
||||
}
|
||||
|
||||
this.theme.resources.activate();
|
||||
|
@@ -45,7 +45,7 @@ export interface ITemplateMapping
|
||||
* [[BaseTheme]] implementation, this theme class will be used.
|
||||
*/
|
||||
export class DefaultTheme extends Theme
|
||||
{
|
||||
{
|
||||
/**
|
||||
* Mappings of reflections kinds to templates used by this theme.
|
||||
*/
|
||||
|
@@ -5,6 +5,7 @@ import * as Util from "util";
|
||||
import {Theme} from "../theme";
|
||||
import {HelperStack} from "./resources/helpers";
|
||||
import {TemplateStack, PartialStack} from "./resources/templates";
|
||||
import {Renderer} from "../renderer";
|
||||
|
||||
|
||||
export class Resources
|
||||
@@ -29,7 +30,8 @@ export class Resources
|
||||
this.partials = new PartialStack();
|
||||
this.helpers = new HelperStack();
|
||||
|
||||
this.addDirectory(Path.basename(theme.basePath), theme.basePath);
|
||||
this.addDirectory('default', Renderer.getDefaultTheme());
|
||||
this.addDirectory('theme', theme.basePath);
|
||||
}
|
||||
|
||||
|
||||
|
145
src/lib/ts-internal.ts
Normal file
145
src/lib/ts-internal.ts
Normal file
@@ -0,0 +1,145 @@
|
||||
import * as ts from "typescript";
|
||||
const tsany = ts as any;
|
||||
|
||||
/**
|
||||
* Expose the internal TypeScript APIs that are used by TypeDoc
|
||||
*/
|
||||
declare module "typescript" {
|
||||
interface Symbol {
|
||||
// https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/types.ts#L2658
|
||||
id?: number;
|
||||
// https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/types.ts#L2660
|
||||
parent?: ts.Symbol;
|
||||
}
|
||||
|
||||
interface Node {
|
||||
// https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/types.ts#L497
|
||||
symbol?: ts.Symbol;
|
||||
// https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/types.ts#L500
|
||||
localSymbol?: ts.Symbol;
|
||||
// https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/types.ts#L499
|
||||
nextContainer?: ts.Node;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* These functions are in "core" and are marked as @internal:
|
||||
* https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/core.ts#L9-L10
|
||||
*/
|
||||
|
||||
// https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/core.ts#L1133-LL1134
|
||||
export function createCompilerDiagnostic(message: ts.DiagnosticMessage, ...args: (string | number)[]): ts.Diagnostic;
|
||||
export function createCompilerDiagnostic(message: ts.DiagnosticMessage): ts.Diagnostic;
|
||||
export function createCompilerDiagnostic() {
|
||||
return tsany.createCompilerDiagnostic.apply(this, arguments);
|
||||
}
|
||||
|
||||
// https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/core.ts#L1191
|
||||
export function compareValues<T>(a: T, b: T): number {
|
||||
return tsany.compareValues.apply(this, arguments); // Actually returns a ts.Comparison which is also internal
|
||||
}
|
||||
|
||||
// https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/core.ts#L1281
|
||||
export function normalizeSlashes(path: string): string {
|
||||
return tsany.normalizeSlashes.apply(this, arguments);
|
||||
}
|
||||
|
||||
// https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/core.ts#L1288
|
||||
export function getRootLength(path: string): number {
|
||||
return tsany.getRootLength.apply(this, arguments);
|
||||
}
|
||||
|
||||
// https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/core.ts#L1368-L1370
|
||||
export function getDirectoryPath(path: ts.Path): ts.Path;
|
||||
export function getDirectoryPath(path: string): string;
|
||||
export function getDirectoryPath() {
|
||||
return tsany.getDirectoryPath.apply(this, arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* These functions are in "utilities" and are marked as @internal:
|
||||
* https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/utilities.ts#L3-L4
|
||||
*/
|
||||
|
||||
// https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/utilities.ts#L152
|
||||
export function getSourceFileOfNode(node: ts.Node): ts.SourceFile {
|
||||
return tsany.getSourceFileOfNode.apply(this, arguments);
|
||||
}
|
||||
|
||||
// https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/utilities.ts#L301
|
||||
export function getTextOfNode(node: ts.Node, includeTrivia = false): string {
|
||||
return tsany.getTextOfNode.apply(this, arguments);
|
||||
}
|
||||
|
||||
// https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/utilities.ts#L473
|
||||
export function declarationNameToString(name: ts.DeclarationName): string {
|
||||
return tsany.declarationNameToString.apply(this, arguments);
|
||||
}
|
||||
|
||||
// https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/utilities.ts#L1423
|
||||
export function getJSDocCommentRanges(node: ts.Node, text: string) {
|
||||
return tsany.getJSDocCommentRanges.apply(this, arguments);
|
||||
}
|
||||
|
||||
// https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/utilities.ts#L3738
|
||||
export function isBindingPattern(node: ts.Node): node is ts.BindingPattern {
|
||||
return tsany.isBindingPattern.apply(this, arguments);
|
||||
}
|
||||
|
||||
// https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/utilities.ts#L1729
|
||||
export function getClassExtendsHeritageClauseElement(node: ts.ClassLikeDeclaration | ts.InterfaceDeclaration) {
|
||||
return tsany.getClassExtendsHeritageClauseElement.apply(this, arguments);
|
||||
}
|
||||
|
||||
// https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/utilities.ts#L1734
|
||||
export function getClassImplementsHeritageClauseElements(node: ts.ClassLikeDeclaration) {
|
||||
return tsany.getClassImplementsHeritageClauseElements.apply(this, arguments);
|
||||
}
|
||||
|
||||
// https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/utilities.ts#L1739
|
||||
export function getInterfaceBaseTypeNodes(node: ts.InterfaceDeclaration) {
|
||||
return tsany.getInterfaceBaseTypeNodes.apply(this, arguments);
|
||||
}
|
||||
|
||||
/**
|
||||
* https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/types.ts#L3347
|
||||
* This is large enum of char codes.
|
||||
*
|
||||
* Faking the enum as a var (only certain codes are used by TypeDoc)
|
||||
*/
|
||||
export const CharacterCodes: {
|
||||
[key: string]: number;
|
||||
doubleQuote: number;
|
||||
space: number;
|
||||
minus: number;
|
||||
at: number;
|
||||
} = tsany.CharacterCodes;
|
||||
|
||||
export const optionDeclarations: CommandLineOption[] = tsany.optionDeclarations;
|
||||
|
||||
/**
|
||||
* Command line options
|
||||
*
|
||||
* https://github.com/Microsoft/TypeScript/blob/v2.1.4/src/compiler/types.ts#L3344
|
||||
*/
|
||||
export interface CommandLineOption {
|
||||
name: string;
|
||||
type: string;
|
||||
shortName: string;
|
||||
description: DiagnosticsEnumValue;
|
||||
paramType: DiagnosticsEnumValue;
|
||||
}
|
||||
|
||||
export const Diagnostics: {
|
||||
[key: string]: DiagnosticsEnumValue;
|
||||
FILE: DiagnosticsEnumValue;
|
||||
DIRECTORY: DiagnosticsEnumValue;
|
||||
} = tsany.Diagnostics;
|
||||
|
||||
export interface DiagnosticsEnumValue {
|
||||
code: number;
|
||||
category: ts.DiagnosticCategory;
|
||||
key: string;
|
||||
message: string;
|
||||
}
|
@@ -9,7 +9,7 @@ export interface IComponentHost {
|
||||
application:Application;
|
||||
}
|
||||
|
||||
interface IComponent extends AbstractComponent<IComponentHost> {
|
||||
export interface IComponent extends AbstractComponent<IComponentHost> {
|
||||
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ interface IComponentRegistry {
|
||||
}
|
||||
|
||||
|
||||
interface IComponentOptions {
|
||||
export interface IComponentOptions {
|
||||
name?:string;
|
||||
childClass?:Function;
|
||||
internal?:boolean;
|
||||
@@ -59,7 +59,7 @@ export function Component(options:IComponentOptions):ClassDecorator {
|
||||
|
||||
var name = options.name;
|
||||
if (name) {
|
||||
proto._componentName = name;
|
||||
proto.componentName = name;
|
||||
}
|
||||
|
||||
var internal = !!options.internal;
|
||||
@@ -130,7 +130,7 @@ export abstract class AbstractComponent<O extends IComponentHost> extends EventD
|
||||
/**
|
||||
* The name of this component as set by the @Component decorator.
|
||||
*/
|
||||
private _componentName:string;
|
||||
public componentName:string;
|
||||
|
||||
/**
|
||||
* A list of options defined by this component.
|
||||
@@ -174,12 +174,6 @@ export abstract class AbstractComponent<O extends IComponentHost> extends EventD
|
||||
return this._componentOptions ? this._componentOptions.slice() : [];
|
||||
}
|
||||
|
||||
|
||||
get componentName():string {
|
||||
return this._componentName;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return the application / root component instance.
|
||||
*/
|
||||
@@ -250,7 +244,7 @@ export abstract class ChildableComponent<O extends IComponentHost, C extends ICo
|
||||
}
|
||||
|
||||
|
||||
addComponent<T extends C>(name:string, componentClass:T|IComponentClass<T>):T {
|
||||
addComponent<T extends C & IComponent>(name:string, componentClass:T|IComponentClass<T>):T {
|
||||
if (!this._componentChildren) {
|
||||
this._componentChildren = {};
|
||||
}
|
||||
|
@@ -10,7 +10,7 @@
|
||||
import * as _ from "lodash";
|
||||
|
||||
|
||||
interface IEventCallback extends Function {
|
||||
export interface IEventCallback extends Function {
|
||||
_callback?:Function;
|
||||
}
|
||||
|
||||
|
@@ -1,11 +1,13 @@
|
||||
import * as ts from "typescript";
|
||||
import * as _ts from "../ts-internal";
|
||||
import * as FS from "fs";
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* List of known existent directories. Used to speed up [[directoryExists]].
|
||||
*/
|
||||
var existingDirectories:ts.Map<boolean> = {};
|
||||
var existingDirectories:ts.MapLike<boolean> = {};
|
||||
|
||||
|
||||
/**
|
||||
@@ -15,7 +17,7 @@ var existingDirectories:ts.Map<boolean> = {};
|
||||
* @returns The normalized path.
|
||||
*/
|
||||
export function normalizePath(path:string) {
|
||||
return ts.normalizePath(path);
|
||||
return path.replace(/\\/g, "/");
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +28,7 @@ export function normalizePath(path:string) {
|
||||
* @returns TRUE if the given directory exists, FALSE otherwise.
|
||||
*/
|
||||
export function directoryExists(directoryPath: string): boolean {
|
||||
if (ts.hasProperty(existingDirectories, directoryPath)) {
|
||||
if (existingDirectories.hasOwnProperty(directoryPath)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -45,8 +47,8 @@ export function directoryExists(directoryPath: string): boolean {
|
||||
* @param directoryPath The directory that should be validated.
|
||||
*/
|
||||
export function ensureDirectoriesExist(directoryPath: string) {
|
||||
if (directoryPath.length > ts.getRootLength(directoryPath) && !directoryExists(directoryPath)) {
|
||||
var parentDirectory = ts.getDirectoryPath(directoryPath);
|
||||
if (directoryPath.length > _ts.getRootLength(directoryPath) && !directoryExists(directoryPath)) {
|
||||
var parentDirectory = _ts.getDirectoryPath(directoryPath);
|
||||
ensureDirectoriesExist(parentDirectory);
|
||||
ts.sys.createDirectory(directoryPath);
|
||||
}
|
||||
@@ -65,7 +67,7 @@ export function ensureDirectoriesExist(directoryPath: string) {
|
||||
*/
|
||||
export function writeFile(fileName:string, data:string, writeByteOrderMark:boolean, onError?:(message:string) => void) {
|
||||
try {
|
||||
ensureDirectoriesExist(ts.getDirectoryPath(ts.normalizePath(fileName)));
|
||||
ensureDirectoriesExist(_ts.getDirectoryPath(normalizePath(fileName)));
|
||||
ts.sys.writeFile(fileName, data, writeByteOrderMark);
|
||||
} catch (e) {
|
||||
if (onError) onError(e.message);
|
||||
|
@@ -12,7 +12,8 @@ export enum ParameterType {
|
||||
Number,
|
||||
Boolean,
|
||||
Map,
|
||||
Mixed
|
||||
Mixed,
|
||||
Array
|
||||
}
|
||||
|
||||
|
||||
@@ -96,15 +97,24 @@ export class OptionDeclaration
|
||||
case ParameterType.String:
|
||||
value = value || "";
|
||||
break;
|
||||
case ParameterType.Array:
|
||||
if (!value) {
|
||||
value = [];
|
||||
} else if (typeof value === "string") {
|
||||
value = value.split(",");
|
||||
}
|
||||
break;
|
||||
case ParameterType.Map:
|
||||
var key = value ? (value + "").toLowerCase() : '';
|
||||
if (key in this.map) {
|
||||
value = this.map[key];
|
||||
} else if (errorCallback) {
|
||||
if (this.mapError) {
|
||||
errorCallback(this.mapError);
|
||||
} else {
|
||||
errorCallback('Invalid value for option "%s".', this.name);
|
||||
if (this.map !== 'object') {
|
||||
var key = value ? (value + "").toLowerCase() : '';
|
||||
if (key in this.map) {
|
||||
value = this.map[key];
|
||||
} else if (errorCallback) {
|
||||
if (this.mapError) {
|
||||
errorCallback(this.mapError);
|
||||
} else {
|
||||
errorCallback('Invalid value for option "%s".', this.name);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import * as ts from "typescript";
|
||||
import * as _ts from "../../ts-internal";
|
||||
|
||||
import {Options} from "./options";
|
||||
import {ParameterScope, ParameterHint} from "./declaration";
|
||||
@@ -20,7 +21,7 @@ export interface IParameterHelp {
|
||||
function getParameterHelp(options:Options, scope:ParameterScope):IParameterHelp {
|
||||
var parameters = options.getDeclarationsByScope(scope);
|
||||
parameters.sort((a, b) => {
|
||||
return <number>ts.compareValues<string>(a.name.toLowerCase(), b.name.toLowerCase())
|
||||
return _ts.compareValues<string>(a.name.toLowerCase(), b.name.toLowerCase())
|
||||
});
|
||||
|
||||
var names:string[] = [];
|
||||
|
@@ -138,7 +138,7 @@ export class Options extends ChildableComponent<Application, OptionsComponent>
|
||||
}
|
||||
}
|
||||
|
||||
return _.unique(result);
|
||||
return _.uniq(result);
|
||||
}
|
||||
|
||||
|
||||
@@ -168,7 +168,9 @@ export class Options extends ChildableComponent<Application, OptionsComponent>
|
||||
setValues(obj:Object, prefix:string = '', errorCallback?:Function) {
|
||||
for (var key in obj) {
|
||||
var value = obj[key];
|
||||
if (typeof value === 'object') {
|
||||
var declaration = this.getDeclaration(key);
|
||||
var shouldValueBeAnObject = declaration && declaration.map === 'object';
|
||||
if (typeof value === 'object' && !shouldValueBeAnObject) {
|
||||
this.setValues(value, prefix + key + '.', errorCallback);
|
||||
} else {
|
||||
this.setValue(prefix + key, value, errorCallback);
|
||||
|
@@ -1,4 +1,5 @@
|
||||
import * as ts from "typescript";
|
||||
import * as _ts from "../../../ts-internal";
|
||||
|
||||
import {Component} from "../../component";
|
||||
import {DiscoverEvent, OptionsComponent} from "../options";
|
||||
@@ -52,10 +53,10 @@ export class ArgumentsReader extends OptionsComponent
|
||||
while (index < args.length) {
|
||||
var arg = args[index++];
|
||||
|
||||
if (arg.charCodeAt(0) === ts.CharacterCodes.at) {
|
||||
if (arg.charCodeAt(0) === _ts.CharacterCodes.at) {
|
||||
this.parseResponseFile(event, arg.slice(1));
|
||||
} else if (arg.charCodeAt(0) === ts.CharacterCodes.minus) {
|
||||
readArgument(arg.slice(arg.charCodeAt(1) === ts.CharacterCodes.minus ? 2 : 1).toLowerCase());
|
||||
} else if (arg.charCodeAt(0) === _ts.CharacterCodes.minus) {
|
||||
readArgument(arg.slice(arg.charCodeAt(1) === _ts.CharacterCodes.minus ? 2 : 1).toLowerCase());
|
||||
} else {
|
||||
event.addInputFile(arg);
|
||||
}
|
||||
@@ -80,13 +81,13 @@ export class ArgumentsReader extends OptionsComponent
|
||||
var args:string[] = [];
|
||||
var pos = 0;
|
||||
while (true) {
|
||||
while (pos < text.length && text.charCodeAt(pos) <= ts.CharacterCodes.space) pos++;
|
||||
while (pos < text.length && text.charCodeAt(pos) <= _ts.CharacterCodes.space) pos++;
|
||||
if (pos >= text.length) break;
|
||||
|
||||
var start = pos;
|
||||
if (text.charCodeAt(start) === ts.CharacterCodes.doubleQuote) {
|
||||
if (text.charCodeAt(start) === _ts.CharacterCodes.doubleQuote) {
|
||||
pos++;
|
||||
while (pos < text.length && text.charCodeAt(pos) !== ts.CharacterCodes.doubleQuote) pos++;
|
||||
while (pos < text.length && text.charCodeAt(pos) !== _ts.CharacterCodes.doubleQuote) pos++;
|
||||
if (pos < text.length) {
|
||||
args.push(text.substring(start + 1, pos));
|
||||
pos++;
|
||||
@@ -95,7 +96,7 @@ export class ArgumentsReader extends OptionsComponent
|
||||
return;
|
||||
}
|
||||
} else {
|
||||
while (text.charCodeAt(pos) > ts.CharacterCodes.space) pos++;
|
||||
while (text.charCodeAt(pos) > _ts.CharacterCodes.space) pos++;
|
||||
args.push(text.substring(start, pos));
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,7 @@
|
||||
import * as Path from "path";
|
||||
import * as FS from "fs";
|
||||
import * as _ from "lodash";
|
||||
import * as ts from "typescript";
|
||||
|
||||
import {Component, Option} from "../../component";
|
||||
import {OptionsComponent, DiscoverEvent} from "../options";
|
||||
@@ -35,8 +36,9 @@ export class TSConfigReader extends OptionsComponent
|
||||
if (TSConfigReader.OPTIONS_KEY in event.data) {
|
||||
this.load(event, Path.resolve(event.data[TSConfigReader.OPTIONS_KEY]));
|
||||
} else if (this.application.isCLI) {
|
||||
var file = Path.resolve('tsconfig.json');
|
||||
if (FS.existsSync(file)) {
|
||||
let file:string = ts.findConfigFile(".", ts.sys.fileExists);
|
||||
// If file is undefined, we found no file to load.
|
||||
if (file) {
|
||||
this.load(event, file);
|
||||
}
|
||||
}
|
||||
@@ -55,28 +57,31 @@ export class TSConfigReader extends OptionsComponent
|
||||
return;
|
||||
}
|
||||
|
||||
var data = require(fileName);
|
||||
if (typeof data !== "object") {
|
||||
event.addError('The tsconfig file %s does not return an object.', fileName);
|
||||
let data = ts.readConfigFile(fileName, ts.sys.readFile).config;
|
||||
if (data === undefined) {
|
||||
event.addError('The tsconfig file %s does not contain valid JSON.', fileName);
|
||||
return;
|
||||
}
|
||||
if (!_.isPlainObject(data)) {
|
||||
event.addError('The tsconfig file %s does not contain a JSON object.', fileName);
|
||||
return;
|
||||
}
|
||||
|
||||
if ("files" in data && _.isArray(data.files)) {
|
||||
event.inputFiles = data.files;
|
||||
data = ts.parseJsonConfigFileContent(
|
||||
data,
|
||||
ts.sys,
|
||||
Path.resolve(Path.dirname(fileName)),
|
||||
{},
|
||||
Path.resolve(fileName));
|
||||
|
||||
event.inputFiles = data.fileNames;
|
||||
|
||||
const ignored = TypeScriptSource.IGNORED;
|
||||
let compilerOptions = _.clone(data.raw.compilerOptions);
|
||||
for (const key of ignored) {
|
||||
delete compilerOptions[key];
|
||||
}
|
||||
|
||||
if ("compilerOptions" in data) {
|
||||
var ignored = TypeScriptSource.IGNORED;
|
||||
var compilerOptions = _.clone(data.compilerOptions);
|
||||
for (var key of ignored) {
|
||||
delete compilerOptions[key];
|
||||
}
|
||||
|
||||
_.merge(event.data, compilerOptions);
|
||||
}
|
||||
|
||||
if ("typedocOptions" in data) {
|
||||
_.merge(event.data, data.typedocOptions);
|
||||
}
|
||||
_.defaults(event.data, data.raw.typedocOptions, compilerOptions);
|
||||
}
|
||||
}
|
||||
|
@@ -1,4 +1,6 @@
|
||||
import * as ts from "typescript";
|
||||
import * as _ts from "../../../ts-internal";
|
||||
|
||||
|
||||
import {Component} from "../../component";
|
||||
import {OptionsComponent} from "../options";
|
||||
@@ -16,7 +18,11 @@ export class TypeScriptSource extends OptionsComponent
|
||||
static IGNORED:string[] = [
|
||||
'out', 'version', 'help',
|
||||
'watch', 'declaration', 'mapRoot',
|
||||
'sourceMap', 'removeComments'
|
||||
'sourceMap', 'inlineSources', 'removeComments',
|
||||
// Ignore new TypeScript 2.0 options until typedoc can't manage it.
|
||||
'lib', 'noImplicitThis',
|
||||
'traceResolution', 'noUnusedParameters', 'noUnusedLocals',
|
||||
'skipLibCheck', 'declarationDir', 'types', 'typeRoots'
|
||||
];
|
||||
|
||||
|
||||
@@ -24,7 +30,7 @@ export class TypeScriptSource extends OptionsComponent
|
||||
var ignored = TypeScriptSource.IGNORED;
|
||||
this.declarations = [];
|
||||
|
||||
for (var declaration of ts.optionDeclarations) {
|
||||
for (var declaration of _ts.optionDeclarations) {
|
||||
if (ignored.indexOf(declaration.name) === -1) {
|
||||
this.addTSOption(declaration);
|
||||
}
|
||||
@@ -40,7 +46,7 @@ export class TypeScriptSource extends OptionsComponent
|
||||
}
|
||||
|
||||
|
||||
private addTSOption(option:ts.CommandLineOption) {
|
||||
private addTSOption(option:_ts.CommandLineOption) {
|
||||
var param:IOptionDeclaration = {
|
||||
name: option.name,
|
||||
short: option.shortName,
|
||||
@@ -63,16 +69,16 @@ export class TypeScriptSource extends OptionsComponent
|
||||
param.type = ParameterType.Map;
|
||||
param.map = option.type;
|
||||
if (option['error']) {
|
||||
var error = ts.createCompilerDiagnostic(option['error']);
|
||||
var error = _ts.createCompilerDiagnostic(option['error']);
|
||||
param.mapError = ts.flattenDiagnosticMessageText(error.messageText, ', ');
|
||||
}
|
||||
}
|
||||
|
||||
switch (option.paramType) {
|
||||
case ts.Diagnostics.FILE:
|
||||
case _ts.Diagnostics.FILE:
|
||||
param.hint = ParameterHint.File;
|
||||
break;
|
||||
case ts.Diagnostics.DIRECTORY:
|
||||
case _ts.Diagnostics.DIRECTORY:
|
||||
param.hint = ParameterHint.Directory;
|
||||
break;
|
||||
}
|
||||
|
188
src/typings/fs-extra/fs-extra.d.ts
vendored
188
src/typings/fs-extra/fs-extra.d.ts
vendored
@@ -1,188 +0,0 @@
|
||||
// Type definitions for fs-extra
|
||||
// Project: https://github.com/jprichardson/node-fs-extra
|
||||
// Definitions by: midknight41 <https://github.com/midknight41>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
// Imported from: https://github.com/soywiz/typescript-node-definitions/fs-extra.d.ts
|
||||
|
||||
///<reference path="../node/node.d.ts"/>
|
||||
|
||||
declare module "fs-extra" {
|
||||
import stream = require("stream");
|
||||
|
||||
export interface Stats {
|
||||
isFile(): boolean;
|
||||
isDirectory(): boolean;
|
||||
isBlockDevice(): boolean;
|
||||
isCharacterDevice(): boolean;
|
||||
isSymbolicLink(): boolean;
|
||||
isFIFO(): boolean;
|
||||
isSocket(): boolean;
|
||||
dev: number;
|
||||
ino: number;
|
||||
mode: number;
|
||||
nlink: number;
|
||||
uid: number;
|
||||
gid: number;
|
||||
rdev: number;
|
||||
size: number;
|
||||
blksize: number;
|
||||
blocks: number;
|
||||
atime: Date;
|
||||
mtime: Date;
|
||||
ctime: Date;
|
||||
}
|
||||
|
||||
export interface FSWatcher {
|
||||
close(): void;
|
||||
}
|
||||
|
||||
export class ReadStream extends stream.Readable { }
|
||||
export class WriteStream extends stream.Writable { }
|
||||
|
||||
//extended methods
|
||||
export function copy(src: string, dest: string, callback?: (err: Error) => void): void;
|
||||
export function copy(src: string, dest: string, filter: (src: string) => boolean, callback?: (err: Error) => void): void;
|
||||
|
||||
export function copySync(src: string, dest: string): void;
|
||||
export function copySync(src: string, dest: string, filter: (src: string) => boolean): void;
|
||||
|
||||
export function createFile(file: string, callback?: (err: Error) => void): void;
|
||||
export function createFileSync(file: string): void;
|
||||
|
||||
export function mkdirs(dir: string, callback?: (err: Error) => void): void;
|
||||
export function mkdirp(dir: string, callback?: (err: Error) => void): void;
|
||||
export function mkdirsSync(dir: string): void;
|
||||
export function mkdirpSync(dir: string): void;
|
||||
|
||||
export function outputFile(file: string, data: any, callback?: (err: Error) => void): void;
|
||||
export function outputFileSync(file: string, data: any): void;
|
||||
|
||||
export function outputJson(file: string, data: any, callback?: (err: Error) => void): void;
|
||||
export function outputJSON(file: string, data: any, callback?: (err: Error) => void): void;
|
||||
export function outputJsonSync(file: string, data: any): void;
|
||||
export function outputJSONSync(file: string, data: any): void;
|
||||
|
||||
export function readJson(file: string, callback?: (err: Error) => void): void;
|
||||
export function readJson(file: string, options?: OpenOptions, callback?: (err: Error) => void): void;
|
||||
export function readJSON(file: string, callback?: (err: Error) => void): void;
|
||||
export function readJSON(file: string, options?: OpenOptions, callback?: (err: Error) => void): void;
|
||||
|
||||
export function readJsonSync(file: string, options?: OpenOptions): void;
|
||||
export function readJSONSync(file: string, options?: OpenOptions): void;
|
||||
|
||||
export function remove(dir: string, callback?: (err: Error) => void): void;
|
||||
export function removeSync(dir: string): void;
|
||||
// export function delete(dir: string, callback?: (err: Error) => void): void;
|
||||
// export function deleteSync(dir: string): void;
|
||||
|
||||
export function writeJson(file: string, object: any, callback?: (err: Error) => void): void;
|
||||
export function writeJson(file: string, object: any, options?: OpenOptions, callback?: (err: Error) => void): void;
|
||||
export function writeJSON(file: string, object: any, callback?: (err: Error) => void): void;
|
||||
export function writeJSON(file: string, object: any, options?: OpenOptions, callback?: (err: Error) => void): void;
|
||||
|
||||
export function writeJsonSync(file: string, object: any, options?: OpenOptions): void;
|
||||
export function writeJSONSync(file: string, object: any, options?: OpenOptions): void;
|
||||
|
||||
export function rename(oldPath: string, newPath: string, callback?: (err: Error) => void): void;
|
||||
export function renameSync(oldPath: string, newPath: string): void;
|
||||
export function truncate(fd: number, len: number, callback?: (err: Error) => void): void;
|
||||
export function truncateSync(fd: number, len: number): void;
|
||||
export function chown(path: string, uid: number, gid: number, callback?: (err: Error) => void): void;
|
||||
export function chownSync(path: string, uid: number, gid: number): void;
|
||||
export function fchown(fd: number, uid: number, gid: number, callback?: (err: Error) => void): void;
|
||||
export function fchownSync(fd: number, uid: number, gid: number): void;
|
||||
export function lchown(path: string, uid: number, gid: number, callback?: (err: Error) => void): void;
|
||||
export function lchownSync(path: string, uid: number, gid: number): void;
|
||||
export function chmod(path: string, mode: number, callback?: (err: Error) => void): void;
|
||||
export function chmod(path: string, mode: string, callback?: (err: Error) => void): void;
|
||||
export function chmodSync(path: string, mode: number): void;
|
||||
export function chmodSync(path: string, mode: string): void;
|
||||
export function fchmod(fd: number, mode: number, callback?: (err: Error) => void): void;
|
||||
export function fchmod(fd: number, mode: string, callback?: (err: Error) => void): void;
|
||||
export function fchmodSync(fd: number, mode: number): void;
|
||||
export function fchmodSync(fd: number, mode: string): void;
|
||||
export function lchmod(path: string, mode: string, callback?: (err: Error) => void): void;
|
||||
export function lchmod(path: string, mode: number, callback?: (err: Error) => void): void;
|
||||
export function lchmodSync(path: string, mode: number): void;
|
||||
export function lchmodSync(path: string, mode: string): void;
|
||||
export function stat(path: string, callback?: (err: Error, stats: Stats) => void): void;
|
||||
export function lstat(path: string, callback?: (err: Error, stats: Stats) => void): void;
|
||||
export function fstat(fd: number, callback?: (err: Error, stats: Stats) => void): void;
|
||||
export function statSync(path: string): Stats;
|
||||
export function lstatSync(path: string): Stats;
|
||||
export function fstatSync(fd: number): Stats;
|
||||
export function link(srcpath: string, dstpath: string, callback?: (err: Error) => void): void;
|
||||
export function linkSync(srcpath: string, dstpath: string): void;
|
||||
export function symlink(srcpath: string, dstpath: string, type?: string, callback?: (err: Error) => void): void;
|
||||
export function symlinkSync(srcpath: string, dstpath: string, type?: string): void;
|
||||
export function readlink(path: string, callback?: (err: Error, linkString: string) => void): void;
|
||||
export function realpath(path: string, callback?: (err: Error, resolvedPath: string) => void): void;
|
||||
export function realpath(path: string, cache: string, callback: (err: Error, resolvedPath: string) => void): void;
|
||||
export function realpathSync(path: string, cache?: boolean): string;
|
||||
export function unlink(path: string, callback?: (err: Error) => void): void;
|
||||
export function unlinkSync(path: string): void;
|
||||
export function rmdir(path: string, callback?: (err: Error) => void): void;
|
||||
export function rmdirSync(path: string): void;
|
||||
export function mkdir(path: string, mode?: number, callback?: (err: Error) => void): void;
|
||||
export function mkdir(path: string, mode?: string, callback?: (err: Error) => void): void;
|
||||
export function mkdirSync(path: string, mode?: number): void;
|
||||
export function mkdirSync(path: string, mode?: string): void;
|
||||
export function readdir(path: string, callback?: (err: Error, files: string[]) => void ): void;
|
||||
export function readdirSync(path: string): string[];
|
||||
export function close(fd: number, callback?: (err: Error) => void): void;
|
||||
export function closeSync(fd: number): void;
|
||||
export function open(path: string, flags: string, mode?: string, callback?: (err: Error, fs: number) => void): void;
|
||||
export function openSync(path: string, flags: string, mode?: string): number;
|
||||
export function utimes(path: string, atime: number, mtime: number, callback?: (err: Error) => void): void;
|
||||
export function utimesSync(path: string, atime: number, mtime: number): void;
|
||||
export function futimes(fd: number, atime: number, mtime: number, callback?: (err: Error) => void): void;
|
||||
export function futimesSync(fd: number, atime: number, mtime: number): void;
|
||||
export function fsync(fd: number, callback?: (err: Error) => void): void;
|
||||
export function fsyncSync(fd: number): void;
|
||||
export function write(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, written: number, buffer: NodeBuffer) => void): void;
|
||||
export function writeSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number;
|
||||
export function read(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number, callback?: (err: Error, bytesRead: number, buffer: NodeBuffer) => void ): void;
|
||||
export function readSync(fd: number, buffer: NodeBuffer, offset: number, length: number, position: number): number;
|
||||
export function readFile(filename: string, encoding: string, callback: (err: Error, data: string) => void ): void;
|
||||
export function readFile(filename: string, options: OpenOptions, callback: (err: Error, data: string) => void ): void;
|
||||
export function readFile(filename: string, callback: (err: Error, data: NodeBuffer) => void ): void;
|
||||
export function readFileSync(filename: string): NodeBuffer;
|
||||
export function readFileSync(filename: string, encoding: string): string;
|
||||
export function readFileSync(filename: string, options: OpenOptions): string;
|
||||
export function writeFile(filename: string, data: any, encoding?: string, callback?: (err: Error) => void): void;
|
||||
export function writeFile(filename: string, data: any, options?: OpenOptions, callback?: (err: Error) => void): void;
|
||||
export function writeFileSync(filename: string, data: any, encoding?: string): void;
|
||||
export function writeFileSync(filename: string, data: any, option?: OpenOptions): void;
|
||||
export function appendFile(filename: string, data: any, encoding?: string, callback?: (err: Error) => void): void;
|
||||
export function appendFile(filename: string, data: any,option?: OpenOptions, callback?: (err: Error) => void): void;
|
||||
export function appendFileSync(filename: string, data: any, encoding?: string): void;
|
||||
export function appendFileSync(filename: string, data: any, option?: OpenOptions): void;
|
||||
export function watchFile(filename: string, listener: { curr: Stats; prev: Stats; }): void;
|
||||
export function watchFile(filename: string, options: { persistent?: boolean; interval?: number; }, listener: { curr: Stats; prev: Stats; }): void;
|
||||
export function unwatchFile(filename: string, listener?: Stats): void;
|
||||
export function watch(filename: string, options?: { persistent?: boolean; }, listener?: (event: string, filename: string) => any): FSWatcher;
|
||||
export function exists(path: string, callback?: (exists: boolean) => void ): void;
|
||||
export function existsSync(path: string): boolean;
|
||||
export function ensureDir(path: string, cb: (err: Error) => void): void;
|
||||
|
||||
export interface OpenOptions {
|
||||
encoding?: string;
|
||||
flag?: string;
|
||||
}
|
||||
|
||||
export interface ReadStreamOptions {
|
||||
flags?: string;
|
||||
encoding?: string;
|
||||
fd?: number;
|
||||
mode?: number;
|
||||
bufferSize?: number;
|
||||
}
|
||||
export interface WriteStreamOptions {
|
||||
flags?: string;
|
||||
encoding?: string;
|
||||
string?: string;
|
||||
}
|
||||
export function createReadStream(path: string, options?: ReadStreamOptions): ReadStream;
|
||||
export function createWriteStream(path: string, options?: WriteStreamOptions): WriteStream;
|
||||
}
|
186
src/typings/handlebars/handlebars.d.ts
vendored
186
src/typings/handlebars/handlebars.d.ts
vendored
@@ -1,186 +0,0 @@
|
||||
// Type definitions for Handlebars 1.0
|
||||
// Project: http://handlebarsjs.com/
|
||||
// Definitions by: Boris Yankov <https://github.com/borisyankov/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
// Use either HandlebarsStatic or HandlebarsRuntimeStatic
|
||||
declare var Handlebars: HandlebarsStatic;
|
||||
//declare var Handlebars: HandlebarsRuntimeStatic;
|
||||
|
||||
/**
|
||||
* Implement this interface on your MVW/MVVM/MVC views such as Backbone.View
|
||||
**/
|
||||
interface HandlebarsTemplatable {
|
||||
template: HandlebarsTemplateDelegate;
|
||||
}
|
||||
|
||||
interface HandlebarsTemplateDelegate {
|
||||
(context: any, options?: any): string;
|
||||
}
|
||||
|
||||
interface HandlebarsCommon {
|
||||
registerHelper(name: string, fn: Function, inverse?: boolean): void;
|
||||
registerPartial(name: string, str: any): void;
|
||||
unregisterPartial(name: string): void;
|
||||
unregisterHelper(name: string): void;
|
||||
K(): void;
|
||||
createFrame(object: any): any;
|
||||
|
||||
Exception(message: string): void;
|
||||
SafeString: typeof hbs.SafeString;
|
||||
Utils: typeof hbs.Utils;
|
||||
|
||||
logger: Logger;
|
||||
log(level: number, obj: any): void;
|
||||
}
|
||||
|
||||
interface HandlebarsStatic extends HandlebarsCommon {
|
||||
parse(input: string): hbs.AST.ProgramNode;
|
||||
compile(input: any, options?: any): HandlebarsTemplateDelegate;
|
||||
}
|
||||
|
||||
interface HandlebarsTemplates {
|
||||
[index: string]: HandlebarsTemplateDelegate;
|
||||
}
|
||||
|
||||
interface HandlebarsRuntimeStatic extends HandlebarsCommon {
|
||||
// Handlebars.templates is the default template namespace in precompiler.
|
||||
templates: HandlebarsTemplates;
|
||||
}
|
||||
|
||||
declare module hbs {
|
||||
class SafeString {
|
||||
constructor(str: string);
|
||||
static toString(): string;
|
||||
}
|
||||
|
||||
module Utils {
|
||||
function escapeExpression(str: string): string;
|
||||
}
|
||||
}
|
||||
|
||||
interface Logger {
|
||||
DEBUG: number;
|
||||
INFO: number;
|
||||
WARN: number;
|
||||
ERROR: number;
|
||||
level: number;
|
||||
|
||||
methodMap: { [level: number]: string };
|
||||
|
||||
log(level: number, obj: string): void;
|
||||
}
|
||||
|
||||
declare module hbs {
|
||||
module AST {
|
||||
interface IStripInfo {
|
||||
left?: boolean;
|
||||
right?: boolean;
|
||||
inlineStandalone?: boolean;
|
||||
}
|
||||
|
||||
class NodeBase {
|
||||
firstColumn: number;
|
||||
firstLine: number;
|
||||
lastColumn: number;
|
||||
lastLine: number;
|
||||
type: string;
|
||||
}
|
||||
|
||||
class ProgramNode extends NodeBase {
|
||||
statements: NodeBase[];
|
||||
}
|
||||
|
||||
class IdNode extends NodeBase {
|
||||
original: string;
|
||||
parts: string[];
|
||||
string: string;
|
||||
depth: number;
|
||||
idName: string;
|
||||
isSimple: boolean;
|
||||
stringModeValue: string;
|
||||
}
|
||||
|
||||
class HashNode extends NodeBase {
|
||||
pairs: {0: string;
|
||||
1: NodeBase}[];
|
||||
}
|
||||
|
||||
class SexprNode extends NodeBase {
|
||||
hash: HashNode;
|
||||
id: NodeBase;
|
||||
params: NodeBase[];
|
||||
isHelper: boolean;
|
||||
eligibleHelper: boolean;
|
||||
}
|
||||
|
||||
class MustacheNode extends NodeBase {
|
||||
strip: IStripInfo;
|
||||
escaped: boolean;
|
||||
sexpr: SexprNode;
|
||||
|
||||
}
|
||||
|
||||
class BlockNode extends NodeBase {
|
||||
mustache: MustacheNode;
|
||||
program: ProgramNode;
|
||||
inverse: ProgramNode;
|
||||
strip: IStripInfo;
|
||||
isInverse: boolean;
|
||||
}
|
||||
|
||||
class PartialNameNode extends NodeBase {
|
||||
name: string;
|
||||
}
|
||||
|
||||
class PartialNode extends NodeBase {
|
||||
partialName: PartialNameNode;
|
||||
context: NodeBase;
|
||||
hash: HashNode;
|
||||
strip: IStripInfo;
|
||||
}
|
||||
|
||||
class RawBlockNode extends NodeBase {
|
||||
mustache: MustacheNode;
|
||||
program: ProgramNode;
|
||||
}
|
||||
|
||||
class ContentNode extends NodeBase {
|
||||
original: string;
|
||||
string: string;
|
||||
}
|
||||
|
||||
class DataNode extends NodeBase {
|
||||
id: IdNode;
|
||||
stringModeValue: string;
|
||||
idName: string;
|
||||
}
|
||||
|
||||
class StringNode extends NodeBase {
|
||||
original: string;
|
||||
string: string;
|
||||
stringModeValue: string;
|
||||
}
|
||||
|
||||
class NumberNode extends NodeBase {
|
||||
original: string;
|
||||
number: string;
|
||||
stringModeValue: number;
|
||||
}
|
||||
|
||||
class BooleanNode extends NodeBase {
|
||||
bool: string;
|
||||
stringModeValue: boolean;
|
||||
}
|
||||
|
||||
class CommentNode extends NodeBase {
|
||||
comment: string;
|
||||
strip: IStripInfo;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
declare module "handlebars" {
|
||||
export = Handlebars;
|
||||
}
|
154
src/typings/highlightjs/highlightjs.d.ts
vendored
154
src/typings/highlightjs/highlightjs.d.ts
vendored
@@ -1,154 +0,0 @@
|
||||
// Type definitions for highlight.js v8.2.0
|
||||
// Project: https://github.com/isagalaev/highlight.js
|
||||
// Definitions by: Niklas Mollenhauer <https://github.com/nikeee/>, Jeremy Hull <https://github.com/sourrust>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "highlight.js"
|
||||
{
|
||||
module hljs
|
||||
{
|
||||
export function highlight(
|
||||
name: string,
|
||||
value: string,
|
||||
ignore_illegals?: boolean,
|
||||
continuation?: boolean) : IHighlightResult;
|
||||
export function highlightAuto(
|
||||
value: string,
|
||||
languageSubset?: string[]) : IAutoHighlightResult;
|
||||
|
||||
export function fixMarkup(value: string) : string;
|
||||
|
||||
export function highlightBlock(block: Node) : void;
|
||||
|
||||
export function configure(options: IOptions): void;
|
||||
|
||||
export function initHighlighting(): void;
|
||||
export function initHighlightingOnLoad(): void;
|
||||
|
||||
export function registerLanguage(
|
||||
name: string,
|
||||
language: (hljs?: HLJSStatic) => IModeBase): void;
|
||||
export function listLanguages(): string[];
|
||||
export function getLanguage(name: string): IMode;
|
||||
|
||||
export function inherit(parent: Object, obj: Object): Object;
|
||||
|
||||
// Common regexps
|
||||
export var IDENT_RE: string;
|
||||
export var UNDERSCORE_IDENT_RE: string;
|
||||
export var NUMBER_RE: string;
|
||||
export var C_NUMBER_RE: string;
|
||||
export var BINARY_NUMBER_RE: string;
|
||||
export var RE_STARTERS_RE: string;
|
||||
|
||||
// Common modes
|
||||
export var BACKSLASH_ESCAPE : IMode;
|
||||
export var APOS_STRING_MODE : IMode;
|
||||
export var QUOTE_STRING_MODE : IMode;
|
||||
export var PHRASAL_WORDS_MODE : IMode;
|
||||
export var C_LINE_COMMENT_MODE : IMode;
|
||||
export var C_BLOCK_COMMENT_MODE : IMode;
|
||||
export var HASH_COMMENT_MODE : IMode;
|
||||
export var NUMBER_MODE : IMode;
|
||||
export var C_NUMBER_MODE : IMode;
|
||||
export var BINARY_NUMBER_MODE : IMode;
|
||||
export var CSS_NUMBER_MODE : IMode;
|
||||
export var REGEX_MODE : IMode;
|
||||
export var TITLE_MODE : IMode;
|
||||
export var UNDERSCORE_TITLE_MODE : IMode;
|
||||
|
||||
export interface IHighlightResultBase
|
||||
{
|
||||
relevance: number;
|
||||
language: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export interface IAutoHighlightResult extends IHighlightResultBase
|
||||
{
|
||||
second_best?: IAutoHighlightResult;
|
||||
}
|
||||
|
||||
export interface IHighlightResult extends IHighlightResultBase
|
||||
{
|
||||
top: ICompiledMode;
|
||||
}
|
||||
|
||||
export interface HLJSStatic
|
||||
{
|
||||
inherit(parent: Object, obj: Object): Object;
|
||||
|
||||
// Common regexps
|
||||
IDENT_RE: string;
|
||||
UNDERSCORE_IDENT_RE: string;
|
||||
NUMBER_RE: string;
|
||||
C_NUMBER_RE: string;
|
||||
BINARY_NUMBER_RE: string;
|
||||
RE_STARTERS_RE: string;
|
||||
|
||||
// Common modes
|
||||
BACKSLASH_ESCAPE : IMode;
|
||||
APOS_STRING_MODE : IMode;
|
||||
QUOTE_STRING_MODE : IMode;
|
||||
PHRASAL_WORDS_MODE : IMode;
|
||||
C_LINE_COMMENT_MODE : IMode;
|
||||
C_BLOCK_COMMENT_MODE : IMode;
|
||||
HASH_COMMENT_MODE : IMode;
|
||||
NUMBER_MODE : IMode;
|
||||
C_NUMBER_MODE : IMode;
|
||||
BINARY_NUMBER_MODE : IMode;
|
||||
CSS_NUMBER_MODE : IMode;
|
||||
REGEX_MODE : IMode;
|
||||
TITLE_MODE : IMode;
|
||||
UNDERSCORE_TITLE_MODE : IMode;
|
||||
}
|
||||
|
||||
// Reference:
|
||||
// https://github.com/isagalaev/highlight.js/blob/master/docs/reference.rst
|
||||
export interface IModeBase
|
||||
{
|
||||
className?: string;
|
||||
aliases?: string[];
|
||||
begin?: string;
|
||||
end?: string;
|
||||
case_insensitive?: boolean;
|
||||
beginKeyword?: string;
|
||||
endsWithParent?: boolean;
|
||||
lexems?: string;
|
||||
illegal?: string;
|
||||
excludeBegin?: boolean;
|
||||
excludeEnd?: boolean;
|
||||
returnBegin?: boolean;
|
||||
returnEnd?: boolean;
|
||||
starts?: string;
|
||||
subLanguage?: string;
|
||||
subLanguageMode?: string;
|
||||
relevance?: number;
|
||||
variants?: IMode[];
|
||||
}
|
||||
|
||||
export interface IMode extends IModeBase
|
||||
{
|
||||
keywords?: any;
|
||||
contains?: IMode[];
|
||||
}
|
||||
|
||||
export interface ICompiledMode extends IModeBase
|
||||
{
|
||||
compiled: boolean;
|
||||
contains?: ICompiledMode[];
|
||||
keywords?: Object;
|
||||
terminators: RegExp;
|
||||
terminator_end?: string;
|
||||
}
|
||||
|
||||
export interface IOptions
|
||||
{
|
||||
classPrefix?: string;
|
||||
tabReplace?: string;
|
||||
useBR?: boolean;
|
||||
languages?: string[];
|
||||
}
|
||||
}
|
||||
export = hljs;
|
||||
}
|
8521
src/typings/lodash/lodash.d.ts
vendored
8521
src/typings/lodash/lodash.d.ts
vendored
File diff suppressed because it is too large
Load Diff
121
src/typings/marked/marked.d.ts
vendored
121
src/typings/marked/marked.d.ts
vendored
@@ -1,121 +0,0 @@
|
||||
// Type definitions for Marked
|
||||
// Project: https://github.com/chjj/marked
|
||||
// Definitions by: William Orr <https://github.com/worr>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
interface MarkedStatic {
|
||||
/**
|
||||
* Compiles markdown to HTML.
|
||||
*
|
||||
* @param src String of markdown source to be compiled
|
||||
* @param callback Function called when the markdownString has been fully parsed when using async highlighting
|
||||
* @return String of compiled HTML
|
||||
*/
|
||||
(src: string, callback: Function): string;
|
||||
|
||||
/**
|
||||
* Compiles markdown to HTML.
|
||||
*
|
||||
* @param src String of markdown source to be compiled
|
||||
* @param options Hash of options
|
||||
* @param callback Function called when the markdownString has been fully parsed when using async highlighting
|
||||
* @return String of compiled HTML
|
||||
*/
|
||||
(src: string, options?: MarkedOptions, callback?: Function): string;
|
||||
|
||||
/**
|
||||
* @param src String of markdown source to be compiled
|
||||
* @param options Hash of options
|
||||
*/
|
||||
lexer(src: string, options?: MarkedOptions): any[];
|
||||
|
||||
/**
|
||||
* Compiles markdown to HTML.
|
||||
*
|
||||
* @param src String of markdown source to be compiled
|
||||
* @param callback Function called when the markdownString has been fully parsed when using async highlighting
|
||||
* @return String of compiled HTML
|
||||
*/
|
||||
parse(src: string, callback: Function): string;
|
||||
|
||||
/**
|
||||
* Compiles markdown to HTML.
|
||||
*
|
||||
* @param src String of markdown source to be compiled
|
||||
* @param options Hash of options
|
||||
* @param callback Function called when the markdownString has been fully parsed when using async highlighting
|
||||
* @return String of compiled HTML
|
||||
*/
|
||||
parse(src: string, options?: MarkedOptions, callback?: Function): string;
|
||||
|
||||
/**
|
||||
* @param options Hash of options
|
||||
*/
|
||||
parser(src: any[], options?: MarkedOptions): string;
|
||||
|
||||
/**
|
||||
* Sets the default options.
|
||||
*
|
||||
* @param options Hash of options
|
||||
*/
|
||||
setOptions(options: MarkedOptions): void;
|
||||
}
|
||||
|
||||
interface MarkedOptions {
|
||||
/**
|
||||
* Enable GitHub flavored markdown.
|
||||
*/
|
||||
gfm?: boolean;
|
||||
|
||||
/**
|
||||
* Enable GFM tables. This option requires the gfm option to be true.
|
||||
*/
|
||||
tables?: boolean;
|
||||
|
||||
/**
|
||||
* Enable GFM line breaks. This option requires the gfm option to be true.
|
||||
*/
|
||||
breaks?: boolean;
|
||||
|
||||
/**
|
||||
* Conform to obscure parts of markdown.pl as much as possible. Don't fix any of the original markdown bugs or poor behavior.
|
||||
*/
|
||||
pedantic?: boolean;
|
||||
|
||||
/**
|
||||
* Sanitize the output. Ignore any HTML that has been input.
|
||||
*/
|
||||
sanitize?: boolean;
|
||||
|
||||
/**
|
||||
* Use smarter list behavior than the original markdown. May eventually be default with the old behavior moved into pedantic.
|
||||
*/
|
||||
smartLists?: boolean;
|
||||
|
||||
/**
|
||||
* Shows an HTML error message when rendering fails.
|
||||
*/
|
||||
silent?: boolean;
|
||||
|
||||
/**
|
||||
* A function to highlight code blocks. The function takes three arguments: code, lang, and callback.
|
||||
*/
|
||||
highlight? (code: string, lang: string, callback?: Function): string;
|
||||
|
||||
/**
|
||||
* Set the prefix for code block classes.
|
||||
*/
|
||||
langPrefix?: string;
|
||||
|
||||
/**
|
||||
* Use "smart" typograhic punctuation for things like quotes and dashes.
|
||||
*/
|
||||
smartypants?: boolean;
|
||||
}
|
||||
|
||||
declare module "marked" {
|
||||
export = marked;
|
||||
}
|
||||
|
||||
declare var marked: MarkedStatic;
|
47
src/typings/minimatch/minimatch.d.ts
vendored
47
src/typings/minimatch/minimatch.d.ts
vendored
@@ -1,47 +0,0 @@
|
||||
// Type definitions for Minimatch 1.0.0
|
||||
// Project: https://github.com/isaacs/minimatch
|
||||
// Definitions by: vvakame <https://github.com/vvakame/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
declare module "minimatch" {
|
||||
|
||||
function M(target:string, pattern:string, options?:M.IOptions): boolean;
|
||||
|
||||
module M {
|
||||
function match(filenames:string[], pattern:string, options?:IOptions):string[];
|
||||
function filter(pattern:string, options?:IOptions): (target: string) => boolean;
|
||||
|
||||
var Minimatch:IMinimatchStatic;
|
||||
|
||||
interface IOptions {
|
||||
debug?:boolean;
|
||||
nobrace?:boolean;
|
||||
noglobstar?:boolean;
|
||||
dot?:boolean;
|
||||
noext?:boolean;
|
||||
nocase?:boolean;
|
||||
nonull?:boolean;
|
||||
matchBase?:boolean;
|
||||
nocomment?:boolean;
|
||||
nonegate?:boolean;
|
||||
flipNegate?:boolean;
|
||||
}
|
||||
|
||||
interface IMinimatchStatic {
|
||||
new (pattern:string, options?:IOptions):IMinimatch;
|
||||
}
|
||||
|
||||
interface IMinimatch {
|
||||
debug():void;
|
||||
make():void;
|
||||
parseNegate():void;
|
||||
braceExpand(pattern:string, options:IOptions):void;
|
||||
parse(pattern:string, isSub?:boolean):void;
|
||||
makeRe():RegExp; // regexp or boolean
|
||||
match(file:string):boolean;
|
||||
matchOne(files:string[], pattern:string[], partial:any):boolean;
|
||||
}
|
||||
}
|
||||
|
||||
export = M;
|
||||
}
|
@@ -1,32 +0,0 @@
|
||||
/// <reference path="node-progress.d.ts"/>
|
||||
|
||||
var ProgressBar = require('progress');
|
||||
|
||||
|
||||
/**
|
||||
* Usage example from https://github.com/tj/node-progress
|
||||
*/
|
||||
var bar = new ProgressBar(':bar', { total: 10 });
|
||||
var timer = setInterval(function () {
|
||||
bar.tick();
|
||||
if (bar.complete) {
|
||||
console.log('\ncomplete\n');
|
||||
clearInterval(timer);
|
||||
}
|
||||
}, 100);
|
||||
|
||||
|
||||
/**
|
||||
* Custom token example from https://github.com/tj/node-progress
|
||||
*/
|
||||
var bar = new ProgressBar(':current: :token1 :token2', { total: 3 });
|
||||
|
||||
bar.tick({
|
||||
'token1': "Hello",
|
||||
'token2': "World!\n"
|
||||
});
|
||||
|
||||
bar.tick(2, {
|
||||
'token1': "Goodbye",
|
||||
'token2': "World!"
|
||||
});
|
121
src/typings/node-progress/node-progress.d.ts
vendored
121
src/typings/node-progress/node-progress.d.ts
vendored
@@ -1,121 +0,0 @@
|
||||
// Type definitions for node-progress v1.1.8
|
||||
// Project: https://github.com/tj/node-progress
|
||||
// Definitions by: Sebastian Lenz <https://github.com/sebastian-lenz>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../node/node.d.ts"/>
|
||||
|
||||
|
||||
declare module "progress"
|
||||
{
|
||||
/**
|
||||
* These are keys in the options object you can pass to the progress bar along with total as seen in the example above.
|
||||
*/
|
||||
interface ProgressBarOptions
|
||||
{
|
||||
/**
|
||||
* Total number of ticks to complete.
|
||||
*/
|
||||
total:number;
|
||||
|
||||
/**
|
||||
* The displayed width of the progress bar defaulting to total.
|
||||
*/
|
||||
width?:number;
|
||||
|
||||
/**
|
||||
* The output stream defaulting to stderr.
|
||||
*/
|
||||
stream?:NodeJS.WritableStream;
|
||||
|
||||
/**
|
||||
* Completion character defaulting to "=".
|
||||
*/
|
||||
complete?:string;
|
||||
|
||||
/**
|
||||
* Incomplete character defaulting to "-".
|
||||
*/
|
||||
incomplete?:string;
|
||||
|
||||
/**
|
||||
* Option to clear the bar on completion defaulting to false.
|
||||
*/
|
||||
clear?:boolean;
|
||||
|
||||
/**
|
||||
* Optional function to call when the progress bar completes.
|
||||
*/
|
||||
callback?:Function;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Flexible ascii progress bar.
|
||||
*/
|
||||
class ProgressBar
|
||||
{
|
||||
/**
|
||||
* Initialize a `ProgressBar` with the given `fmt` string and `options` or
|
||||
* `total`.
|
||||
*
|
||||
* Options:
|
||||
* - `total` total number of ticks to complete
|
||||
* - `width` the displayed width of the progress bar defaulting to total
|
||||
* - `stream` the output stream defaulting to stderr
|
||||
* - `complete` completion character defaulting to "="
|
||||
* - `incomplete` incomplete character defaulting to "-"
|
||||
* - `renderThrottle` minimum time between updates in milliseconds defaulting to 16
|
||||
* - `callback` optional function to call when the progress bar completes
|
||||
* - `clear` will clear the progress bar upon termination
|
||||
*
|
||||
* Tokens:
|
||||
* - `:bar` the progress bar itself
|
||||
* - `:current` current tick number
|
||||
* - `:total` total ticks
|
||||
* - `:elapsed` time elapsed in seconds
|
||||
* - `:percent` completion percentage
|
||||
* - `:eta` eta in seconds
|
||||
*/
|
||||
constructor(format:string, total:number);
|
||||
constructor(format:string, options:ProgressBarOptions);
|
||||
|
||||
|
||||
/**
|
||||
* "tick" the progress bar with optional `len` and optional `tokens`.
|
||||
*/
|
||||
tick(tokens?:any):void;
|
||||
tick(count?:number, tokens?:any):void;
|
||||
|
||||
|
||||
/**
|
||||
* Method to render the progress bar with optional `tokens` to place in the
|
||||
* progress bar's `fmt` field.
|
||||
*/
|
||||
render(tokens?:any):void;
|
||||
|
||||
|
||||
/**
|
||||
* "update" the progress bar to represent an exact percentage.
|
||||
* The ratio (between 0 and 1) specified will be multiplied by `total` and
|
||||
* floored, representing the closest available "tick." For example, if a
|
||||
* progress bar has a length of 3 and `update(0.5)` is called, the progress
|
||||
* will be set to 1.
|
||||
*
|
||||
* A ratio of 0.5 will attempt to set the progress to halfway.
|
||||
*
|
||||
* @param ratio The ratio (between 0 and 1 inclusive) to set the
|
||||
* overall completion to.
|
||||
*/
|
||||
update(ratio:number, tokens?:any):void;
|
||||
|
||||
|
||||
/**
|
||||
* Terminates a progress bar.
|
||||
*/
|
||||
terminate():void;
|
||||
}
|
||||
|
||||
|
||||
export = ProgressBar;
|
||||
}
|
2079
src/typings/node/node.d.ts
vendored
2079
src/typings/node/node.d.ts
vendored
File diff suppressed because it is too large
Load Diff
537
src/typings/shelljs/shelljs.d.ts
vendored
537
src/typings/shelljs/shelljs.d.ts
vendored
@@ -1,537 +0,0 @@
|
||||
// Type definitions for ShellJS v0.3.0
|
||||
// Project: http://shelljs.org
|
||||
// Definitions by: Niklas Mollenhauer <https://github.com/nikeee>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
|
||||
///<reference path="../node/node.d.ts"/>
|
||||
|
||||
declare module "shelljs"
|
||||
{
|
||||
import child = require("child_process");
|
||||
|
||||
/**
|
||||
* Changes to directory dir for the duration of the script
|
||||
* @param {string} dir Directory to change in.
|
||||
*/
|
||||
export function cd(dir: string): void;
|
||||
|
||||
/**
|
||||
* Returns the current directory.
|
||||
* @return {string} The current directory.
|
||||
*/
|
||||
export function pwd(): string;
|
||||
|
||||
/**
|
||||
* Returns array of files in the given path, or in current directory if no path provided.
|
||||
* @param {string[]} ...paths Paths to search.
|
||||
* @return {string[]} An array of files in the given path(s).
|
||||
*/
|
||||
export function ls(...paths: string[]): string[];
|
||||
|
||||
/**
|
||||
* Returns array of files in the given path, or in current directory if no path provided.
|
||||
* @param {string} options Available options: -R (recursive), -A (all files, include files beginning with ., except for . and ..)
|
||||
* @param {string[]} ...paths Paths to search.
|
||||
* @return {string[]} An array of files in the given path(s).
|
||||
*/
|
||||
export function ls(options: string, ...paths: string[]): string[];
|
||||
|
||||
/**
|
||||
* Returns array of files in the given path, or in current directory if no path provided.
|
||||
* @param {string[]} paths Paths to search.
|
||||
* @return {string[]} An array of files in the given path(s).
|
||||
*/
|
||||
export function ls(paths: string[]): string[];
|
||||
|
||||
/**
|
||||
* Returns array of files in the given path, or in current directory if no path provided.
|
||||
* @param {string} options Available options: -R (recursive), -A (all files, include files beginning with ., except for . and ..)
|
||||
* @param {string[]} paths Paths to search.
|
||||
* @return {string[]} An array of files in the given path(s).
|
||||
*/
|
||||
export function ls(options: string, paths: string[]): string[];
|
||||
|
||||
/**
|
||||
* Returns array of all files (however deep) in the given paths.
|
||||
* @param {string[]} ...path The path(s) to search.
|
||||
* @return {string[]} An array of all files (however deep) in the given path(s).
|
||||
*/
|
||||
export function find(...path: string[]): string[];
|
||||
|
||||
/**
|
||||
* Returns array of all files (however deep) in the given paths.
|
||||
* @param {string[]} path The path(s) to search.
|
||||
* @return {string[]} An array of all files (however deep) in the given path(s).
|
||||
*/
|
||||
export function find(path: string[]): string[];
|
||||
|
||||
/**
|
||||
* Copies files. The wildcard * is accepted.
|
||||
* @param {string} source The source.
|
||||
* @param {string} dest The destination.
|
||||
*/
|
||||
export function cp(source: string, dest: string): void;
|
||||
|
||||
/**
|
||||
* Copies files. The wildcard * is accepted.
|
||||
* @param {string[]} source The source.
|
||||
* @param {string} dest The destination.
|
||||
*/
|
||||
export function cp(source: string[], dest: string): void;
|
||||
|
||||
/**
|
||||
* Copies files. The wildcard * is accepted.
|
||||
* @param {string} options Available options: -f (force), -r, -R (recursive)
|
||||
* @param {strin]} source The source.
|
||||
* @param {string} dest The destination.
|
||||
*/
|
||||
export function cp(options: string, source: string, dest: string): void;
|
||||
|
||||
/**
|
||||
* Copies files. The wildcard * is accepted.
|
||||
* @param {string} options Available options: -f (force), -r, -R (recursive)
|
||||
* @param {string[]} source The source.
|
||||
* @param {string} dest The destination.
|
||||
*/
|
||||
export function cp(options: string, source: string[], dest: string): void;
|
||||
|
||||
/**
|
||||
* Removes files. The wildcard * is accepted.
|
||||
* @param {string[]} ...files Files to remove.
|
||||
*/
|
||||
export function rm(...files: string[]): void;
|
||||
|
||||
/**
|
||||
* Removes files. The wildcard * is accepted.
|
||||
* @param {string[]} files Files to remove.
|
||||
*/
|
||||
export function rm(files: string[]): void;
|
||||
|
||||
/**
|
||||
* Removes files. The wildcard * is accepted.
|
||||
* @param {string} options Available options: -f (force), -r, -R (recursive)
|
||||
* @param {string[]} ...files Files to remove.
|
||||
*/
|
||||
export function rm(options: string, ...files: string[]): void;
|
||||
|
||||
/**
|
||||
* Removes files. The wildcard * is accepted.
|
||||
* @param {string} options Available options: -f (force), -r, -R (recursive)
|
||||
* @param {string[]} ...files Files to remove.
|
||||
*/
|
||||
export function rm(options: string, files: string[]): void;
|
||||
|
||||
/**
|
||||
* Moves files. The wildcard * is accepted.
|
||||
* @param {string} source The source.
|
||||
* @param {string} dest The destination.
|
||||
*/
|
||||
export function mv(source: string, dest: string): void;
|
||||
|
||||
/**
|
||||
* Moves files. The wildcard * is accepted.
|
||||
* @param {string[]} source The source.
|
||||
* @param {string} dest The destination.
|
||||
*/
|
||||
export function mv(source: string[], dest: string): void;
|
||||
|
||||
/**
|
||||
* Creates directories.
|
||||
* @param {string[]} ...dir Directories to create.
|
||||
*/
|
||||
export function mkdir(...dir: string[]): void;
|
||||
|
||||
/**
|
||||
* Creates directories.
|
||||
* @param {string[]} dir Directories to create.
|
||||
*/
|
||||
export function mkdir(dir: string[]): void;
|
||||
|
||||
/**
|
||||
* Creates directories.
|
||||
* @param {string} options Available options: p (full paths, will create intermediate dirs if necessary)
|
||||
* @param {string[]} ...dir The directories to create.
|
||||
*/
|
||||
export function mkdir(options: string, ...dir: string[]): void;
|
||||
|
||||
/**
|
||||
* Creates directories.
|
||||
* @param {string} options Available options: p (full paths, will create intermediate dirs if necessary)
|
||||
* @param {string[]} dir The directories to create.
|
||||
*/
|
||||
export function mkdir(options: string, dir: string[]): void;
|
||||
|
||||
/**
|
||||
* Evaluates expression using the available primaries and returns corresponding value.
|
||||
* @param {string} option '-b': true if path is a block device; '-c': true if path is a character device; '-d': true if path is a directory; '-e': true if path exists; '-f': true if path is a regular file; '-L': true if path is a symboilc link; '-p': true if path is a pipe (FIFO); '-S': true if path is a socket
|
||||
* @param {string} path The path.
|
||||
* @return {boolean} See option parameter.
|
||||
*/
|
||||
export function test(option: string, path: string): boolean;
|
||||
|
||||
/**
|
||||
* Returns a string containing the given file, or a concatenated string containing the files if more than one file is given (a new line character is introduced between each file). Wildcard * accepted.
|
||||
* @param {string[]} ...files Files to use.
|
||||
* @return {string} A string containing the given file, or a concatenated string containing the files if more than one file is given (a new line character is introduced between each file).
|
||||
*/
|
||||
export function cat(...files: string[]): string;
|
||||
|
||||
/**
|
||||
* Returns a string containing the given file, or a concatenated string containing the files if more than one file is given (a new line character is introduced between each file). Wildcard * accepted.
|
||||
* @param {string[]} files Files to use.
|
||||
* @return {string} A string containing the given file, or a concatenated string containing the files if more than one file is given (a new line character is introduced between each file).
|
||||
*/
|
||||
export function cat(files: string[]): string;
|
||||
|
||||
|
||||
// Does not work yet.
|
||||
export interface String
|
||||
{
|
||||
/**
|
||||
* Analogous to the redirection operator > in Unix, but works with JavaScript strings (such as those returned by cat, grep, etc). Like Unix redirections, to() will overwrite any existing file!
|
||||
* @param {string} file The file to use.
|
||||
*/
|
||||
to(file: string): void;
|
||||
|
||||
/**
|
||||
* Analogous to the redirect-and-append operator >> in Unix, but works with JavaScript strings (such as those returned by cat, grep, etc).
|
||||
* @param {string} file The file to append to.
|
||||
*/
|
||||
toEnd(file: string): void;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads an input string from file and performs a JavaScript replace() on the input using the given search regex and replacement string or function. Returns the new string after replacement.
|
||||
* @param {RegExp} searchRegex The regular expression to use for search.
|
||||
* @param {string} replacement The replacement.
|
||||
* @param {string} file The file to process.
|
||||
* @return {string} The new string after replacement.
|
||||
*/
|
||||
export function sed(searchRegex: RegExp, replacement: string, file: string): string;
|
||||
|
||||
/**
|
||||
* Reads an input string from file and performs a JavaScript replace() on the input using the given search regex and replacement string or function. Returns the new string after replacement.
|
||||
* @param {string} searchRegex The regular expression to use for search.
|
||||
* @param {string} replacement The replacement.
|
||||
* @param {string} file The file to process.
|
||||
* @return {string} The new string after replacement.
|
||||
*/
|
||||
export function sed(searchRegex: string, replacement: string, file: string): string;
|
||||
|
||||
/**
|
||||
* Reads an input string from file and performs a JavaScript replace() on the input using the given search regex and replacement string or function. Returns the new string after replacement.
|
||||
* @param {string} options Available options: -i (Replace contents of 'file' in-place. Note that no backups will be created!)
|
||||
* @param {RegExp} searchRegex The regular expression to use for search.
|
||||
* @param {string} replacement The replacement.
|
||||
* @param {string} file The file to process.
|
||||
* @return {string} The new string after replacement.
|
||||
*/
|
||||
export function sed(options: string, searchRegex: RegExp, replacement: string, file: string): string;
|
||||
|
||||
/**
|
||||
* Reads an input string from file and performs a JavaScript replace() on the input using the given search regex and replacement string or function. Returns the new string after replacement.
|
||||
* @param {string} options Available options: -i (Replace contents of 'file' in-place. Note that no backups will be created!)
|
||||
* @param {string} searchRegex The regular expression to use for search.
|
||||
* @param {string} replacement The replacement.
|
||||
* @param {string} file The file to process.
|
||||
* @return {string} The new string after replacement.
|
||||
*/
|
||||
export function sed(options: string, searchRegex: string, replacement: string, file: string): string;
|
||||
|
||||
/**
|
||||
* Reads input string from given files and returns a string containing all lines of the file that match the given regex_filter. Wildcard * accepted.
|
||||
* @param {RegExp} regex_filter The regular expression to use.
|
||||
* @param {string[]} ...files The files to process.
|
||||
* @return {string} Returns a string containing all lines of the file that match the given regex_filter.
|
||||
*/
|
||||
export function grep(regex_filter: RegExp, ...files: string[]): string;
|
||||
|
||||
/**
|
||||
* Reads input string from given files and returns a string containing all lines of the file that match the given regex_filter. Wildcard * accepted.
|
||||
* @param {RegExp} regex_filter The regular expression to use.
|
||||
* @param {string[]} ...files The files to process.
|
||||
* @return {string} Returns a string containing all lines of the file that match the given regex_filter.
|
||||
*/
|
||||
export function grep(regex_filter: RegExp, files: string[]): string;
|
||||
|
||||
/**
|
||||
* Reads input string from given files and returns a string containing all lines of the file that match the given regex_filter. Wildcard * accepted.
|
||||
* @param {string} options Available options: -v (Inverse the sense of the regex and print the lines not matching the criteria.)
|
||||
* @param {string} regex_filter The regular expression to use.
|
||||
* @param {string[]} ...files The files to process.
|
||||
* @return {string} Returns a string containing all lines of the file that match the given regex_filter.
|
||||
*/
|
||||
export function grep(options: string, regex_filter: string, ...files: string[]): string;
|
||||
|
||||
/**
|
||||
* Reads input string from given files and returns a string containing all lines of the file that match the given regex_filter. Wildcard * accepted.
|
||||
* @param {string} options Available options: -v (Inverse the sense of the regex and print the lines not matching the criteria.)
|
||||
* @param {string} regex_filter The regular expression to use.
|
||||
* @param {string[]} files The files to process.
|
||||
* @return {string} Returns a string containing all lines of the file that match the given regex_filter.
|
||||
*/
|
||||
export function grep(options: string, regex_filter: string, files: string[]): string;
|
||||
|
||||
/**
|
||||
* Searches for command in the system's PATH. On Windows looks for .exe, .cmd, and .bat extensions.
|
||||
* @param {string} command The command to search for.
|
||||
* @return {string} Returns string containing the absolute path to the command.
|
||||
*/
|
||||
export function which(command: string): string;
|
||||
|
||||
/**
|
||||
* Prints string to stdout, and returns string with additional utility methods like .to().
|
||||
* @param {string[]} ...text The text to print.
|
||||
* @return {string} Returns the string that was passed as argument.
|
||||
*/
|
||||
export function echo(...text: string[]): string;
|
||||
|
||||
/**
|
||||
* Save the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.
|
||||
* @param {"+N"} dir Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.
|
||||
* @return {string[]} Returns an array of paths in the stack.
|
||||
*/
|
||||
export function pushd(dir: "+N"): string[];
|
||||
|
||||
/**
|
||||
* Save the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.
|
||||
* @param {"-N"} dir Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.
|
||||
* @return {string[]} Returns an array of paths in the stack.
|
||||
*/
|
||||
export function pushd(dir: "-N"): string[];
|
||||
|
||||
/**
|
||||
* Save the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.
|
||||
* @param {string} dir Makes the current working directory be the top of the stack, and then executes the equivalent of cd dir.
|
||||
* @return {string[]} Returns an array of paths in the stack.
|
||||
*/
|
||||
export function pushd(dir: string): string[];
|
||||
|
||||
/**
|
||||
* Save the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.
|
||||
* @param {string} options Available options: -n (Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated)
|
||||
* @param {"+N"} dir Brings the Nth directory (counting from the left of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.
|
||||
* @return {string[]} Returns an array of paths in the stack.
|
||||
*/
|
||||
export function pushd(options: string, dir: "+N"): string[];
|
||||
|
||||
/**
|
||||
* Save the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.
|
||||
* @param {string} options Available options: -n (Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated)
|
||||
* @param {"-N"} dir Brings the Nth directory (counting from the right of the list printed by dirs, starting with zero) to the top of the list by rotating the stack.
|
||||
* @return {string[]} Returns an array of paths in the stack.
|
||||
*/
|
||||
export function pushd(options: string, dir: "-N"): string[];
|
||||
|
||||
/**
|
||||
* Save the current directory on the top of the directory stack and then cd to dir. With no arguments, pushd exchanges the top two directories. Returns an array of paths in the stack.
|
||||
* @param {string} options Available options: -n (Suppresses the normal change of directory when adding directories to the stack, so that only the stack is manipulated)
|
||||
* @param {string} dir Makes the current working directory be the top of the stack, and then executes the equivalent of cd dir.
|
||||
* @return {string[]} Returns an array of paths in the stack.
|
||||
*/
|
||||
export function pushd(options: string, dir: string): string[];
|
||||
|
||||
/**
|
||||
* When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.
|
||||
* @param {"+N"} dir Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero.
|
||||
* @return {string[]} Returns an array of paths in the stack.
|
||||
*/
|
||||
export function popd(dir: "+N"): string[];
|
||||
|
||||
/**
|
||||
* When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.
|
||||
* @return {string[]} Returns an array of paths in the stack.
|
||||
*/
|
||||
export function popd(): string[];
|
||||
|
||||
/**
|
||||
* When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.
|
||||
* @param {"-N"} dir Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero.
|
||||
* @return {string[]} Returns an array of paths in the stack.
|
||||
*/
|
||||
export function popd(dir: "-N"): string[];
|
||||
|
||||
/**
|
||||
* When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.
|
||||
* @param {string} dir You can only use -N and +N.
|
||||
* @return {string[]} Returns an array of paths in the stack.
|
||||
*/
|
||||
export function popd(dir: string): string[];
|
||||
|
||||
/**
|
||||
* When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.
|
||||
* @param {string} options Available options: -n (Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated)
|
||||
* @param {"+N"} dir Removes the Nth directory (counting from the left of the list printed by dirs), starting with zero.
|
||||
* @return {string[]} Returns an array of paths in the stack.
|
||||
*/
|
||||
export function popd(options: string, dir: "+N"): string[];
|
||||
|
||||
/**
|
||||
* When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.
|
||||
* @param {string} options Available options: -n (Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated)
|
||||
* @param {"-N"} dir Removes the Nth directory (counting from the right of the list printed by dirs), starting with zero.
|
||||
* @return {string[]} Returns an array of paths in the stack.
|
||||
*/
|
||||
export function popd(options: string, dir: "-N"): string[];
|
||||
|
||||
/**
|
||||
* When no arguments are given, popd removes the top directory from the stack and performs a cd to the new top directory. The elements are numbered from 0 starting at the first directory listed with dirs; i.e., popd is equivalent to popd +0. Returns an array of paths in the stack.
|
||||
* @param {string} options Available options: -n (Suppresses the normal change of directory when removing directories from the stack, so that only the stack is manipulated)
|
||||
* @param {string} dir You can only use -N and +N.
|
||||
* @return {string[]} Returns an array of paths in the stack.
|
||||
*/
|
||||
export function popd(options: string, dir: string): string[];
|
||||
|
||||
/**
|
||||
* Clears the directory stack by deleting all of the elements.
|
||||
* @param {"-c"} options Clears the directory stack by deleting all of the elements.
|
||||
* @return {string[]} Returns an array of paths in the stack, or a single path if +N or -N was specified.
|
||||
*/
|
||||
export function dirs(options: "-c"): string[];
|
||||
|
||||
/**
|
||||
* Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified.
|
||||
* @param {"+N"} options Displays the Nth directory (counting from the left of the list printed by dirs when invoked without options), starting with zero.
|
||||
* @return {string[]} Returns an array of paths in the stack, or a single path if +N or -N was specified.
|
||||
*/
|
||||
export function dirs(options: "+N"): string;
|
||||
|
||||
/**
|
||||
* Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified.
|
||||
* @param {"-N"} options Displays the Nth directory (counting from the right of the list printed by dirs when invoked without options), starting with zero.
|
||||
* @return {string[]} Returns an array of paths in the stack, or a single path if +N or -N was specified.
|
||||
*/
|
||||
export function dirs(options: "-N"): string;
|
||||
|
||||
/**
|
||||
* Display the list of currently remembered directories. Returns an array of paths in the stack, or a single path if +N or -N was specified.
|
||||
* @param {string} options Available options: -c, -N, +N. You can only use those.
|
||||
* @return {any} Returns an array of paths in the stack, or a single path if +N or -N was specified.
|
||||
*/
|
||||
export function dirs(options: string): any;
|
||||
|
||||
/**
|
||||
* Links source to dest. Use -f to force the link, should dest already exist.
|
||||
* @param {string} source The source.
|
||||
* @param {string} dest The destination.
|
||||
*/
|
||||
export function ln(source: string, dest: string): void;
|
||||
|
||||
/**
|
||||
* Links source to dest. Use -f to force the link, should dest already exist.
|
||||
* @param {string} options Available options: s (symlink), f (force)
|
||||
* @param {string} source The source.
|
||||
* @param {string} dest The destination.
|
||||
*/
|
||||
export function ln(options: string, source: string, dest: string): void;
|
||||
|
||||
/**
|
||||
* Exits the current process with the given exit code.
|
||||
* @param {number} code The exit code.
|
||||
*/
|
||||
export function exit(code: number): void;
|
||||
|
||||
/**
|
||||
* Object containing environment variables (both getter and setter). Shortcut to process.env.
|
||||
*/
|
||||
export var env: { [key: string]: string };
|
||||
|
||||
/**
|
||||
* Executes the given command synchronously.
|
||||
* @param {string} command The command to execute.
|
||||
* @return {ExecOutputReturnValue} Returns an object containing the return code and output as string.
|
||||
*/
|
||||
export function exec(command: string): ExecOutputReturnValue;
|
||||
/**
|
||||
* Executes the given command synchronously.
|
||||
* @param {string} command The command to execute.
|
||||
* @param {ExecOptions} options Silence and synchronous options.
|
||||
* @return {ExecOutputReturnValue | child.ChildProcess} Returns an object containing the return code and output as string, or if {async:true} was passed, a ChildProcess.
|
||||
*/
|
||||
export function exec(command: string, options: ExecOptions): ExecOutputReturnValue | child.ChildProcess;
|
||||
/**
|
||||
* Executes the given command synchronously.
|
||||
* @param {string} command The command to execute.
|
||||
* @param {ExecOptions} options Silence and synchronous options.
|
||||
* @param {ExecCallback} callback Receives code and output asynchronously.
|
||||
*/
|
||||
export function exec(command: string, options: ExecOptions, callback: ExecCallback): child.ChildProcess;
|
||||
/**
|
||||
* Executes the given command synchronously.
|
||||
* @param {string} command The command to execute.
|
||||
* @param {ExecCallback} callback Receives code and output asynchronously.
|
||||
*/
|
||||
export function exec(command: string, callback: ExecCallback): child.ChildProcess;
|
||||
|
||||
export interface ExecCallback {
|
||||
(code: number, output: string): any;
|
||||
}
|
||||
|
||||
export interface ExecOptions {
|
||||
silent?: boolean;
|
||||
async?: boolean;
|
||||
}
|
||||
|
||||
export interface ExecOutputReturnValue
|
||||
{
|
||||
code: number;
|
||||
stdout: string;
|
||||
stderr: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Alters the permissions of a file or directory by either specifying the absolute permissions in octal form or expressing the changes in symbols. This command tries to mimic the POSIX behavior as much as possible. Notable exceptions:
|
||||
* - In symbolic modes, 'a-r' and '-r' are identical. No consideration is given to the umask.
|
||||
* - There is no "quiet" option since default behavior is to run silent.
|
||||
* @param {number} octalMode The access mode. Octal.
|
||||
* @param {string} file The file to use.
|
||||
*/
|
||||
export function chmod(octalMode: number, file: string): void;
|
||||
|
||||
/**
|
||||
* Alters the permissions of a file or directory by either specifying the absolute permissions in octal form or expressing the changes in symbols. This command tries to mimic the POSIX behavior as much as possible. Notable exceptions:
|
||||
* - In symbolic modes, 'a-r' and '-r' are identical. No consideration is given to the umask.
|
||||
* - There is no "quiet" option since default behavior is to run silent.
|
||||
* @param {string} mode The access mode. Can be an octal string or a symbolic mode string.
|
||||
* @param {string} file The file to use.
|
||||
*/
|
||||
export function chmod(mode: string, file: string): void;
|
||||
|
||||
// Non-Unix commands
|
||||
|
||||
/**
|
||||
* Searches and returns string containing a writeable, platform-dependent temporary directory. Follows Python's tempfile algorithm.
|
||||
* @return {string} The temp file path.
|
||||
*/
|
||||
export function tempdir(): string;
|
||||
|
||||
/**
|
||||
* Tests if error occurred in the last command.
|
||||
* @return {string} Returns null if no error occurred, otherwise returns string explaining the error
|
||||
*/
|
||||
export function error(): string;
|
||||
|
||||
// Configuration
|
||||
|
||||
interface ShellConfig
|
||||
{
|
||||
/**
|
||||
* Suppresses all command output if true, except for echo() calls. Default is false.
|
||||
* @type {boolean}
|
||||
*/
|
||||
silent: boolean;
|
||||
|
||||
/**
|
||||
* If true the script will die on errors. Default is false.
|
||||
* @type {boolean}
|
||||
*/
|
||||
fatal: boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* The shelljs configuration.
|
||||
* @type {ShellConfig}
|
||||
*/
|
||||
export var config: ShellConfig;
|
||||
}
|
9
src/typings/tsd.d.ts
vendored
9
src/typings/tsd.d.ts
vendored
@@ -1,9 +0,0 @@
|
||||
/// <reference path="fs-extra/fs-extra.d.ts" />
|
||||
/// <reference path="handlebars/handlebars.d.ts" />
|
||||
/// <reference path="highlightjs/highlightjs.d.ts" />
|
||||
/// <reference path="marked/marked.d.ts" />
|
||||
/// <reference path="minimatch/minimatch.d.ts" />
|
||||
/// <reference path="node/node.d.ts" />
|
||||
/// <reference path="shelljs/shelljs.d.ts" />
|
||||
/// <reference path="lodash/lodash.d.ts" />
|
||||
|
6439
src/typings/typescript/typescript.d.ts
vendored
6439
src/typings/typescript/typescript.d.ts
vendored
File diff suppressed because it is too large
Load Diff
@@ -1,4 +1,4 @@
|
||||
var TypeDoc = require("../index.js");
|
||||
var TypeDoc = require("../");
|
||||
var FS = require('fs');
|
||||
var Path = require('path');
|
||||
var Assert = require("assert");
|
||||
@@ -7,6 +7,7 @@ var Assert = require("assert");
|
||||
function compareReflections(fixture, spec, path) {
|
||||
var key;
|
||||
path = (path ? path + '/' : '') + spec.name;
|
||||
Assert.deepEqual(fixture, spec);
|
||||
|
||||
for (key in spec) {
|
||||
if (!spec.hasOwnProperty(key)) continue;
|
||||
@@ -66,7 +67,6 @@ describe('Converter', function() {
|
||||
logger: 'none',
|
||||
target: 'ES5',
|
||||
module: 'CommonJS',
|
||||
noLib: true,
|
||||
experimentalDecorators: true,
|
||||
jsx: 'react'
|
||||
});
|
||||
|
@@ -1,5 +1,3 @@
|
||||
/// <reference path="../lib.core.d.ts" />
|
||||
|
||||
/**
|
||||
* A variable that is made private via comment.
|
||||
* @private
|
||||
@@ -53,4 +51,4 @@ export class PrivateClass
|
||||
* @protected
|
||||
*/
|
||||
fakeProtectedFunction() {}
|
||||
}
|
||||
}
|
||||
|
@@ -39,6 +39,13 @@
|
||||
"comment": {
|
||||
"shortText": "A variable that is made private via comment."
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "access.ts",
|
||||
"line": 35,
|
||||
"character": 23
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "string"
|
||||
@@ -56,6 +63,13 @@
|
||||
"comment": {
|
||||
"shortText": "A variable that is made protected via comment."
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "access.ts",
|
||||
"line": 41,
|
||||
"character": 25
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "string"
|
||||
@@ -87,6 +101,13 @@
|
||||
"name": "void"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "access.ts",
|
||||
"line": 47,
|
||||
"character": 23
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -115,6 +136,13 @@
|
||||
"name": "void"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "access.ts",
|
||||
"line": 53,
|
||||
"character": 25
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -135,6 +163,13 @@
|
||||
7
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "access.ts",
|
||||
"line": 29,
|
||||
"character": 25
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -149,6 +184,13 @@
|
||||
"comment": {
|
||||
"shortText": "A variable that is made private via comment."
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "access.ts",
|
||||
"line": 5,
|
||||
"character": 30
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "string"
|
||||
@@ -167,6 +209,13 @@
|
||||
"comment": {
|
||||
"shortText": "A variable that is made protected via comment."
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "access.ts",
|
||||
"line": 11,
|
||||
"character": 32
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "string"
|
||||
@@ -199,6 +248,13 @@
|
||||
"name": "void"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "access.ts",
|
||||
"line": 17,
|
||||
"character": 35
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -227,6 +283,13 @@
|
||||
"name": "void"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "access.ts",
|
||||
"line": 23,
|
||||
"character": 37
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -254,6 +317,13 @@
|
||||
13
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "access.ts",
|
||||
"line": 1,
|
||||
"character": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
@@ -1,5 +1,3 @@
|
||||
/// <reference path="../lib.core.d.ts" />
|
||||
|
||||
/**
|
||||
* TestClass comment short text.
|
||||
*
|
||||
@@ -75,4 +73,4 @@ export class TestSubClass extends TestClass
|
||||
constructor(p1, private p2: string, public p3: number, public p4) {
|
||||
super();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -60,6 +60,13 @@
|
||||
"id": 2
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "class.ts",
|
||||
"line": 23,
|
||||
"character": 36
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -74,6 +81,13 @@
|
||||
"comment": {
|
||||
"shortText": "privateProperty short text."
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "class.ts",
|
||||
"line": 18,
|
||||
"character": 27
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"isArray": true,
|
||||
@@ -92,6 +106,13 @@
|
||||
"comment": {
|
||||
"shortText": "publicProperty short text."
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "class.ts",
|
||||
"line": 13,
|
||||
"character": 25
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "string"
|
||||
@@ -109,6 +130,13 @@
|
||||
"comment": {
|
||||
"shortText": "privateProperty short text."
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "class.ts",
|
||||
"line": 23,
|
||||
"character": 25
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "reference",
|
||||
"name": "TestClass",
|
||||
@@ -139,6 +167,13 @@
|
||||
"name": "void"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "class.ts",
|
||||
"line": 44,
|
||||
"character": 25
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -165,6 +200,13 @@
|
||||
"name": "void"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "class.ts",
|
||||
"line": 39,
|
||||
"character": 29
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -191,6 +233,13 @@
|
||||
"name": "void"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "class.ts",
|
||||
"line": 34,
|
||||
"character": 23
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -217,6 +266,13 @@
|
||||
"name": "void"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "class.ts",
|
||||
"line": 49,
|
||||
"character": 23
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -248,6 +304,13 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "class.ts",
|
||||
"line": 8,
|
||||
"character": 22
|
||||
}
|
||||
],
|
||||
"extendedBy": [
|
||||
{
|
||||
"type": "reference",
|
||||
@@ -356,6 +419,13 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "class.ts",
|
||||
"line": 63,
|
||||
"character": 34
|
||||
}
|
||||
],
|
||||
"overwrites": {
|
||||
"type": "reference",
|
||||
"name": "TestClass.__constructor",
|
||||
@@ -375,6 +445,13 @@
|
||||
"comment": {
|
||||
"shortText": "Private string property"
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "class.ts",
|
||||
"line": 73,
|
||||
"character": 30
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "string"
|
||||
@@ -393,6 +470,13 @@
|
||||
"comment": {
|
||||
"shortText": "Public number property"
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "class.ts",
|
||||
"line": 73,
|
||||
"character": 49
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "number"
|
||||
@@ -411,6 +495,13 @@
|
||||
"comment": {
|
||||
"shortText": "Public implicit any property\n"
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "class.ts",
|
||||
"line": 73,
|
||||
"character": 68
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "any"
|
||||
@@ -428,6 +519,13 @@
|
||||
"comment": {
|
||||
"shortText": "publicProperty short text."
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "class.ts",
|
||||
"line": 13,
|
||||
"character": 25
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "string"
|
||||
@@ -450,6 +548,13 @@
|
||||
"comment": {
|
||||
"shortText": "privateProperty short text."
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "class.ts",
|
||||
"line": 23,
|
||||
"character": 25
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "reference",
|
||||
"name": "TestClass",
|
||||
@@ -491,6 +596,13 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "class.ts",
|
||||
"line": 63,
|
||||
"character": 29
|
||||
}
|
||||
],
|
||||
"overwrites": {
|
||||
"type": "reference",
|
||||
"name": "TestClass.protectedMethod",
|
||||
@@ -527,6 +639,13 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "class.ts",
|
||||
"line": 58,
|
||||
"character": 23
|
||||
}
|
||||
],
|
||||
"overwrites": {
|
||||
"type": "reference",
|
||||
"name": "TestClass.publicMethod",
|
||||
@@ -563,6 +682,13 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "class.ts",
|
||||
"line": 49,
|
||||
"character": 23
|
||||
}
|
||||
],
|
||||
"inheritedFrom": {
|
||||
"type": "reference",
|
||||
"name": "TestClass.staticMethod",
|
||||
@@ -599,6 +725,13 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "class.ts",
|
||||
"line": 53,
|
||||
"character": 25
|
||||
}
|
||||
],
|
||||
"extendedTypes": [
|
||||
{
|
||||
"type": "reference",
|
||||
@@ -617,6 +750,13 @@
|
||||
16
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "class.ts",
|
||||
"line": 1,
|
||||
"character": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
@@ -1,6 +1,3 @@
|
||||
/// <reference path="../lib.core.d.ts" />
|
||||
|
||||
|
||||
/**
|
||||
* A class with constructor properties.
|
||||
*/
|
||||
@@ -28,4 +25,4 @@ class Vector3 extends Vector2
|
||||
constructor(x:number, public y:number, public z:number) {
|
||||
super(x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -75,6 +75,13 @@
|
||||
"id": 2
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "constructor-properties.ts",
|
||||
"line": 5,
|
||||
"character": 1
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -89,6 +96,13 @@
|
||||
"comment": {
|
||||
"shortText": "X component of the Vector"
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "constructor-properties.ts",
|
||||
"line": 10,
|
||||
"character": 24
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "number"
|
||||
@@ -106,6 +120,13 @@
|
||||
"comment": {
|
||||
"shortText": "Y component of the Vector\n"
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "constructor-properties.ts",
|
||||
"line": 10,
|
||||
"character": 41
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "number"
|
||||
@@ -129,6 +150,13 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "constructor-properties.ts",
|
||||
"line": 4,
|
||||
"character": 13
|
||||
}
|
||||
],
|
||||
"extendedBy": [
|
||||
{
|
||||
"type": "reference",
|
||||
@@ -218,6 +246,13 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "constructor-properties.ts",
|
||||
"line": 19,
|
||||
"character": 1
|
||||
}
|
||||
],
|
||||
"overwrites": {
|
||||
"type": "reference",
|
||||
"name": "Vector2.__constructor",
|
||||
@@ -236,6 +271,13 @@
|
||||
"comment": {
|
||||
"shortText": "X component of the Vector"
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "constructor-properties.ts",
|
||||
"line": 10,
|
||||
"character": 24
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "number"
|
||||
@@ -258,6 +300,13 @@
|
||||
"comment": {
|
||||
"shortText": "Y component of the Vector"
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "constructor-properties.ts",
|
||||
"line": 25,
|
||||
"character": 34
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "number"
|
||||
@@ -280,6 +329,13 @@
|
||||
"comment": {
|
||||
"shortText": "Z component of the Vector\n"
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "constructor-properties.ts",
|
||||
"line": 25,
|
||||
"character": 51
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "number"
|
||||
@@ -304,6 +360,13 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "constructor-properties.ts",
|
||||
"line": 18,
|
||||
"character": 13
|
||||
}
|
||||
],
|
||||
"extendedTypes": [
|
||||
{
|
||||
"type": "reference",
|
||||
@@ -322,6 +385,13 @@
|
||||
9
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "constructor-properties.ts",
|
||||
"line": 1,
|
||||
"character": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
@@ -1,6 +1,3 @@
|
||||
/// <reference path="../lib.core.d.ts" />
|
||||
|
||||
|
||||
/**
|
||||
* A decorated class.
|
||||
*/
|
||||
@@ -48,4 +45,4 @@ function decoratorWithOptions(options:{name:string}):ClassDecorator {
|
||||
return function (target) {
|
||||
target.options = options;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -79,6 +79,13 @@
|
||||
"name": "void"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "decorators.ts",
|
||||
"line": 14,
|
||||
"character": 19
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -90,6 +97,13 @@
|
||||
3
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "decorators.ts",
|
||||
"line": 7,
|
||||
"character": 20
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -170,6 +184,13 @@
|
||||
"name": "void"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "decorators.ts",
|
||||
"line": 21,
|
||||
"character": 22
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -223,6 +244,13 @@
|
||||
"comment": {
|
||||
"text": "A property on the options object of this decorator.\n"
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "decorators.ts",
|
||||
"line": 44,
|
||||
"character": 43
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "string"
|
||||
@@ -237,6 +265,13 @@
|
||||
17
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "decorators.ts",
|
||||
"line": 44,
|
||||
"character": 38
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -247,6 +282,13 @@
|
||||
"name": "ClassDecorator"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "decorators.ts",
|
||||
"line": 44,
|
||||
"character": 29
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -293,6 +335,13 @@
|
||||
"name": "MethodDecorator"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "decorators.ts",
|
||||
"line": 31,
|
||||
"character": 27
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -313,6 +362,13 @@
|
||||
10
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "decorators.ts",
|
||||
"line": 1,
|
||||
"character": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
@@ -1,6 +1,3 @@
|
||||
/// <reference path="../lib.core.d.ts" />
|
||||
|
||||
|
||||
/**
|
||||
* Destructuring objects.
|
||||
*/
|
||||
@@ -25,4 +22,4 @@ var [destructArrayWithIgnoresA, , ...destructArrayWithIgnoresRest] = [1, 2, 3, 4
|
||||
/**
|
||||
* Destructuring function parameters.
|
||||
*/
|
||||
function drawText({text = "", location:[x, y] = [0, 0], bold = false}) { }
|
||||
function drawText({text = "", location:[x, y] = [0, 0], bold = false}) { }
|
||||
|
@@ -20,6 +20,13 @@
|
||||
"kind": 32,
|
||||
"kindString": "Variable",
|
||||
"flags": {},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "destructuring.ts",
|
||||
"line": 10,
|
||||
"character": 19
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "number"
|
||||
@@ -31,6 +38,13 @@
|
||||
"kind": 32,
|
||||
"kindString": "Variable",
|
||||
"flags": {},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "destructuring.ts",
|
||||
"line": 10,
|
||||
"character": 35
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "string"
|
||||
@@ -42,6 +56,13 @@
|
||||
"kind": 32,
|
||||
"kindString": "Variable",
|
||||
"flags": {},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "destructuring.ts",
|
||||
"line": 10,
|
||||
"character": 51
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "number"
|
||||
@@ -54,6 +75,13 @@
|
||||
"kind": 32,
|
||||
"kindString": "Variable",
|
||||
"flags": {},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "destructuring.ts",
|
||||
"line": 20,
|
||||
"character": 30
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "number"
|
||||
@@ -65,6 +93,13 @@
|
||||
"kind": 32,
|
||||
"kindString": "Variable",
|
||||
"flags": {},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "destructuring.ts",
|
||||
"line": 20,
|
||||
"character": 65
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "reference",
|
||||
"name": "Array",
|
||||
@@ -82,6 +117,13 @@
|
||||
"kind": 32,
|
||||
"kindString": "Variable",
|
||||
"flags": {},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "destructuring.ts",
|
||||
"line": 15,
|
||||
"character": 77
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "reference",
|
||||
"name": "Array",
|
||||
@@ -99,6 +141,13 @@
|
||||
"kind": 32,
|
||||
"kindString": "Variable",
|
||||
"flags": {},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "destructuring.ts",
|
||||
"line": 15,
|
||||
"character": 27
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "number"
|
||||
@@ -110,6 +159,13 @@
|
||||
"kind": 32,
|
||||
"kindString": "Variable",
|
||||
"flags": {},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "destructuring.ts",
|
||||
"line": 15,
|
||||
"character": 51
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "number"
|
||||
@@ -121,6 +177,13 @@
|
||||
"kind": 32,
|
||||
"kindString": "Variable",
|
||||
"flags": {},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "destructuring.ts",
|
||||
"line": 4,
|
||||
"character": 20
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "number"
|
||||
@@ -132,6 +195,13 @@
|
||||
"kind": 32,
|
||||
"kindString": "Variable",
|
||||
"flags": {},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "destructuring.ts",
|
||||
"line": 4,
|
||||
"character": 37
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "string"
|
||||
@@ -143,6 +213,13 @@
|
||||
"kind": 32,
|
||||
"kindString": "Variable",
|
||||
"flags": {},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "destructuring.ts",
|
||||
"line": 4,
|
||||
"character": 54
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "number"
|
||||
@@ -187,6 +264,13 @@
|
||||
"kind": 32,
|
||||
"kindString": "Variable",
|
||||
"flags": {},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "destructuring.ts",
|
||||
"line": 25,
|
||||
"character": 60
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "boolean"
|
||||
@@ -199,6 +283,13 @@
|
||||
"kind": 32,
|
||||
"kindString": "Variable",
|
||||
"flags": {},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "destructuring.ts",
|
||||
"line": 25,
|
||||
"character": 45
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "tuple",
|
||||
"elements": [
|
||||
@@ -220,6 +311,13 @@
|
||||
"kind": 32,
|
||||
"kindString": "Variable",
|
||||
"flags": {},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "destructuring.ts",
|
||||
"line": 25,
|
||||
"character": 23
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "string"
|
||||
@@ -237,6 +335,13 @@
|
||||
17
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "destructuring.ts",
|
||||
"line": 25,
|
||||
"character": 18
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -247,6 +352,13 @@
|
||||
"name": "void"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "destructuring.ts",
|
||||
"line": 25,
|
||||
"character": 17
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -275,6 +387,13 @@
|
||||
13
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "destructuring.ts",
|
||||
"line": 1,
|
||||
"character": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
@@ -1,6 +1,3 @@
|
||||
/// <reference path="../lib.core.d.ts" />
|
||||
|
||||
|
||||
/**
|
||||
* This is a simple enumeration.
|
||||
*/
|
||||
@@ -60,4 +57,4 @@ export module ModuleEnum
|
||||
* This is a function appended to an enumeration.
|
||||
*/
|
||||
function enumFunction() {}
|
||||
}
|
||||
}
|
||||
|
@@ -37,6 +37,13 @@
|
||||
"comment": {
|
||||
"shortText": "This is the first enum member."
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "enum.ts",
|
||||
"line": 31,
|
||||
"character": 14
|
||||
}
|
||||
],
|
||||
"defaultValue": "1"
|
||||
},
|
||||
{
|
||||
@@ -50,6 +57,13 @@
|
||||
"comment": {
|
||||
"shortText": "This is the second enum member."
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "enum.ts",
|
||||
"line": 36,
|
||||
"character": 14
|
||||
}
|
||||
],
|
||||
"defaultValue": "2"
|
||||
},
|
||||
{
|
||||
@@ -63,6 +77,13 @@
|
||||
"comment": {
|
||||
"shortText": "This is the third enum member."
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "enum.ts",
|
||||
"line": 41,
|
||||
"character": 14
|
||||
}
|
||||
],
|
||||
"defaultValue": "4"
|
||||
},
|
||||
{
|
||||
@@ -76,6 +97,13 @@
|
||||
"comment": {
|
||||
"shortText": "This is a variable appended to an enumeration."
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "enum.ts",
|
||||
"line": 53,
|
||||
"character": 17
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "string"
|
||||
@@ -104,6 +132,13 @@
|
||||
"name": "void"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "enum.ts",
|
||||
"line": 59,
|
||||
"character": 25
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -131,6 +166,18 @@
|
||||
11
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "enum.ts",
|
||||
"line": 26,
|
||||
"character": 22
|
||||
},
|
||||
{
|
||||
"fileName": "enum.ts",
|
||||
"line": 48,
|
||||
"character": 24
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -156,6 +203,13 @@
|
||||
"comment": {
|
||||
"shortText": "This is the first enum member."
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "enum.ts",
|
||||
"line": 9,
|
||||
"character": 14
|
||||
}
|
||||
],
|
||||
"defaultValue": "1"
|
||||
},
|
||||
{
|
||||
@@ -169,6 +223,13 @@
|
||||
"comment": {
|
||||
"shortText": "This is the second enum member."
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "enum.ts",
|
||||
"line": 14,
|
||||
"character": 14
|
||||
}
|
||||
],
|
||||
"defaultValue": "2"
|
||||
},
|
||||
{
|
||||
@@ -182,6 +243,13 @@
|
||||
"comment": {
|
||||
"shortText": "This is the third enum member."
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "enum.ts",
|
||||
"line": 19,
|
||||
"character": 14
|
||||
}
|
||||
],
|
||||
"defaultValue": "4"
|
||||
}
|
||||
],
|
||||
@@ -195,6 +263,13 @@
|
||||
5
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "enum.ts",
|
||||
"line": 4,
|
||||
"character": 22
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -207,6 +282,13 @@
|
||||
2
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "enum.ts",
|
||||
"line": 1,
|
||||
"character": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
@@ -1,5 +1,3 @@
|
||||
/// <reference path="../lib.core.d.ts" />
|
||||
|
||||
/**
|
||||
* Encapsulates some information for background http transfers.
|
||||
*
|
||||
@@ -42,4 +40,4 @@ interface Test
|
||||
* @param handler A function that will be called with general event data upon successful completion
|
||||
*/
|
||||
on(event: "complete", handler: (e:any) => void): void;
|
||||
}
|
||||
}
|
||||
|
@@ -103,6 +103,13 @@
|
||||
"name": "void"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "events-overloads.ts",
|
||||
"line": 15,
|
||||
"character": 30
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -179,6 +186,13 @@
|
||||
"name": "void"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "events-overloads.ts",
|
||||
"line": 24,
|
||||
"character": 31
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -255,6 +269,13 @@
|
||||
"name": "void"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "events-overloads.ts",
|
||||
"line": 33,
|
||||
"character": 34
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -331,6 +352,13 @@
|
||||
"name": "void"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "events-overloads.ts",
|
||||
"line": 42,
|
||||
"character": 34
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -341,6 +369,28 @@
|
||||
"name": "void"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "events-overloads.ts",
|
||||
"line": 15,
|
||||
"character": 6
|
||||
},
|
||||
{
|
||||
"fileName": "events-overloads.ts",
|
||||
"line": 24,
|
||||
"character": 6
|
||||
},
|
||||
{
|
||||
"fileName": "events-overloads.ts",
|
||||
"line": 33,
|
||||
"character": 6
|
||||
},
|
||||
{
|
||||
"fileName": "events-overloads.ts",
|
||||
"line": 42,
|
||||
"character": 6
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -352,6 +402,13 @@
|
||||
3
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "events-overloads.ts",
|
||||
"line": 6,
|
||||
"character": 14
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -363,6 +420,13 @@
|
||||
2
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "events-overloads.ts",
|
||||
"line": 1,
|
||||
"character": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
@@ -1,6 +1,3 @@
|
||||
/// <reference path="../lib.core.d.ts" />
|
||||
|
||||
|
||||
class EventDispatcher
|
||||
{
|
||||
/**
|
||||
@@ -9,4 +6,4 @@ class EventDispatcher
|
||||
*/
|
||||
static EVENT_CLICK:string = 'click';
|
||||
|
||||
}
|
||||
}
|
||||
|
@@ -32,6 +32,13 @@
|
||||
"comment": {
|
||||
"shortText": "This is an event documentation."
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "events.ts",
|
||||
"line": 7,
|
||||
"character": 22
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "string"
|
||||
@@ -47,6 +54,13 @@
|
||||
3
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "events.ts",
|
||||
"line": 1,
|
||||
"character": 21
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -58,6 +72,13 @@
|
||||
2
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "events.ts",
|
||||
"line": 1,
|
||||
"character": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
5
test/converter/export-assignment/export-assignment.ts
Normal file
5
test/converter/export-assignment/export-assignment.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
function add(x: number, y: number) {
|
||||
return x + y;
|
||||
}
|
||||
|
||||
export = add;
|
99
test/converter/export-assignment/specs.json
Normal file
99
test/converter/export-assignment/specs.json
Normal file
@@ -0,0 +1,99 @@
|
||||
{
|
||||
"id": 0,
|
||||
"name": "typedoc",
|
||||
"kind": 0,
|
||||
"flags": {},
|
||||
"children": [
|
||||
{
|
||||
"id": 1,
|
||||
"name": "\"export-assignment\"",
|
||||
"kind": 1,
|
||||
"kindString": "External module",
|
||||
"flags": {
|
||||
"isExported": true
|
||||
},
|
||||
"originalName": "%BASE%/export-assignment/export-assignment.ts",
|
||||
"children": [
|
||||
{
|
||||
"id": 2,
|
||||
"name": "add",
|
||||
"kind": 64,
|
||||
"kindString": "Function",
|
||||
"flags": {
|
||||
"isExported": true,
|
||||
"hasExportAssignment": true
|
||||
},
|
||||
"signatures": [
|
||||
{
|
||||
"id": 3,
|
||||
"name": "add",
|
||||
"kind": 4096,
|
||||
"kindString": "Call signature",
|
||||
"flags": {},
|
||||
"parameters": [
|
||||
{
|
||||
"id": 4,
|
||||
"name": "x",
|
||||
"kind": 32768,
|
||||
"kindString": "Parameter",
|
||||
"flags": {},
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "number"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 5,
|
||||
"name": "y",
|
||||
"kind": 32768,
|
||||
"kindString": "Parameter",
|
||||
"flags": {},
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "number"
|
||||
}
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "number"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "export-assignment.ts",
|
||||
"line": 1,
|
||||
"character": 12
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"groups": [
|
||||
{
|
||||
"title": "Functions",
|
||||
"kind": 64,
|
||||
"children": [
|
||||
2
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "export-assignment.ts",
|
||||
"line": 1,
|
||||
"character": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"groups": [
|
||||
{
|
||||
"title": "External modules",
|
||||
"kind": 1,
|
||||
"children": [
|
||||
1
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
2
test/converter/export-default/export-default.ts
Normal file
2
test/converter/export-default/export-default.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
const x = 5;
|
||||
export default x;
|
66
test/converter/export-default/specs.json
Normal file
66
test/converter/export-default/specs.json
Normal file
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"id": 0,
|
||||
"name": "typedoc",
|
||||
"kind": 0,
|
||||
"flags": {},
|
||||
"children": [
|
||||
{
|
||||
"id": 1,
|
||||
"name": "\"export-default\"",
|
||||
"kind": 1,
|
||||
"kindString": "External module",
|
||||
"flags": {
|
||||
"isExported": true
|
||||
},
|
||||
"originalName": "%BASE%/export-default/export-default.ts",
|
||||
"children": [
|
||||
{
|
||||
"id": 2,
|
||||
"name": "x",
|
||||
"kind": 32,
|
||||
"kindString": "Variable",
|
||||
"flags": {
|
||||
"isExported": true
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "export-default.ts",
|
||||
"line": 1,
|
||||
"character": 7
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "unknown",
|
||||
"name": "5"
|
||||
},
|
||||
"defaultValue": "5"
|
||||
}
|
||||
],
|
||||
"groups": [
|
||||
{
|
||||
"title": "Variables",
|
||||
"kind": 32,
|
||||
"children": [
|
||||
2
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "export-default.ts",
|
||||
"line": 1,
|
||||
"character": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"groups": [
|
||||
{
|
||||
"title": "External modules",
|
||||
"kind": 1,
|
||||
"children": [
|
||||
1
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
5
test/converter/export/export.ts
Normal file
5
test/converter/export/export.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
export const x = 5;
|
||||
|
||||
export function add(x: number, y: number) {
|
||||
return x + y;
|
||||
}
|
126
test/converter/export/specs.json
Normal file
126
test/converter/export/specs.json
Normal file
@@ -0,0 +1,126 @@
|
||||
{
|
||||
"id": 0,
|
||||
"name": "typedoc",
|
||||
"kind": 0,
|
||||
"flags": {},
|
||||
"children": [
|
||||
{
|
||||
"id": 1,
|
||||
"name": "\"export\"",
|
||||
"kind": 1,
|
||||
"kindString": "External module",
|
||||
"flags": {
|
||||
"isExported": true
|
||||
},
|
||||
"originalName": "%BASE%/export/export.ts",
|
||||
"children": [
|
||||
{
|
||||
"id": 2,
|
||||
"name": "x",
|
||||
"kind": 32,
|
||||
"kindString": "Variable",
|
||||
"flags": {
|
||||
"isExported": true
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "export.ts",
|
||||
"line": 1,
|
||||
"character": 14
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "unknown",
|
||||
"name": "5"
|
||||
},
|
||||
"defaultValue": "5"
|
||||
},
|
||||
{
|
||||
"id": 3,
|
||||
"name": "add",
|
||||
"kind": 64,
|
||||
"kindString": "Function",
|
||||
"flags": {
|
||||
"isExported": true
|
||||
},
|
||||
"signatures": [
|
||||
{
|
||||
"id": 4,
|
||||
"name": "add",
|
||||
"kind": 4096,
|
||||
"kindString": "Call signature",
|
||||
"flags": {},
|
||||
"parameters": [
|
||||
{
|
||||
"id": 5,
|
||||
"name": "x",
|
||||
"kind": 32768,
|
||||
"kindString": "Parameter",
|
||||
"flags": {},
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "number"
|
||||
}
|
||||
},
|
||||
{
|
||||
"id": 6,
|
||||
"name": "y",
|
||||
"kind": 32768,
|
||||
"kindString": "Parameter",
|
||||
"flags": {},
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "number"
|
||||
}
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "number"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "export.ts",
|
||||
"line": 3,
|
||||
"character": 19
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"groups": [
|
||||
{
|
||||
"title": "Variables",
|
||||
"kind": 32,
|
||||
"children": [
|
||||
2
|
||||
]
|
||||
},
|
||||
{
|
||||
"title": "Functions",
|
||||
"kind": 64,
|
||||
"children": [
|
||||
3
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "export.ts",
|
||||
"line": 1,
|
||||
"character": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"groups": [
|
||||
{
|
||||
"title": "External modules",
|
||||
"kind": 1,
|
||||
"children": [
|
||||
1
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
@@ -1,6 +1,3 @@
|
||||
/// <reference path="../lib.core.d.ts" />
|
||||
|
||||
|
||||
/**
|
||||
* This is an internal function.
|
||||
*/
|
||||
@@ -153,4 +150,4 @@ export module moduleFunction
|
||||
function prepend() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -67,6 +67,13 @@
|
||||
"comment": {
|
||||
"shortText": "This variable is appended to a function."
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "function.ts",
|
||||
"line": 137,
|
||||
"character": 24
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "string"
|
||||
@@ -93,6 +100,13 @@
|
||||
"name": "void"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "function.ts",
|
||||
"line": 143,
|
||||
"character": 19
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -116,6 +130,13 @@
|
||||
"name": "void"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "function.ts",
|
||||
"line": 150,
|
||||
"character": 20
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -135,6 +156,18 @@
|
||||
41
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "function.ts",
|
||||
"line": 126,
|
||||
"character": 30
|
||||
},
|
||||
{
|
||||
"fileName": "function.ts",
|
||||
"line": 132,
|
||||
"character": 28
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -160,6 +193,13 @@
|
||||
"name": "void"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "function.ts",
|
||||
"line": 10,
|
||||
"character": 32
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -263,6 +303,13 @@
|
||||
"name": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "function.ts",
|
||||
"line": 65,
|
||||
"character": 36
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -320,6 +367,13 @@
|
||||
"name": "void"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "function.ts",
|
||||
"line": 52,
|
||||
"character": 41
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -390,6 +444,13 @@
|
||||
"name": "number"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "function.ts",
|
||||
"line": 30,
|
||||
"character": 38
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -433,6 +494,13 @@
|
||||
"name": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "function.ts",
|
||||
"line": 82,
|
||||
"character": 25
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -456,6 +524,13 @@
|
||||
"name": "void"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "function.ts",
|
||||
"line": 4,
|
||||
"character": 25
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -540,6 +615,13 @@
|
||||
"comment": {
|
||||
"text": "A value of the object.\n"
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "function.ts",
|
||||
"line": 100,
|
||||
"character": 46
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "string"
|
||||
@@ -554,6 +636,13 @@
|
||||
34
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "function.ts",
|
||||
"line": 100,
|
||||
"character": 41
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -564,6 +653,23 @@
|
||||
"name": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "function.ts",
|
||||
"line": 92,
|
||||
"character": 34
|
||||
},
|
||||
{
|
||||
"fileName": "function.ts",
|
||||
"line": 100,
|
||||
"character": 34
|
||||
},
|
||||
{
|
||||
"fileName": "function.ts",
|
||||
"line": 108,
|
||||
"character": 34
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -610,6 +716,13 @@
|
||||
"name": "number"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "function.ts",
|
||||
"line": 41,
|
||||
"character": 27
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -635,6 +748,13 @@
|
||||
11
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "function.ts",
|
||||
"line": 1,
|
||||
"character": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
@@ -1,5 +1,3 @@
|
||||
/// <reference path="../lib.core.d.ts" />
|
||||
|
||||
/**
|
||||
* GenericClass short text.
|
||||
* @param T Generic parameter.
|
||||
@@ -36,4 +34,4 @@ class GenericClass<T> {
|
||||
/**
|
||||
* NonGenericClass short text.
|
||||
*/
|
||||
class NonGenericClass extends GenericClass<string> {}
|
||||
class NonGenericClass extends GenericClass<string> {}
|
||||
|
@@ -77,6 +77,13 @@
|
||||
"id": 2
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "generic-class.ts",
|
||||
"line": 14,
|
||||
"character": 25
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -90,6 +97,13 @@
|
||||
"comment": {
|
||||
"shortText": "Generic property."
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "generic-class.ts",
|
||||
"line": 9,
|
||||
"character": 19
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "typeParameter",
|
||||
"name": "T"
|
||||
@@ -106,6 +120,13 @@
|
||||
"comment": {
|
||||
"shortText": "Generic property array."
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "generic-class.ts",
|
||||
"line": 14,
|
||||
"character": 20
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "typeParameter",
|
||||
"isArray": true,
|
||||
@@ -134,6 +155,13 @@
|
||||
"name": "T"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "generic-class.ts",
|
||||
"line": 28,
|
||||
"character": 12
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -161,6 +189,13 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "generic-class.ts",
|
||||
"line": 5,
|
||||
"character": 18
|
||||
}
|
||||
],
|
||||
"extendedBy": [
|
||||
{
|
||||
"type": "reference",
|
||||
@@ -226,6 +261,13 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "generic-class.ts",
|
||||
"line": 14,
|
||||
"character": 25
|
||||
}
|
||||
],
|
||||
"inheritedFrom": {
|
||||
"type": "reference",
|
||||
"name": "GenericClass.__constructor",
|
||||
@@ -243,6 +285,13 @@
|
||||
"comment": {
|
||||
"shortText": "Generic property."
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "generic-class.ts",
|
||||
"line": 9,
|
||||
"character": 19
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "string"
|
||||
@@ -264,6 +313,13 @@
|
||||
"comment": {
|
||||
"shortText": "Generic property array."
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "generic-class.ts",
|
||||
"line": 14,
|
||||
"character": 20
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"isArray": true,
|
||||
@@ -303,6 +359,13 @@
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "generic-class.ts",
|
||||
"line": 28,
|
||||
"character": 12
|
||||
}
|
||||
],
|
||||
"inheritedFrom": {
|
||||
"type": "reference",
|
||||
"name": "GenericClass.getValue",
|
||||
@@ -334,6 +397,13 @@
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "generic-class.ts",
|
||||
"line": 37,
|
||||
"character": 21
|
||||
}
|
||||
],
|
||||
"extendedTypes": [
|
||||
{
|
||||
"type": "reference",
|
||||
@@ -358,6 +428,13 @@
|
||||
11
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "generic-class.ts",
|
||||
"line": 1,
|
||||
"character": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
@@ -1,5 +1,3 @@
|
||||
/// <reference path="../lib.core.d.ts" />
|
||||
|
||||
/**
|
||||
* Generic function short text.
|
||||
* @param T Generic function type parameter.
|
||||
@@ -20,4 +18,4 @@ function genericFunction<T extends Object>(value:T):T {
|
||||
*/
|
||||
function functionWithGenericArrayParameter<T>(param:T, params:T[]):T[] {
|
||||
return params;
|
||||
}
|
||||
}
|
||||
|
@@ -77,6 +77,13 @@
|
||||
"name": "T"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "generic-function.ts",
|
||||
"line": 19,
|
||||
"character": 42
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -141,6 +148,13 @@
|
||||
}
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "generic-function.ts",
|
||||
"line": 7,
|
||||
"character": 24
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -153,6 +167,13 @@
|
||||
2
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "generic-function.ts",
|
||||
"line": 1,
|
||||
"character": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
@@ -1,6 +1,3 @@
|
||||
/// <reference path="../lib.core.d.ts" />
|
||||
|
||||
|
||||
class GetterSetter
|
||||
{
|
||||
private _name:string;
|
||||
@@ -12,4 +9,4 @@ class GetterSetter
|
||||
get readOnlyName():string { return this._name; }
|
||||
|
||||
set writeOnlyName(value:string) { this._name = value; }
|
||||
}
|
||||
}
|
||||
|
@@ -29,6 +29,13 @@
|
||||
"flags": {
|
||||
"isPrivate": true
|
||||
},
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "getter-setter.ts",
|
||||
"line": 3,
|
||||
"character": 17
|
||||
}
|
||||
],
|
||||
"type": {
|
||||
"type": "instrinct",
|
||||
"name": "string"
|
||||
@@ -78,6 +85,18 @@
|
||||
"name": "void"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "getter-setter.ts",
|
||||
"line": 6,
|
||||
"character": 12
|
||||
},
|
||||
{
|
||||
"fileName": "getter-setter.ts",
|
||||
"line": 7,
|
||||
"character": 12
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -98,6 +117,13 @@
|
||||
"name": "string"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "getter-setter.ts",
|
||||
"line": 9,
|
||||
"character": 20
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -131,6 +157,13 @@
|
||||
"name": "void"
|
||||
}
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "getter-setter.ts",
|
||||
"line": 11,
|
||||
"character": 21
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -151,6 +184,13 @@
|
||||
10
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "getter-setter.ts",
|
||||
"line": 1,
|
||||
"character": 18
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
@@ -162,6 +202,13 @@
|
||||
2
|
||||
]
|
||||
}
|
||||
],
|
||||
"sources": [
|
||||
{
|
||||
"fileName": "getter-setter.ts",
|
||||
"line": 1,
|
||||
"character": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
|
@@ -1,6 +1,3 @@
|
||||
/// <reference path="../lib.core.d.ts" />
|
||||
|
||||
|
||||
export interface IBreakpointRange { start: number; end: number }
|
||||
|
||||
var _breakpoints: {
|
||||
@@ -29,4 +26,4 @@ export function getBreakpoints() {
|
||||
}
|
||||
|
||||
return _breakpoints;
|
||||
}
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user