File: topLevelModuleDeclarationAndFile.js

package info (click to toggle)
node-typescript 2.1.5-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 203,952 kB
  • ctags: 52,987
  • sloc: sh: 11; makefile: 5
file content (25 lines) | stat: -rw-r--r-- 633 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//// [tests/cases/conformance/externalModules/topLevelModuleDeclarationAndFile.ts] ////

//// [index.ts]
export var x: number = 42;

//// [foo_1.ts]
declare module "vs/foo_0" {
	export var y: () => number;
}


//// [foo_2.ts]
/// <reference path="foo_1.ts"/>
import foo = require("vs/foo_0");
var z1 = foo.x + 10;   // Should error, as declaration should win
var z2 = foo.y() + 10; // Should resolve


//// [foo_1.js]
//// [foo_2.js]
"use strict";
/// <reference path="foo_1.ts"/>
var foo = require("vs/foo_0");
var z1 = foo.x + 10; // Should error, as declaration should win
var z2 = foo.y() + 10; // Should resolve