138 lines
No EOL
4.1 KiB
TypeScript
138 lines
No EOL
4.1 KiB
TypeScript
// @target: ES5
|
|
// @module: commonjs
|
|
// @declaration: true
|
|
|
|
// @Filename: privacyCannotNameAccessorDeclFile_GlobalWidgets.ts
|
|
declare module "GlobalWidgets" {
|
|
export class Widget3 {
|
|
name: string;
|
|
}
|
|
export function createWidget3(): Widget3;
|
|
|
|
export module SpecializedGlobalWidget {
|
|
export class Widget4 {
|
|
name: string;
|
|
}
|
|
function createWidget4(): Widget4;
|
|
}
|
|
}
|
|
|
|
// @Filename: privacyCannotNameAccessorDeclFile_Widgets.ts
|
|
export class Widget1 {
|
|
name = 'one';
|
|
}
|
|
export function createWidget1() {
|
|
return new Widget1();
|
|
}
|
|
|
|
export module SpecializedWidget {
|
|
export class Widget2 {
|
|
name = 'one';
|
|
}
|
|
export function createWidget2() {
|
|
return new Widget2();
|
|
}
|
|
}
|
|
|
|
// @Filename:privacyCannotNameAccessorDeclFile_exporter.ts
|
|
///<reference path='privacyCannotNameAccessorDeclFile_GlobalWidgets.ts'/>
|
|
import Widgets = require("privacyCannotNameAccessorDeclFile_Widgets");
|
|
import Widgets1 = require("GlobalWidgets");
|
|
export function createExportedWidget1() {
|
|
return Widgets.createWidget1();
|
|
}
|
|
export function createExportedWidget2() {
|
|
return Widgets.SpecializedWidget.createWidget2();
|
|
}
|
|
export function createExportedWidget3() {
|
|
return Widgets1.createWidget3();
|
|
}
|
|
export function createExportedWidget4() {
|
|
return Widgets1.SpecializedGlobalWidget.createWidget4();
|
|
}
|
|
|
|
// @Filename:privacyCannotNameAccessorDeclFile_consumer.ts
|
|
import exporter = require("privacyCannotNameAccessorDeclFile_exporter");
|
|
export class publicClassWithWithPrivateGetAccessorTypes {
|
|
static get myPublicStaticMethod() { // Error
|
|
return exporter.createExportedWidget1();
|
|
}
|
|
private static get myPrivateStaticMethod() {
|
|
return exporter.createExportedWidget1();
|
|
}
|
|
get myPublicMethod() { // Error
|
|
return exporter.createExportedWidget1();
|
|
}
|
|
private get myPrivateMethod() {
|
|
return exporter.createExportedWidget1();
|
|
}
|
|
static get myPublicStaticMethod1() { // Error
|
|
return exporter.createExportedWidget3();
|
|
}
|
|
private static get myPrivateStaticMethod1() {
|
|
return exporter.createExportedWidget3();
|
|
}
|
|
get myPublicMethod1() { // Error
|
|
return exporter.createExportedWidget3();
|
|
}
|
|
private get myPrivateMethod1() {
|
|
return exporter.createExportedWidget3();
|
|
}
|
|
}
|
|
|
|
class privateClassWithWithPrivateGetAccessorTypes {
|
|
static get myPublicStaticMethod() {
|
|
return exporter.createExportedWidget1();
|
|
}
|
|
private static get myPrivateStaticMethod() {
|
|
return exporter.createExportedWidget1();
|
|
}
|
|
get myPublicMethod() {
|
|
return exporter.createExportedWidget1();
|
|
}
|
|
private get myPrivateMethod() {
|
|
return exporter.createExportedWidget1();
|
|
}
|
|
static get myPublicStaticMethod1() {
|
|
return exporter.createExportedWidget3();
|
|
}
|
|
private static get myPrivateStaticMethod1() {
|
|
return exporter.createExportedWidget3();
|
|
}
|
|
get myPublicMethod1() {
|
|
return exporter.createExportedWidget3();
|
|
}
|
|
private get myPrivateMethod1() {
|
|
return exporter.createExportedWidget3();
|
|
}
|
|
}
|
|
|
|
export class publicClassWithPrivateModuleGetAccessorTypes {
|
|
static get myPublicStaticMethod() { // Error
|
|
return exporter.createExportedWidget2();
|
|
}
|
|
get myPublicMethod() { // Error
|
|
return exporter.createExportedWidget2();
|
|
}
|
|
static get myPublicStaticMethod1() { // Error
|
|
return exporter.createExportedWidget4();
|
|
}
|
|
get myPublicMethod1() { // Error
|
|
return exporter.createExportedWidget4();
|
|
}
|
|
}
|
|
|
|
class privateClassWithPrivateModuleGetAccessorTypes {
|
|
static get myPublicStaticMethod() {
|
|
return exporter.createExportedWidget2();
|
|
}
|
|
get myPublicMethod() {
|
|
return exporter.createExportedWidget2();
|
|
}
|
|
static get myPublicStaticMethod1() {
|
|
return exporter.createExportedWidget4();
|
|
}
|
|
get myPublicMethod1() {
|
|
return exporter.createExportedWidget4();
|
|
}
|
|
} |