@types/string-format
TypeScript icon, indicating that this package has built-in type declarations

2.0.3 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/string-format

Weekly Downloads

23,187

Version

2.0.3

License

MIT

Unpacked Size

3.95 kB

Total Files

5

Last publish

Collaborators

  • types