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

1.0.6 • Public • Published

Installation

npm install --save @types/string-template

Summary

This package contains type definitions for string-template (https://www.npmjs.com/package/string-template).

Details

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

index.d.ts

/**
 * NAMESPACE
 */
declare namespace StringTemplate {
    /**
     * Format
     */
    interface Format {
        // Format using an object hash with keys matching [0-9a-zA-Z]+
        (string: string, object: any): string;
        // Format using a number indexed array
        (string: string, array: any[]): string;
        // Format using optional arguments
        (string: string, ...array: any[]): string;
        // Escape {} pairs by using double {{}}
        (string: string): string;
    }

    /**
     * Compile
     */
    interface Compile {
        (string: string, inline?: boolean): Template;
    }

    interface Template {
        (object: any): string;
        (array: any[]): string;
        (...array: any[]): string;
    }
}

/**
 * MODULES
 */
declare module "string-template" {
    const format: StringTemplate.Format;
    export = format;
}

declare module "string-template/compile" {
    const comile: StringTemplate.Compile;
    export = comile;
}

Additional Details

  • Last updated: Mon, 20 Nov 2023 23:36:24 GMT
  • Dependencies: none

Credits

These definitions were written by TonyYang.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/string-template

Weekly Downloads

21,780

Version

1.0.6

License

MIT

Unpacked Size

4.56 kB

Total Files

5

Last publish

Collaborators

  • types