From 1fc4ef09c1ac0ffb4c0f88ca685f44d1e0f32f89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benoit=20Vall=C3=A9e?= Date: Thu, 8 Oct 2020 19:19:54 +0200 Subject: [PATCH] Fix type "RuntimeOptions" also accepting string partials --- types/index.d.ts | 4 ++-- types/test.ts | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/types/index.d.ts b/types/index.d.ts index 092e613d..00b1381a 100644 --- a/types/index.d.ts +++ b/types/index.d.ts @@ -31,7 +31,7 @@ declare namespace Handlebars { partial?: boolean; depths?: any[]; helpers?: { [name: string]: Function }; - partials?: { [name: string]: HandlebarsTemplateDelegate }; + partials?: { [name: string]: Template }; decorators?: { [name: string]: Function }; data?: any; blockParams?: any[]; @@ -63,7 +63,7 @@ declare namespace Handlebars { export function unregisterHelper(name: string): void; export function registerPartial(name: string, fn: Template): void; - export function registerPartial(spec: { [name: string]: HandlebarsTemplateDelegate }): void; + export function registerPartial(spec: { [name: string]: Template }): void; export function unregisterPartial(name: string): void; // TODO: replace Function with actual signature diff --git a/types/test.ts b/types/test.ts index 2010b89f..8c47c36b 100644 --- a/types/test.ts +++ b/types/test.ts @@ -250,6 +250,9 @@ function testProtoAccessControlControlOptions() { allowedProtoProperties: { allowedProperty: true, forbiddenProperty: false }, allowProtoMethodsByDefault: true, allowProtoPropertiesByDefault: false, + partials: { + link: '{{name}}' + } } ); }