Skip to content

Commit

Permalink
Prefer a namespace over declare module
Browse files Browse the repository at this point in the history
Apparently import * as alias syntax does not work with export = function:
microsoft/TypeScript#5073
  • Loading branch information
ljani committed Mar 21, 2018
1 parent 28cb868 commit 49a04bd
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
declare module "tslint-webpack-plugin" {
import { Plugin } from "webpack";
import { Options as TslintOptions } from "tslint/lib/runner";
import { Plugin } from "webpack";
import { Options as TslintOptions } from "tslint/lib/runner";

export = TslintWebpackPlugin;

declare class TslintWebpackPlugin extends Plugin {
constructor(options?: TslintWebpackPlugin.Options);
}

declare namespace TslintWebpackPlugin {
// https://github.com/DefinitelyTyped/DefinitelyTyped/blob/9f4c75126167d0d8af759f58405d53d983e94ad0/types/react-redux/index.d.ts#L33-L34
type Diff<T extends string, U extends string> = ({ [P in T]: P } & { [P in U]: never } & { [x: string]: never })[T];
type Omit<T, K extends keyof T> = Pick<T, Diff<keyof T, K>>;
Expand All @@ -17,10 +23,4 @@ declare module "tslint-webpack-plugin" {
exclude?: string[];
format?: string;
}

class TslintWebpackPlugin extends Plugin {
constructor(options?: Options);
}

export = TslintWebpackPlugin;
}

0 comments on commit 49a04bd

Please sign in to comment.