TypeScript/tests/baselines/reference/declFileIndexSignatures.js

57 lines
1.1 KiB
JavaScript
Raw Normal View History

2014-07-13 01:04:16 +02:00
//// [tests/cases/compiler/declFileIndexSignatures.ts] ////
//// [declFileIndexSignatures_0.ts]
export interface IStringIndexSignature {
[s: string]: string;
}
export interface INumberIndexSignature {
[n: number]: number;
}
export interface IBothIndexSignature {
[s: string]: any;
[n: number]: number;
}
export interface IIndexSignatureWithTypeParameter<T> {
[a: string]: T;
}
//// [declFileIndexSignatures_1.ts]
interface IGlobalStringIndexSignature {
[s: string]: string;
}
interface IGlobalNumberIndexSignature {
[n: number]: number;
}
interface IGlobalBothIndexSignature {
[s: string]: any;
[n: number]: number;
}
interface IGlobalIndexSignatureWithTypeParameter<T> {
[a: string]: T;
}
//// [declFileIndexSignatures_0.js]
//// [declFileIndexSignatures_1.js]
//// [declFileIndexSignatures_0.d.ts]
export interface IStringIndexSignature {
[s];
}
export interface INumberIndexSignature {
[n];
}
export interface IBothIndexSignature {
[s];
[n];
}
export interface IIndexSignatureWithTypeParameter<T> {
[a];
}
//// [declFileIndexSignatures_1.d.ts]