UNPKG

restrict-imports-loader

Version:

A Webpack loader to restrict imports in ES and TypeScript

19 lines (18 loc) 728 B
import * as webpack from "webpack"; import * as core from "./core"; export declare type Severity = "fatal" | "error" | "warning"; declare type LoaderContext = webpack.loader.LoaderContext; export declare type LoaderFunctionDecider = (importPath: string, loaderContext: webpack.loader.LoaderContext) => Promise<core.Decision>; export declare type LoaderDecider = RegExp | LoaderFunctionDecider; declare type LoaderRule = { restricted: LoaderDecider; severity?: Severity; info?: string; }; export declare type LoaderOptions = { detailedErrorMessages?: boolean; severity: Severity; rules: readonly LoaderRule[]; }; export declare function run(loaderContext: LoaderContext, source: string): void; export {};