• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1//// [tests/cases/conformance/ambient/ambientDeclarationsPatterns.ts] ////
2
3//// [declarations.d.ts]
4declare module "foo*baz" {
5    export function foo(s: string): void;
6}
7// Augmentations still work
8declare module "foo*baz" {
9    export const baz: string;
10}
11
12// Longest prefix wins
13declare module "foos*" {
14    export const foos: string;
15}
16
17declare module "*!text" {
18    const x: string;
19    export default x;
20}
21
22//// [user.ts]
23///<reference path="declarations.d.ts" />
24import {foo, baz} from "foobarbaz";
25foo(baz);
26
27import {foos} from "foosball";
28foo(foos);
29
30// Works with relative file name
31import fileText from "./file!text";
32foo(fileText);
33
34
35//// [user.js]
36"use strict";
37exports.__esModule = true;
38///<reference path="declarations.d.ts" />
39var foobarbaz_1 = require("foobarbaz");
40(0, foobarbaz_1.foo)(foobarbaz_1.baz);
41var foosball_1 = require("foosball");
42(0, foobarbaz_1.foo)(foosball_1.foos);
43// Works with relative file name
44var file_text_1 = require("./file!text");
45(0, foobarbaz_1.foo)(file_text_1["default"]);
46