Merge pull request #8426 from kruncher/master

Add escape-string-regexp and format-unicorn type definitions.
This commit is contained in:
Masahiro Wakame
2016-03-10 23:31:46 +09:00
6 changed files with 66 additions and 0 deletions
@@ -0,0 +1,8 @@
/// <reference path="escape-string-regexp.d.ts"/>
import escapeStringRegexp = require('escape-string-regexp');
var inputString: string = '^abc$';
var outputString: string;
outputString = escapeStringRegexp(inputString);
+12
View File
@@ -0,0 +1,12 @@
// Type definitions for escape-string-regexp
// Project: https://github.com/sindresorhus/escape-string-regexp
// Definitions by: kruncher <https://github.com/kruncher/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "escape-string-regexp" {
function escapeStringRegexp(str: string): string;
export = escapeStringRegexp;
}
@@ -0,0 +1,11 @@
/// <reference path="format-unicorn-safe.d.ts"/>
import formatUnicorn = require('format-unicorn/safe');
// Safe version
var outputString: string;
outputString = formatUnicorn('Hello, {name}; you have {favoriteNumber}', {
name: "kruncher",
favoriteNumber: 42
});
+12
View File
@@ -0,0 +1,12 @@
// Type definitions for format-unicorn
// Project: https://github.com/tallesl/format-unicorn
// Definitions by: kruncher <https://github.com/kruncher/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module 'format-unicorn/safe' {
function formatUnicornSafe(str: string, replacements: { }): string;
export = formatUnicornSafe;
}
+11
View File
@@ -0,0 +1,11 @@
/// <reference path="format-unicorn.d.ts"/>
import 'format-unicorn';
// Unsafe version
var outputString: string;
outputString = 'Hello, {name}; you have {favoriteNumber}'.formatUnicorn({
name: "kruncher",
favoriteNumber: 42
});
+12
View File
@@ -0,0 +1,12 @@
// Type definitions for format-unicorn
// Project: https://github.com/tallesl/format-unicorn
// Definitions by: kruncher <https://github.com/kruncher/>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface String {
formatUnicorn(replacements: { }): string;
}
declare module "format-unicorn" {
}