DefinitelyTyped/types/replace-string/index.d.ts
2018-12-15 19:19:36 +01:00

27 lines
685 B
TypeScript

// Type definitions for replace-string 2.0
// Project: https://github.com/sindresorhus/replace-string#readme
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
export = replaceString;
declare function replaceString(
input: string,
needle: string,
replacement: string | replaceString.ReplacementFn,
options?: replaceString.Options
): string;
declare namespace replaceString {
type ReplacementFn = (
needle: string,
matchCount: number,
input: string,
matchIndex: number
) => string;
interface Options {
fromIndex?: number;
}
}