diff --git a/string_score/string_score-tests.ts b/string_score/string_score-tests.ts new file mode 100644 index 000000000..8a7399603 --- /dev/null +++ b/string_score/string_score-tests.ts @@ -0,0 +1,8 @@ +/// + +import string_score = require('string_score'); + +var a = 'abc'; +var b = 'xyz'; + +console.log(a.score(b).toString()); diff --git a/string_score/string_score.d.ts b/string_score/string_score.d.ts new file mode 100644 index 000000000..6b3944c4e --- /dev/null +++ b/string_score/string_score.d.ts @@ -0,0 +1,13 @@ +// Type definitions for string_score 0.1.22 +// Project: https://github.com/joshaven/string_score +// Definitions by: Marcin Porębski +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module "string_score" +{ + // nothing here as it's only extending the build in String class +} + +interface String { + score: (word: string, fuzzy?: number) => number; +} diff --git a/url-template/url-template-tests.ts b/url-template/url-template-tests.ts new file mode 100644 index 000000000..f477a160a --- /dev/null +++ b/url-template/url-template-tests.ts @@ -0,0 +1,13 @@ +/// + + +import urlTemplate = require('url-template'); + +var emailUrl = urlTemplate.parse('/{email}/{folder}/{id}'); + +// Returns '/user@domain/test/42' +emailUrl.expand({ + email: 'user@domain', + folder: 'test', + id: 42 +}); diff --git a/url-template/url-template.d.ts b/url-template/url-template.d.ts new file mode 100644 index 000000000..6ed7f5e86 --- /dev/null +++ b/url-template/url-template.d.ts @@ -0,0 +1,24 @@ +// Type definitions for url-template 2.0.6 +// Project: https://github.com/bramstein/url-template +// Definitions by: Marcin Porębski +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +declare module UrlTemplate +{ + interface TemplateParser { + parse(template: string): Template; + } + + interface Template { + expand(parameters: any): string; + } +} + +declare module "url-template" +{ + var urlTemplate: UrlTemplate.TemplateParser; + + export = urlTemplate; +} + +