From 3ef00546da8850c9c962bffb87d65cd43a9b262b Mon Sep 17 00:00:00 2001 From: Marcin Porebski Date: Wed, 19 Aug 2015 15:09:10 +0200 Subject: [PATCH 1/4] url-template definitions --- url-template/url-template-tests.ts | 13 +++++++++++++ url-template/url-template.d.ts | 24 ++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 url-template/url-template-tests.ts create mode 100644 url-template/url-template.d.ts 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; +} + + From cb2b22f81a17658943fbcb06f15c0bde4e60e79c Mon Sep 17 00:00:00 2001 From: Marcin Porebski Date: Wed, 19 Aug 2015 18:48:48 +0200 Subject: [PATCH 2/4] string score definitions --- string_score/string_score-tests.ts | 8 ++++++++ string_score/string_score.d.ts | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 string_score/string_score-tests.ts create mode 100644 string_score/string_score.d.ts 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..2d901ba39 --- /dev/null +++ b/string_score/string_score.d.ts @@ -0,0 +1,8 @@ +// Type definitions for url-template 0.1.22 +// Project: https://github.com/joshaven/string_score +// Definitions by: Marcin Porębski +// Definitions: https://github.com/borisyankov/DefinitelyTyped + +interface String { + score: (word: string, fuzzy?: number) => number; +} From 5b010131f16dc0ae1b6ec6cc3cb36a95419ca0db Mon Sep 17 00:00:00 2001 From: Marcin Porebski Date: Thu, 20 Aug 2015 14:17:47 +0200 Subject: [PATCH 3/4] typo fix --- string_score/string_score.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/string_score/string_score.d.ts b/string_score/string_score.d.ts index 2d901ba39..5e3ee05d5 100644 --- a/string_score/string_score.d.ts +++ b/string_score/string_score.d.ts @@ -1,4 +1,4 @@ -// Type definitions for url-template 0.1.22 +// 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 From e78260ef9b39498a6a1bb513eeb4e0ba37203c25 Mon Sep 17 00:00:00 2001 From: Marcin Porebski Date: Sat, 22 Aug 2015 14:31:43 +0200 Subject: [PATCH 4/4] added empty module to string_score --- string_score/string_score.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/string_score/string_score.d.ts b/string_score/string_score.d.ts index 5e3ee05d5..6b3944c4e 100644 --- a/string_score/string_score.d.ts +++ b/string_score/string_score.d.ts @@ -3,6 +3,11 @@ // 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; }