DefinitelyTyped/types/string-replace-loader/index.d.ts
Jason Kwok ecc77f83c0
[string-replace-loader] Added type definitions (#44694)
* [node] Added `globalThis` support to `global`

* [node] Updated "Definitions by"

* [node] Fixed issue with `globalThis` only support TS 3.4 or newer

* [node] Updated package.json for node/v12

* [node] Added "path" entry to tsconfig

* [node] Fixed wrong "typeRoots"

* [node] Updated tests

* [string-replace-loader] Added type definitions

* Revert "Merge branch 'master' into node/global"

This reverts commit 132ba3c39a1e5e4c952cf8a2b7aec7e588c83f9f, reversing
changes made to 539042117c.

Co-authored-by: Jason Kwok <JasonHK@users.noreply.github.com>
2020-05-19 12:47:37 -07:00

30 lines
740 B
TypeScript

// Type definitions for string-replace-loader 2.3
// Project: https://github.com/Va1/string-replace-loader
// Definitions by: Jason Kwok <https://github.com/JasonHK>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
import * as Webpack from "webpack";
declare const loader: Webpack.loader.Loader;
declare namespace loader {
type Options = ReplaceEntry | ReplaceEntries;
interface ReplaceEntries {
multiple: ReplaceEntry[];
}
interface ReplaceEntry {
search: string | RegExp;
replace: string | ReplaceCallback;
flags?: string;
strict?: boolean;
}
interface ReplaceCallback {
(substring: string, ...args: any[]): string;
}
}
export = loader;