From 890265f43691c26afb1abbd24a3c1429cfeeefd4 Mon Sep 17 00:00:00 2001 From: Igor Rogatty Date: Mon, 27 Oct 2014 17:12:20 +0100 Subject: [PATCH 1/2] Added definition for Handlebars.Utils.escapeExpression() --- handlebars/handlebars.d.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/handlebars/handlebars.d.ts b/handlebars/handlebars.d.ts index 0bdfff5bfd..ea1a1a11c2 100644 --- a/handlebars/handlebars.d.ts +++ b/handlebars/handlebars.d.ts @@ -27,6 +27,7 @@ interface HandlebarsCommon { Exception(message: string): void; SafeString: typeof hbs.SafeString; + Utils: typeof hbs.Utils; logger: Logger; log(level: number, obj: any): void; @@ -51,6 +52,10 @@ declare module hbs { constructor(str: string); static toString(): string; } + + class Utils { + static escapeExpression(str: string): string; + } } interface Logger { From 7159e9a3ddb95a8f6563f60153f381439d7b4735 Mon Sep 17 00:00:00 2001 From: Igor Rogatty Date: Fri, 23 Jan 2015 15:27:16 +0100 Subject: [PATCH 2/2] Utils is a module, not class --- handlebars/handlebars-tests.ts | 2 ++ handlebars/handlebars.d.ts | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/handlebars/handlebars-tests.ts b/handlebars/handlebars-tests.ts index 937f93191b..7ca58ff02a 100644 --- a/handlebars/handlebars-tests.ts +++ b/handlebars/handlebars-tests.ts @@ -78,3 +78,5 @@ Handlebars.registerHelper('list', (items: any, fn: (item: any) => string) => { Handlebars.registerHelper('fullName', (person: typeof context.author) => { return person.firstName + ' ' + person.lastName; }); + +var escapedExpression = Handlebars.Utils.escapeExpression(''); diff --git a/handlebars/handlebars.d.ts b/handlebars/handlebars.d.ts index ea1a1a11c2..0763815713 100644 --- a/handlebars/handlebars.d.ts +++ b/handlebars/handlebars.d.ts @@ -53,8 +53,8 @@ declare module hbs { static toString(): string; } - class Utils { - static escapeExpression(str: string): string; + module Utils { + function escapeExpression(str: string): string; } }