Updated some declaration
This commit is contained in:
parent
6ebe771178
commit
5f0c1b303a
24 changed files with 37293 additions and 78 deletions
37115
client/generated/client.js
Normal file
37115
client/generated/client.js
Normal file
File diff suppressed because one or more lines are too long
1
client/generated/client.js.map
Normal file
1
client/generated/client.js.map
Normal file
File diff suppressed because one or more lines are too long
|
@ -1,8 +1,9 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
BASEDIR=$(dirname "$0")
|
BASEDIR=$(dirname "$0")
|
||||||
|
# shellcheck disable=SC1090
|
||||||
source "${BASEDIR}/resolve_commands.sh"
|
source "${BASEDIR}/resolve_commands.sh"
|
||||||
cd "$BASEDIR/../"
|
cd "$BASEDIR/../" || { echo "Failed to enter parent directory!"; exit 1; }
|
||||||
|
|
||||||
function generate_link() {
|
function generate_link() {
|
||||||
if [[ ! -L $2 ]] || [[ "${BASH_ARGV[0]}" == "force" ]]; then
|
if [[ ! -L $2 ]] || [[ "${BASH_ARGV[0]}" == "force" ]]; then
|
||||||
|
@ -20,12 +21,19 @@ function replace_tribble() {
|
||||||
|
|
||||||
|
|
||||||
#Building the generator
|
#Building the generator
|
||||||
./tools/build_dtsgen.sh
|
./tools/build_dtsgen.sh; _exit_code=$?
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $_exit_code -ne 0 ]]; then
|
||||||
echo "Failed to build typescript declaration generator"
|
echo "Failed to build typescript declaration generator ($_exit_code)"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
#Shared
|
||||||
|
./shared/generate_declarations.sh; _exit_code=$?
|
||||||
|
[[ $_exit_code -ne 0 ]] && {
|
||||||
|
echo "Failed to generate shared ($_exit_code)"
|
||||||
|
}
|
||||||
|
|
||||||
|
exit 0
|
||||||
#Easy going: Each "module" has it's exports and imports
|
#Easy going: Each "module" has it's exports and imports
|
||||||
#So lets first build the exports and ignore any errors
|
#So lets first build the exports and ignore any errors
|
||||||
#Note: For the client we have to use the given file
|
#Note: For the client we have to use the given file
|
||||||
|
@ -40,12 +48,6 @@ npm run dtsgen -- --config client/tsconfig/dtsconfig.json -v
|
||||||
replace_tribble client/declarations/exports.d.ts
|
replace_tribble client/declarations/exports.d.ts
|
||||||
echo "Generated client declarations"
|
echo "Generated client declarations"
|
||||||
|
|
||||||
#Shared
|
|
||||||
./shared/generate_declarations.sh
|
|
||||||
[[ $? -ne 0 ]] && {
|
|
||||||
echo "Failed to generate shared"
|
|
||||||
}
|
|
||||||
|
|
||||||
#replace_tribble shared/declarations/exports.d.ts
|
#replace_tribble shared/declarations/exports.d.ts
|
||||||
echo "Generated shared declarations"
|
echo "Generated shared declarations"
|
||||||
|
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
BASEDIR=$(dirname "$0")
|
BASEDIR=$(dirname "$0")
|
||||||
cd "$BASEDIR"
|
cd "$BASEDIR" || { echo "Failed to enter script base dir"; exit 1; }
|
||||||
source ../scripts/resolve_commands.sh
|
source ../scripts/resolve_commands.sh
|
||||||
|
|
||||||
function generate_declaration() {
|
function generate_declaration() {
|
||||||
echo "Generating declarations for project $1 ($2)"
|
echo "Generating declarations for project $1 ($2)"
|
||||||
|
|
||||||
if [[ -e ${2} ]]; then
|
if [[ -e "${2}" ]]; then
|
||||||
rm ${2}
|
rm "${2}"; _exit_code=$?
|
||||||
if [[ $? -ne 0 ]]; then
|
if [[ $_exit_code -ne 0 ]]; then
|
||||||
echo "Failed to remove old declaration file ($2)!"
|
echo "Failed to remove old declaration file ($2): $_exit_code!"
|
||||||
echo "This could be critical later!"
|
echo "This could be critical later!"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
npm run dtsgen -- --config $(pwd)/tsconfig/$1 -v
|
npm run dtsgen -- --config "$(pwd)/tsconfig/$1" -v
|
||||||
if [[ ! -e $2 ]]; then
|
if [[ ! -e $2 ]]; then
|
||||||
echo "Failed to generate definitions"
|
echo "Failed to generate definitions"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
{
|
{
|
||||||
"source_files": [
|
"source_files": [
|
||||||
"../js/**/*.ts"
|
"**/*.ts"
|
||||||
],
|
],
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"../js/workers/**/*.ts"
|
"workers/**/*.ts"
|
||||||
],
|
],
|
||||||
"target_file": "../declarations/exports_app.d.ts"
|
"base_directory": "shared/js/",
|
||||||
|
"target_directory": "../declarations/shared-app",
|
||||||
|
"modular": true
|
||||||
}
|
}
|
|
@ -39,7 +39,7 @@ function append_modifier<T extends ts.Modifier["kind"]>(modifiers: ts.ModifiersA
|
||||||
|
|
||||||
const comparator = (a: ts.Modifier, b: ts.Modifier) => sort_oder[a.kind] - sort_oder[b.kind];
|
const comparator = (a: ts.Modifier, b: ts.Modifier) => sort_oder[a.kind] - sort_oder[b.kind];
|
||||||
return ts.createNodeArray(
|
return ts.createNodeArray(
|
||||||
[ts.createModifier(target as number), ...(modifiers || [])].map((e, index, array) => {
|
[ts.createModifier(target as number), ...(modifiers || [])].sort(comparator).map((e, index, array) => {
|
||||||
const range = ts.getCommentRange(e);
|
const range = ts.getCommentRange(e);
|
||||||
if(range.end === -1 && range.pos === -1)
|
if(range.end === -1 && range.pos === -1)
|
||||||
return e;
|
return e;
|
||||||
|
@ -51,7 +51,7 @@ function append_modifier<T extends ts.Modifier["kind"]>(modifiers: ts.ModifiersA
|
||||||
else
|
else
|
||||||
console.warn("Dropping comment on node because first node already has a comment");
|
console.warn("Dropping comment on node because first node already has a comment");
|
||||||
return e;
|
return e;
|
||||||
}).sort(comparator),
|
}),
|
||||||
(modifiers || {hasTrailingComma: false}).hasTrailingComma
|
(modifiers || {hasTrailingComma: false}).hasTrailingComma
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -167,6 +167,8 @@ export interface Settings {
|
||||||
log?: {
|
log?: {
|
||||||
unhandled_types: boolean;
|
unhandled_types: boolean;
|
||||||
} | boolean;
|
} | boolean;
|
||||||
|
|
||||||
|
module_mode?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
class _Settings implements Settings {
|
class _Settings implements Settings {
|
||||||
|
@ -182,7 +184,9 @@ class _Settings implements Settings {
|
||||||
unhandled_types: boolean;
|
unhandled_types: boolean;
|
||||||
} = {
|
} = {
|
||||||
unhandled_types: false
|
unhandled_types: false
|
||||||
}
|
};
|
||||||
|
|
||||||
|
module_mode?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
function specify_settings(settings?: Settings) : _Settings {
|
function specify_settings(settings?: Settings) : _Settings {
|
||||||
|
@ -201,7 +205,8 @@ function specify_settings(settings?: Settings) : _Settings {
|
||||||
result.log = {
|
result.log = {
|
||||||
unhandled_types: settings.log,
|
unhandled_types: settings.log,
|
||||||
};
|
};
|
||||||
|
if(typeof(settings.module_mode) !== "boolean")
|
||||||
|
result.module_mode = false;
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -210,7 +215,13 @@ export function generate(file: ts.SourceFile, settings?: Settings) : ts.Node[]{
|
||||||
const stack = new StackParameters();
|
const stack = new StackParameters();
|
||||||
const _settings = specify_settings(settings);
|
const _settings = specify_settings(settings);
|
||||||
|
|
||||||
|
stack.push({
|
||||||
|
flag_class: false,
|
||||||
|
flag_declare: false,
|
||||||
|
flag_namespace: _settings.module_mode
|
||||||
|
});
|
||||||
_generate(_settings, stack, layer, file);
|
_generate(_settings, stack, layer, file);
|
||||||
|
stack.pop();
|
||||||
|
|
||||||
return layer;
|
return layer;
|
||||||
}
|
}
|
||||||
|
@ -235,12 +246,9 @@ generators[SyntaxKind.ModuleBlock] = (settings, stack, node: ts.ModuleBlock) =>
|
||||||
};
|
};
|
||||||
|
|
||||||
generators[SyntaxKind.ModuleDeclaration] = (settings, stack, node: ts.ModuleDeclaration) => {
|
generators[SyntaxKind.ModuleDeclaration] = (settings, stack, node: ts.ModuleDeclaration) => {
|
||||||
switch (node.flags) {
|
//if (node.flags & ~(ts.NodeFlags.Namespace | ts.NodeFlags.NestedNamespace | ts.NodeFlags.ExportContext)) {
|
||||||
case ts.NodeFlags.Namespace:
|
// throw "Some module declaration flags are not jet supported (flags: " + Object.keys(ts.NodeFlags).filter(e => node.flags & ts.NodeFlags[e]).join(", ") + ")";
|
||||||
break;
|
//}
|
||||||
default:
|
|
||||||
//throw "flag " + node.flags + " isn't supported yet!"; /* TODO wrap with more info */
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
stack.push({
|
stack.push({
|
||||||
|
@ -425,24 +433,25 @@ generators[SyntaxKind.EnumDeclaration] = (settings, stack, node: ts.EnumDeclarat
|
||||||
return ts.createEnumDeclaration(undefined, append_export(append_declare(node.modifiers, !stack.flag_declare), stack.flag_namespace), node.name, members);
|
return ts.createEnumDeclaration(undefined, append_export(append_declare(node.modifiers, !stack.flag_declare), stack.flag_namespace), node.name, members);
|
||||||
};
|
};
|
||||||
|
|
||||||
generators[SyntaxKind.HeritageClause] = (settings, stack, node: ts.HeritageClause) => {
|
generators[SyntaxKind.HeritageClause] = () => undefined;
|
||||||
return undefined;
|
|
||||||
};
|
|
||||||
|
|
||||||
/* every variable in a block has no global scope! */
|
/* every variable in a block has no global scope! */
|
||||||
generators[SyntaxKind.Block] = (settings, stack, node: ts.Block) => {
|
generators[SyntaxKind.Block] = () => undefined;
|
||||||
return undefined;
|
generators[SyntaxKind.IfStatement] = () => undefined;
|
||||||
};
|
|
||||||
|
|
||||||
generators[SyntaxKind.IfStatement] = (settings, stack, node: ts.IfStatement) => {
|
/* Example for an ExpressionStatement would be: Module["text"] = "XXX"; */
|
||||||
return undefined;
|
generators[SyntaxKind.ExpressionStatement] = () => undefined;
|
||||||
};
|
generators[SyntaxKind.SemicolonClassElement] = () => undefined;
|
||||||
|
|
||||||
/* Example for an ExpressionStatement would be: Modul["text"] = "XXX"; */
|
generators[SyntaxKind.ImportDeclaration] = (settings, stack, node: ts.ImportDeclaration) => {
|
||||||
generators[SyntaxKind.ExpressionStatement] = (settings, stack, node: ts.ExpressionStatement) => {
|
const specifier = node.moduleSpecifier as ts.StringLiteral;
|
||||||
return undefined;
|
if(specifier.kind !== SyntaxKind.StringLiteral)
|
||||||
};
|
throw "cant handle import declaration with specifier of type " + specifier.kind;
|
||||||
|
|
||||||
generators[SyntaxKind.SemicolonClassElement] = (settings, stack, node: ts.ExpressionStatement) => {
|
return ts.createImportDeclaration(
|
||||||
return undefined;
|
node.decorators,
|
||||||
|
node.modifiers,
|
||||||
|
node.importClause,
|
||||||
|
ts.createStringLiteral(specifier.text + ".d")
|
||||||
|
);
|
||||||
};
|
};
|
|
@ -1,40 +1,44 @@
|
||||||
import {readFileSync, writeFileSync, mkdir} from "fs";
|
import {readFileSync, writeFileSync, mkdir, existsSync} from "fs";
|
||||||
import {isArray, isString} from "util";
|
|
||||||
import * as ts from "typescript";
|
import * as ts from "typescript";
|
||||||
import * as decl from "./declarator";
|
import * as decl from "./declarator";
|
||||||
import * as glob from "glob";
|
import * as glob from "glob";
|
||||||
import * as path from "path";
|
import * as path from "path";
|
||||||
import * as mkdirp from "mkdirp";
|
import * as mkdirp from "mkdirp";
|
||||||
|
import {removeSync} from "fs-extra";
|
||||||
|
|
||||||
let source_files: string[] = [];
|
let source_files: string[] = [];
|
||||||
let exclude_files: string[] = [];
|
let exclude_files: string[] = [];
|
||||||
let target_file: string = "out.d.ts";
|
let target_directory: string = "out.d/";
|
||||||
let verbose: boolean = false;
|
let verbose: boolean = false;
|
||||||
let config_file: string = undefined;
|
let config_file: string = undefined;
|
||||||
let base_path = process.cwd();
|
let base_path = process.cwd();
|
||||||
|
let module_mode: boolean = false;
|
||||||
|
|
||||||
let args = process.argv.slice(2);
|
let args = process.argv.slice(2);
|
||||||
while(args.length > 0) {
|
while(args.length > 0) {
|
||||||
if(args[0] == "--file") {
|
if(args[0] === "--file") {
|
||||||
source_files.push(args[1]);
|
source_files.push(args[1]);
|
||||||
args = args.slice(2);
|
args = args.slice(2);
|
||||||
} else if(args[0] == "--exclude") {
|
} else if(args[0] === "--exclude") {
|
||||||
exclude_files.push(args[1]);
|
exclude_files.push(args[1]);
|
||||||
args = args.slice(2);
|
args = args.slice(2);
|
||||||
} else if(args[0] == "--destination") {
|
} else if(args[0] === "--destination") {
|
||||||
target_file = args[1];
|
target_directory = args[1];
|
||||||
args = args.slice(2);
|
args = args.slice(2);
|
||||||
} else if(args[0] == "-v" || args[0] == "--verbose") {
|
} else if(args[0] === "-v" || args[0] === "--verbose") {
|
||||||
verbose = true;
|
verbose = true;
|
||||||
args = args.slice(1);
|
args = args.slice(1);
|
||||||
} else if(args[0] == "-c" || args[0] == "--config") {
|
} else if(args[0] === "-c" || args[0] === "--config") {
|
||||||
config_file = args[1];
|
config_file = args[1];
|
||||||
base_path = path.normalize(path.dirname(config_file));
|
base_path = path.normalize(path.dirname(config_file));
|
||||||
args = args.slice(2);
|
args = args.slice(2);
|
||||||
} else if(args[0] == "-b" || args[0] == "--base") {
|
} else if(args[0] === "-b" || args[0] === "--base-directory") {
|
||||||
base_path = args[1];
|
base_path = args[1];
|
||||||
base_path = path.normalize(base_path);
|
base_path = path.normalize(base_path);
|
||||||
args = args.slice(2);
|
args = args.slice(2);
|
||||||
|
} else if(args[0] === "-m" || args[0] === "--module") {
|
||||||
|
module_mode = true;
|
||||||
|
args = args.slice(1);
|
||||||
} else {
|
} else {
|
||||||
console.error("Invalid command line option %s", args[0]);
|
console.error("Invalid command line option %s", args[0]);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
|
@ -49,12 +53,16 @@ if(config_file) {
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isArray(json["source_files"]))
|
if(Array.isArray(json["source_files"]))
|
||||||
source_files.push(...json["source_files"]);
|
source_files.push(...json["source_files"]);
|
||||||
if(isArray(json["exclude"]))
|
if(Array.isArray(json["exclude"]))
|
||||||
exclude_files.push(...json["exclude"]);
|
exclude_files.push(...json["exclude"]);
|
||||||
if(isString(json["target_file"]))
|
if(typeof json["target_directory"] === "string")
|
||||||
target_file = json["target_file"];
|
target_directory = json["target_directory"];
|
||||||
|
if(typeof json["base_directory"] === "string")
|
||||||
|
base_path = json["base_directory"];
|
||||||
|
if(typeof json["modular"] === "boolean")
|
||||||
|
module_mode = json["modular"];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(verbose) {
|
if(verbose) {
|
||||||
|
@ -62,15 +70,30 @@ if(verbose) {
|
||||||
console.log("Input files:");
|
console.log("Input files:");
|
||||||
for(const file of source_files)
|
for(const file of source_files)
|
||||||
console.log(" - " + file);
|
console.log(" - " + file);
|
||||||
console.log("Target file: " + target_file);
|
console.log("Target directory: " + target_directory);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(existsSync(target_directory)) {
|
||||||
|
removeSync(target_directory);
|
||||||
|
if(existsSync(target_directory)) {
|
||||||
|
console.error("Failed to remove target directory (%s)", target_directory);
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const negate_files: string[] = [].concat.apply([], exclude_files.map(file => glob.sync(base_path + "/" + file))).map(file => path.normalize(file));
|
const negate_files: string[] = [].concat.apply([], exclude_files.map(file => glob.sync(base_path + "/" + file))).map(file => path.normalize(file));
|
||||||
|
|
||||||
let result = "";
|
|
||||||
source_files.forEach(file => {
|
source_files.forEach(file => {
|
||||||
glob.sync(base_path + "/" + file).forEach(_file => {
|
const glob_base = path.normalize(path.join(process.cwd(), base_path));
|
||||||
|
if(verbose)
|
||||||
|
console.log("Globbing %s", glob_base);
|
||||||
|
glob.sync(glob_base + "/" + file).forEach(_file => {
|
||||||
_file = path.normalize(_file);
|
_file = path.normalize(_file);
|
||||||
|
if(!_file.startsWith(glob_base)) {
|
||||||
|
/* this should never happen */
|
||||||
|
console.log("Skipping %s because of unmatching base directory.", _file);
|
||||||
|
return;
|
||||||
|
}
|
||||||
for(const n_file of negate_files) {
|
for(const n_file of negate_files) {
|
||||||
if(n_file == _file) {
|
if(n_file == _file) {
|
||||||
console.log("Skipping %s", _file);
|
console.log("Skipping %s", _file);
|
||||||
|
@ -78,6 +101,7 @@ source_files.forEach(file => {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const relpath = _file.substr(glob_base.length);
|
||||||
let source = ts.createSourceFile(
|
let source = ts.createSourceFile(
|
||||||
_file,
|
_file,
|
||||||
readFileSync(_file).toString(),
|
readFileSync(_file).toString(),
|
||||||
|
@ -85,15 +109,17 @@ source_files.forEach(file => {
|
||||||
true
|
true
|
||||||
);
|
);
|
||||||
|
|
||||||
console.log("Compile " + _file);
|
console.log("Compile %s (%s)", _file, relpath);
|
||||||
result += "\n/* File: " + _file + " */\n" + decl.print(source, decl.generate(source, {
|
const result = decl.print(source, decl.generate(source, {
|
||||||
remove_private: false
|
remove_private: false,
|
||||||
|
module_mode: module_mode
|
||||||
}));
|
}));
|
||||||
|
|
||||||
|
let fpath = path.join(base_path, target_directory, relpath);
|
||||||
|
fpath = fpath.substr(0, fpath.lastIndexOf(".")) + ".d.ts";
|
||||||
|
mkdirp(path.normalize(path.dirname(fpath)), error => {
|
||||||
|
if(error) throw error;
|
||||||
|
writeFileSync(fpath, result);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
mkdirp(path.normalize(path.dirname(base_path + "/" + target_file)), error => {
|
|
||||||
if(error)
|
|
||||||
throw error;
|
|
||||||
writeFileSync(base_path + "/" + target_file, result);
|
|
||||||
});
|
|
6
tools/dtsgen/out.d.ts
vendored
6
tools/dtsgen/out.d.ts
vendored
|
@ -1,6 +0,0 @@
|
||||||
|
|
||||||
/* File: /home/wolverindev/TeaSpeak/Web-Client/tools/dtsgen/test/test_07.ts */
|
|
||||||
declare namespace C { }
|
|
||||||
declare namespace C {
|
|
||||||
export function test(arg: string);
|
|
||||||
}
|
|
8
tools/dtsgen/out.d/module_a.d.ts
vendored
Normal file
8
tools/dtsgen/out.d/module_a.d.ts
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
export declare class TestClass {
|
||||||
|
public say_hi();
|
||||||
|
}
|
||||||
|
export declare function say_hello_a();
|
||||||
|
export declare namespace X {
|
||||||
|
export class Y {
|
||||||
|
}
|
||||||
|
}
|
5
tools/dtsgen/out.d/test_01.d.ts
vendored
Normal file
5
tools/dtsgen/out.d/test_01.d.ts
vendored
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
import * as module_a from "./module_a.d";
|
||||||
|
export declare class C extends module_a.TestClass {
|
||||||
|
}
|
||||||
|
export declare const say_a;
|
||||||
|
export declare function say_b();
|
8
tools/dtsgen/out.d/test_02.d.ts
vendored
Normal file
8
tools/dtsgen/out.d/test_02.d.ts
vendored
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
import * as module_a from "./module_a.d";
|
||||||
|
/* CLASS COMMENT!*/
|
||||||
|
export declare class C extends module_a.TestClass {
|
||||||
|
}
|
||||||
|
/* Say a comment */
|
||||||
|
export declare const say_a;
|
||||||
|
/* Say b comment */
|
||||||
|
export declare function say_b();
|
11
tools/dtsgen/test_modular/module_a.ts
Normal file
11
tools/dtsgen/test_modular/module_a.ts
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
export class TestClass {
|
||||||
|
public say_hi() {}
|
||||||
|
}
|
||||||
|
|
||||||
|
export function say_hello_a() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
export namespace X {
|
||||||
|
export class Y {}
|
||||||
|
}
|
9
tools/dtsgen/test_modular/test_01.ts
Normal file
9
tools/dtsgen/test_modular/test_01.ts
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
import * as module_a from "./module_a";
|
||||||
|
|
||||||
|
export class C extends module_a.TestClass {}
|
||||||
|
|
||||||
|
export const say_a = module_a.say_hello_a;
|
||||||
|
export function say_b() {
|
||||||
|
console.log("B!");
|
||||||
|
module_a.say_hello_a();
|
||||||
|
}
|
14
tools/dtsgen/test_modular/test_02.ts
Normal file
14
tools/dtsgen/test_modular/test_02.ts
Normal file
|
@ -0,0 +1,14 @@
|
||||||
|
/* IMPOTZ COMMENT */
|
||||||
|
import * as module_a from "./module_a";
|
||||||
|
|
||||||
|
/* CLASS COMMENT!*/
|
||||||
|
export class C extends module_a.TestClass {}
|
||||||
|
|
||||||
|
/* Say a comment */
|
||||||
|
export const say_a = module_a.say_hello_a;
|
||||||
|
|
||||||
|
/* Say b comment */
|
||||||
|
export function say_b() {
|
||||||
|
console.log("B!");
|
||||||
|
module_a.say_hello_a();
|
||||||
|
}
|
5
tools/dtsgen/test_modular/tools/dtsgen/out.d
Normal file
5
tools/dtsgen/test_modular/tools/dtsgen/out.d
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
|
||||||
|
/* File: tools\dtsgen\test_modular\test_01.ts */
|
||||||
|
import * as module_a from "./module_a";
|
||||||
|
export declare const say_a;
|
||||||
|
export declare function say_b();
|
|
@ -6,7 +6,11 @@
|
||||||
"sourceMap": true,
|
"sourceMap": true,
|
||||||
"lib": ["es6", "dom", "dom.iterable"],
|
"lib": ["es6", "dom", "dom.iterable"],
|
||||||
"removeComments": true, /* we dont really need them within the target files */
|
"removeComments": true, /* we dont really need them within the target files */
|
||||||
"jsx": "react"
|
"jsx": "react",
|
||||||
|
"baseUrl": ".",
|
||||||
|
"paths": {
|
||||||
|
"*": ["shared/declarations/*"]
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"exclude": [
|
"exclude": [
|
||||||
"node_modules",
|
"node_modules",
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import {log, LogCategory} from "shared-app/log";
|
||||||
|
|
||||||
namespace audio.player {
|
namespace audio.player {
|
||||||
let _globalContext: AudioContext;
|
let _globalContext: AudioContext;
|
||||||
let _global_destination: GainNode;
|
let _global_destination: GainNode;
|
||||||
|
|
Loading…
Add table
Reference in a new issue