36 lines
No EOL
667 B
TypeScript
36 lines
No EOL
667 B
TypeScript
// @noImplicitReferences: true
|
|
// @declaration: true
|
|
// @typesRoot: /
|
|
// @traceResolution: true
|
|
|
|
// @filename: /types/lib/index.d.ts
|
|
|
|
interface Lib { x }
|
|
|
|
// @filename: /main.ts
|
|
export class Cls {
|
|
x
|
|
}
|
|
|
|
// @filename: /mod1.ts
|
|
/// <reference types="lib" />
|
|
|
|
import {Cls} from "./main";
|
|
Cls.prototype.foo = function() { return undefined; }
|
|
|
|
declare module "./main" {
|
|
interface Cls {
|
|
foo(): Lib;
|
|
}
|
|
namespace Cls {
|
|
function bar(): Lib;
|
|
}
|
|
}
|
|
|
|
// @filename: /mod2.ts
|
|
import { Cls } from "./main";
|
|
import "./mod1";
|
|
|
|
export const cls = Cls;
|
|
export const foo = new Cls().foo();
|
|
export const bar = Cls.bar(); |