0.1.6 • Published 6 months ago

@types/string-replace-webpack-plugin v0.1.6

Weekly downloads
585
License
MIT
Repository
github
Last release
6 months ago

Installation

npm install --save @types/string-replace-webpack-plugin

Summary

This package contains type definitions for string-replace-webpack-plugin (https://github.com/jamesandersen/string-replace-webpack-plugin).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/string-replace-webpack-plugin.

index.d.ts

// Type definitions for string-replace-webpack-plugin 0.1
// Project: https://github.com/jamesandersen/string-replace-webpack-plugin
// Definitions by: Rongjian Zhang <https://github.com/pd4d10>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 3.7

import { Plugin, RuleSetUse } from "webpack";

export = StringReplacePlugin;

declare class StringReplacePlugin extends Plugin {
    static replace(
        options: StringReplacePlugin.Options,
        /**
         * loaders to follow the replacement
         */
        nextLoaders?: string
    ): RuleSetUse;
    static replace(
        /**
         * loaders to apply prior to the replacement
         */
        prevLoaders: string,
        options: StringReplacePlugin.Options,
        /**
         * loaders to follow the replacement
         */
        nextLoaders?: string
    ): RuleSetUse;
}

declare namespace StringReplacePlugin {
    interface Options {
        replacements: ReplacementItem[];
    }

    interface ReplacementItem {
        /**
         * a regex to match against the file contents
         */
        pattern: RegExp;
        /**
         * an ECMAScript string replacement function
         * https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/replace#Specifying_a_function_as_a_parameter
         */
        replacement: (substring: string, ...args: any[]) => string;
    }
}

Additional Details

  • Last updated: Thu, 16 Dec 2021 22:32:08 GMT
  • Dependencies: @types/webpack
  • Global values: none

Credits

These definitions were written by Rongjian Zhang.

0.1.4

8 months ago

0.1.6

6 months ago

0.1.5

7 months ago

0.1.3

2 years ago

0.1.2

3 years ago

0.1.1

5 years ago

0.1.0

6 years ago