Skip to content

Commit 49a04bd

Browse files
committed
Prefer a namespace over declare module
Apparently import * as alias syntax does not work with export = function: microsoft/TypeScript#5073
1 parent 28cb868 commit 49a04bd

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

index.d.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
1-
declare module "tslint-webpack-plugin" {
2-
import { Plugin } from "webpack";
3-
import { Options as TslintOptions } from "tslint/lib/runner";
1+
import { Plugin } from "webpack";
2+
import { Options as TslintOptions } from "tslint/lib/runner";
43

4+
export = TslintWebpackPlugin;
5+
6+
declare class TslintWebpackPlugin extends Plugin {
7+
constructor(options?: TslintWebpackPlugin.Options);
8+
}
9+
10+
declare namespace TslintWebpackPlugin {
511
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/9f4c75126167d0d8af759f58405d53d983e94ad0/types/react-redux/index.d.ts#L33-L34
612
type Diff<T extends string, U extends string> = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T];
713
type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
@@ -17,10 +23,4 @@ declare module "tslint-webpack-plugin" {
1723
exclude?: string[];
1824
format?: string;
1925
}
20-
21-
class TslintWebpackPlugin extends Plugin {
22-
constructor(options?: Options);
23-
}
24-
25-
export = TslintWebpackPlugin;
2626
}

0 commit comments

Comments
 (0)