100 lines
No EOL
2.2 KiB
TypeScript
100 lines
No EOL
2.2 KiB
TypeScript
// @target: ES5
|
|
// @declaration: true
|
|
// @comments: true
|
|
// @module: commonjs
|
|
|
|
// @Filename: declFileConstructors_0.ts
|
|
export class SimpleConstructor {
|
|
/** This comment should appear for foo*/
|
|
constructor() {
|
|
}
|
|
}
|
|
export class ConstructorWithParameters {
|
|
/** This is comment for function signature*/
|
|
constructor(/** this is comment about a*/a: string,
|
|
/** this is comment for b*/
|
|
b: number) {
|
|
var d = a;
|
|
}
|
|
}
|
|
|
|
export class ConstructorWithRestParamters {
|
|
constructor(a: string, ...rests: string[]) {
|
|
return a + rests.join("");
|
|
}
|
|
}
|
|
|
|
export class ConstructorWithOverloads {
|
|
constructor(a: string);
|
|
constructor(a: number);
|
|
constructor(a: any) {
|
|
}
|
|
}
|
|
|
|
export class ConstructorWithPublicParameterProperty {
|
|
constructor(public x: string) {
|
|
}
|
|
}
|
|
|
|
export class ConstructorWithPrivateParameterProperty {
|
|
constructor(private x: string) {
|
|
}
|
|
}
|
|
|
|
export class ConstructorWithOptionalParameterProperty {
|
|
constructor(public x?: string) {
|
|
}
|
|
}
|
|
|
|
export class ConstructorWithParameterInitializer {
|
|
constructor(public x = "hello") {
|
|
}
|
|
}
|
|
|
|
// @Filename: declFileConstructors_1.ts
|
|
class GlobalSimpleConstructor {
|
|
/** This comment should appear for foo*/
|
|
constructor() {
|
|
}
|
|
}
|
|
class GlobalConstructorWithParameters {
|
|
/** This is comment for function signature*/
|
|
constructor(/** this is comment about a*/a: string,
|
|
/** this is comment for b*/
|
|
b: number) {
|
|
var d = a;
|
|
}
|
|
}
|
|
|
|
class GlobalConstructorWithRestParamters {
|
|
constructor(a: string, ...rests: string[]) {
|
|
return a + rests.join("");
|
|
}
|
|
}
|
|
|
|
class GlobalConstructorWithOverloads {
|
|
constructor(a: string);
|
|
constructor(a: number);
|
|
constructor(a: any) {
|
|
}
|
|
}
|
|
|
|
class GlobalConstructorWithPublicParameterProperty {
|
|
constructor(public x: string) {
|
|
}
|
|
}
|
|
|
|
class GlobalConstructorWithPrivateParameterProperty {
|
|
constructor(private x: string) {
|
|
}
|
|
}
|
|
|
|
class GlobalConstructorWithOptionalParameterProperty {
|
|
constructor(public x?: string) {
|
|
}
|
|
}
|
|
|
|
class GlobalConstructorWithParameterInitializer {
|
|
constructor(public x = "hello") {
|
|
}
|
|
} |