Installation
npm install --save @types/string-format
Summary
This package contains type definitions for string-format (https://github.com/davidchambers/string-format).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/string-format.
index.d.ts
declare function Format(template: string, ...args: Array<({ [k: string]: any } | string)>): string;
interface Transformers {
[k: string]: (s: any) => string;
}
declare namespace Format {
/**
* create a format function with given transformers
* @param transformers functions which convert a string, indexed by a name
*/
function create(transformers: Transformers): typeof Format;
/**
* @param prototype prototype which should be extended by format (usually String.prototype)
* @param transformers functions which convert a string, indexed by a name
*/
function extend(prototype: any, transformers: Transformers): void;
}
export = Format;
Additional Details
- Last updated: Tue, 07 Nov 2023 15:11:36 GMT
- Dependencies: none
Credits
These definitions were written by Luca Lindhorst.