@types/string-format
Version:
TypeScript definitions for string-format
41 lines (31 loc) • 1.31 kB
Markdown
> `npm install --save @types/string-format`
This package contains type definitions for string-format (https://github.com/davidchambers/string-format).
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/string-format.
````ts
declare function Format(template: string, ...args: Array<({ [k: string]: any } | string)>): string;
interface Transformers {
[]: (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;
````
* Last updated: Tue, 07 Nov 2023 15:11:36 GMT
* Dependencies: none
These definitions were written by [Luca Lindhorst](https://github.com/lal12).