@types/mustache
Advanced tools
Comparing version 3.2.0 to 4.0.0
@@ -1,2 +0,2 @@ | ||
// Type definitions for Mustache 3.2.1 | ||
// Type definitions for Mustache 4.0.0 | ||
// Project: https://github.com/janl/mustache.js | ||
@@ -63,2 +63,13 @@ // Definitions by: Mark Ashley Bell <https://github.com/markashleybell>, | ||
/** | ||
* Customise the template caching behaviour by either: | ||
* | ||
* disable it completely by setting it to `undefined` | ||
* | ||
* -- or -- | ||
* | ||
* provide a custom cache strategy that satisfies the `TemplateCache` interface | ||
*/ | ||
templateCache: TemplateCache | undefined; | ||
/** | ||
* Parses and caches the given template in the default writer and returns the array of tokens it contains. | ||
@@ -96,21 +107,2 @@ * | ||
render(template: string, view: any | MustacheContext, partials?: PartialsOrLookupFn, tags?: OpeningAndClosingTags): string; | ||
/** | ||
* Renders the `template` with the given `view` and `partials` using the default writer. | ||
* | ||
* @param template | ||
* The template to render. | ||
* | ||
* @param view | ||
* The view to render the template with. | ||
* | ||
* @param partials | ||
* Either an object that contains the names and templates of partials that are used in a template | ||
* | ||
* -- or -- | ||
* | ||
* A function that is used to load partial template on the fly that takes a single argument: the name of the partial. | ||
*/ | ||
to_html(template: string, view: any | MustacheContext, partials?: PartialsOrLookupFn): string; | ||
to_html(template: string, view: any | MustacheContext, partials?: PartialsOrLookupFn, send?: (result: string) => void): void; | ||
} | ||
@@ -253,3 +245,98 @@ | ||
*/ | ||
renderTokens(tokens: string[], context: MustacheContext, partials?: PartialsOrLookupFn, originalTemplate?: string): string; | ||
renderTokens(tokens: string[][], context: MustacheContext, partials?: PartialsOrLookupFn, originalTemplate?: string): string; | ||
/** | ||
* Renders a section block. | ||
* | ||
* @param token | ||
* The token to render. | ||
* | ||
* @param context | ||
* The context to use for rendering the token. | ||
* | ||
* @param partials | ||
* The partials to use for rendering the token. | ||
* | ||
* @param originalTemplate | ||
* An object used to extract the portion of the original template that was contained in a higher-order section. | ||
*/ | ||
renderSection(token: string[], context: MustacheContext, partials?: PartialsOrLookupFn, originalTemplate?: string): string; | ||
/** | ||
* Renders an inverted section block. | ||
* | ||
* @param token | ||
* The token to render. | ||
* | ||
* @param context | ||
* The context to use for rendering the token. | ||
* | ||
* @param partials | ||
* The partials to use for rendering the token. | ||
* | ||
* @param originalTemplate | ||
* An object used to extract the portion of the original template that was contained in a higher-order section. | ||
*/ | ||
renderInverted(token: string[], context: MustacheContext, partials?: PartialsOrLookupFn, originalTemplate?: string): string; | ||
/** | ||
* Adds indentation to each line of the given partial. | ||
* | ||
* @param partial | ||
* The partial to indent. | ||
* | ||
* @param indentation | ||
* String containing a combination of spaces and tabs to use as indentation. | ||
* | ||
* @param lineHasNonSpace | ||
* Whether to indent lines that are empty. | ||
*/ | ||
indentPartial(partial: string, indentation: string, lineHasNonSpace: boolean): string; | ||
/** | ||
* Renders a partial. | ||
* | ||
* @param token | ||
* The token to render. | ||
* | ||
* @param context | ||
* The context to use for rendering the token. | ||
* | ||
* @param partials | ||
* The partials to use for rendering the token. | ||
* | ||
* @param tags | ||
* The tags to use. | ||
*/ | ||
renderPartial(token: string[], context: MustacheContext, partials?: PartialsOrLookupFn, tags?: OpeningAndClosingTags): string; | ||
/** | ||
* Renders an unescaped value. | ||
* | ||
* @param token | ||
* The token to render. | ||
* | ||
* @param context | ||
* The context to use for rendering the token. | ||
*/ | ||
unescapedValue(token: string[], context: MustacheContext): string; | ||
/** | ||
* Renders an escaped value. | ||
* | ||
* @param token | ||
* The token to render. | ||
* | ||
* @param context | ||
* The context to use for rendering the token. | ||
*/ | ||
escapedValue(token: string[], context: MustacheContext): string; | ||
/** | ||
* Renders a raw token. | ||
* | ||
* @param token | ||
* The token to render. | ||
*/ | ||
rawValue(token: string[]): string; | ||
} | ||
@@ -272,2 +359,8 @@ | ||
interface TemplateCache { | ||
set(cacheKey: string, value: string): void | ||
get(cacheKey: string): string | undefined | ||
clear(): void | ||
} | ||
/** | ||
@@ -274,0 +367,0 @@ * Provides the functionality to render templates with `{{mustaches}}`. |
{ | ||
"name": "@types/mustache", | ||
"version": "3.2.0", | ||
"version": "4.0.0", | ||
"description": "TypeScript definitions for Mustache", | ||
@@ -32,4 +32,4 @@ "license": "MIT", | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "015a5118c0d0aaaba06745a822ac3d53d89608bc95fdc43596bc9f573b764f31", | ||
"typesPublisherContentHash": "fc7fa9d0af5edf549db0c8676a4b329951e6c5b6acfb04b38ca2e48711a5e214", | ||
"typeScriptVersion": "2.8" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
### Additional Details | ||
* Last updated: Fri, 10 Jan 2020 23:52:48 GMT | ||
* Last updated: Fri, 17 Jan 2020 18:56:54 GMT | ||
* Dependencies: none | ||
@@ -14,0 +14,0 @@ * Global values: `Mustache` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13534
331