diff --git a/types/ejs/index.d.ts b/types/ejs/index.d.ts index fc921cffb5..90fcd949a5 100644 --- a/types/ejs/index.d.ts +++ b/types/ejs/index.d.ts @@ -2,6 +2,7 @@ // Project: http://ejs.co/, https://github.com/mde/ejs // Definitions by: Ben Liddicott // ExE Boss +// Piotr Błażejewicz // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.4 @@ -415,6 +416,9 @@ export interface Options { * @default ejs.localsName */ localsName?: string; + + /** Set to a string (e.g., 'echo' or 'print') for a function to print output inside scriptlet tags. */ + outputFunctionName?: string; } export interface Cache { diff --git a/types/ejs/test/ejs.cjs.test.ts b/types/ejs/test/ejs.cjs.test.ts index e7ea26bdc4..6a163e12ec 100644 --- a/types/ejs/test/ejs.cjs.test.ts +++ b/types/ejs/test/ejs.cjs.test.ts @@ -24,6 +24,7 @@ const SimpleCallback = (err: any, html: string) => { result = ejs.render(template); result = ejs.render(template, data); result = ejs.render(template, data, options); +ejs.render('<% echo(\'foo\'); %>', {}, { outputFunctionName: 'echo' }); result = ejs.renderFile(fileName, SimpleCallback); result = ejs.renderFile(fileName, data, SimpleCallback);