mirror of
https://github.com/swc-project/swc.git
synced 2024-12-23 21:54:36 +03:00
31 lines
583 B
TypeScript
31 lines
583 B
TypeScript
// @Filename: declarations.d.ts
|
|
declare module "foo*baz" {
|
|
export function foo(s: string): void;
|
|
}
|
|
// Augmentations still work
|
|
declare module "foo*baz" {
|
|
export const baz: string;
|
|
}
|
|
|
|
// Longest prefix wins
|
|
declare module "foos*" {
|
|
export const foos: string;
|
|
}
|
|
|
|
declare module "*!text" {
|
|
const x: string;
|
|
export default x;
|
|
}
|
|
|
|
// @Filename: user.ts
|
|
///<reference path="declarations.d.ts" />
|
|
import {foo, baz} from "foobarbaz";
|
|
foo(baz);
|
|
|
|
import {foos} from "foosball";
|
|
foo(foos);
|
|
|
|
// Works with relative file name
|
|
import fileText from "./file!text";
|
|
foo(fileText);
|