@types/nunjucks
Advanced tools
Comparing version 3.1.1 to 3.1.2
@@ -7,9 +7,15 @@ // Type definitions for nunjucks 3.1 | ||
export type TemplateCallback<T> = ( | ||
err: lib.TemplateError | null, | ||
res: T | null, | ||
) => void; | ||
export type Callback<E, T> = (err: E | null, res: T | null) => void; | ||
export function render(name: string, context?: object): string; | ||
export function render(name: string, context?: object, callback?: (err: any, res: string) => any): void; | ||
export function render(name: string, context?: object, callback?: TemplateCallback<string>): void; | ||
export function renderString(src: string, context: object): string; | ||
export function renderString(src: string, context: object, callback?: (err: any, res: string) => any): void; | ||
export function renderString(src: string, context: object, callback?: TemplateCallback<string>): void; | ||
export function compile(src: string, env?: Environment, callback?: (err: any, res: Template) => any): Template; | ||
export function compile(src: string, env?: Environment, callback?: TemplateCallback<Template>): Template; | ||
@@ -32,3 +38,3 @@ export function precompile(path: string, opts?: PrecompileOptions): string; | ||
render(context?: object): string; | ||
render(context?: object, callback?: (err: any, res: string) => any): void; | ||
render(context?: object, callback?: TemplateCallback<string>): void; | ||
} | ||
@@ -68,6 +74,6 @@ | ||
render(name: string, context?: object): string; | ||
render(name: string, context?: object, callback?: (err: any, res: string) => any): void; | ||
render(name: string, context?: object, callback?: TemplateCallback<string>): void; | ||
renderString(name: string, context: object): string; | ||
renderString(name: string, context: object, callback?: (err: any, res: string) => any): void; | ||
renderString(name: string, context: object, callback?: TemplateCallback<string>): void; | ||
@@ -85,3 +91,3 @@ addFilter(name: string, func: (...args: any[]) => any, async?: boolean): void; | ||
getTemplate(name: string, eagerCompile?: boolean): Template; | ||
getTemplate(name: string, eagerCompile?: boolean, callback?: (err: any, templ: Template) => Template): void; | ||
getTemplate(name: string, eagerCompile?: boolean, callback?: Callback<Error, Template>): void; | ||
@@ -102,3 +108,3 @@ express(app: object): void; | ||
getSource(name: string): LoaderSource; | ||
getSource(name: string, callback: (err?: any, result?: LoaderSource) => void): void; | ||
getSource(name: string, callback: Callback<Error, LoaderSource>): void; | ||
extend?(extender: ILoader): ILoader; | ||
@@ -156,1 +162,15 @@ } | ||
} | ||
export namespace lib { | ||
class TemplateError extends Error { | ||
constructor(message: string, lineno: number, colno: number); | ||
name: string; // always 'Template render error' | ||
message: string; | ||
stack: string; | ||
cause?: Error; | ||
lineno: number; | ||
colno: number; | ||
} | ||
} |
{ | ||
"name": "@types/nunjucks", | ||
"version": "3.1.1", | ||
"version": "3.1.2", | ||
"description": "TypeScript definitions for nunjucks", | ||
@@ -17,8 +17,9 @@ "license": "MIT", | ||
"type": "git", | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git" | ||
"url": "https://github.com/DefinitelyTyped/DefinitelyTyped.git", | ||
"directory": "types/nunjucks" | ||
}, | ||
"scripts": {}, | ||
"dependencies": {}, | ||
"typesPublisherContentHash": "0d8452080a742e3f80d2ab1e12f77bcc4ced160238363b4ea5a4de83bac01b2a", | ||
"typesPublisherContentHash": "213d7308503577136b01587a598d82c66960be80216371a8e9ffe22ab6af1168", | ||
"typeScriptVersion": "2.2" | ||
} |
@@ -5,3 +5,3 @@ # Installation | ||
# Summary | ||
This package contains type definitions for nunjucks ( http://mozilla.github.io/nunjucks/ ). | ||
This package contains type definitions for nunjucks (http://mozilla.github.io/nunjucks/). | ||
@@ -12,3 +12,3 @@ # Details | ||
Additional Details | ||
* Last updated: Wed, 13 Feb 2019 21:04:38 GMT | ||
* Last updated: Fri, 23 Aug 2019 16:12:47 GMT | ||
* Dependencies: none | ||
@@ -15,0 +15,0 @@ * Global values: none |
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
7904
139