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

0.3.6 • Public • Published

Installation

npm install --save @types/uritemplate

Summary

This package contains type definitions for uritemplate (https://github.com/fxa/uritemplate-js).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/uritemplate.

index.d.ts

/*
 UriTemplate Copyright (c) 2012-2013 Franz Antesberger. All Rights Reserved.
 Available via the MIT license.
*/

export class UriTemplate {
    /**
     * Expands template into a string using parameter
     * supplied
     */
    expand(data: {}): string;
}

export interface UriTemplateErrorOptions {
    expressionText: string;
    message: string;
    position: number;
}

export class UriTemplateError {
    constructor(options: UriTemplateErrorOptions);
}

/**
 * parse template text returning instance of UriTemplate
 * @param template text
 * @return instance of UriTemplate
 * @example
 *   import UriTemplate = require('uritemplate');
 *   let template = UriTemplate.parse('http://localhost/query{?name,city}');
 *   let result   = template.expand({name: 'Jayden', city: 'Wodonga'});
 *   // returns http://localhost/query?name=Jayden&city=Wodonga
 */
export function parse(templateText: string): UriTemplate;

Additional Details

  • Last updated: Tue, 07 Nov 2023 15:11:36 GMT
  • Dependencies: none

Credits

These definitions were written by Chui Tey, and Ruben Taelman.

Readme

Keywords

none

Package Sidebar

Install

npm i @types/uritemplate

Weekly Downloads

3,577

Version

0.3.6

License

MIT

Unpacked Size

4.58 kB

Total Files

5

Last publish

Collaborators

  • types