From b55473c4237158feeb46fbf554b9c36713898aca Mon Sep 17 00:00:00 2001 From: Manuel Thalmann Date: Tue, 19 Jun 2018 23:22:50 +0200 Subject: [PATCH] Implement Scanner, Context and Writer-classes --- types/mustache/index.d.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/types/mustache/index.d.ts b/types/mustache/index.d.ts index d6a745f14f..49a16ca35b 100644 --- a/types/mustache/index.d.ts +++ b/types/mustache/index.d.ts @@ -22,6 +22,23 @@ interface MustacheStatic { */ tags: string; + /** + * A simple string scanner that is used by the template parser to find tokens in template strings. + */ + Scanner: typeof MustacheScanner + + /** + * Represents a rendering context by wrapping a view object and maintaining a reference to the parent context. + */ + Context: typeof MustacheContext; + + /** + * A Writer knows how to take a stream of tokens and render them to a `string`, given a context. + * + * It also maintains a cache of templates to avoid the need to parse the same template twice. + */ + Writer: typeof MustacheWriter; + /** * Escapes HTML-characters. * @@ -222,6 +239,9 @@ declare class MustacheWriter { renderTokens(tokens: string[], context: MustacheContext, partials: any, originalTemplate: any): string; } +/** + * Provides the functionality to render templates with `{{mustaches}}`. + */ declare var Mustache: MustacheStatic; export = Mustache; export as namespace Mustache; \ No newline at end of file