File: template-functions.jsdoc

package info (click to toggle)
node-ejs 2.5.7-3%2Bdeb11u1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 796 kB
  • sloc: javascript: 1,608; makefile: 2
file content (70 lines) | stat: -rw-r--r-- 1,994 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
/**
 * This type of function is returned from {@link module:ejs.compile}, when
 * {@link Options}`.client` is false.
 *
 * @callback TemplateFunction
 * @param {Object}          [locals={}]
 * an object of data to be passed into the template.
 * @static
 * @global
 */

/**
 * This type of function is returned from {@link module:ejs.compile}, when
 * {@link Options}`.client` is true.
 *
 * This is also used internally to generate a
 * {@link TemplateFunction}.
 *
 * @callback ClientFunction
 * @param {Object}          [locals={}]
 * an object of data to be passed into the template. The name of this variable
 * is adjustable through {@link module:ejs.localsName}.
 *
 * @param {EscapeCallback}  [escape={@link Options}.escape]
 * callback used to escape variables
 *
 * @param {IncludeCallback} [include]
 * callback used to include files at runtime with `include()`
 *
 * @param {RethrowCallback} [rethrow={@link module:ejs-internal.rethrow}]
 * callback used to handle and rethrow errors
 *
 * @static
 * @global
 */

/**
 * Escapes a string using HTML/XML escaping rules.
 *
 * @callback EscapeCallback
 * @param  {String} markup Input string
 * @return {String}        Escaped string
 * @static
 * @global
 */

/**
 * This type of callback is used when {@link Options}`.compileDebug`
 * is true, and an error in the template is thrown. By default it is used to
 * rethrow an error in a better-formatted way.
 *
 * @callback RethrowCallback
 * @param {Error}  err      Error object
 * @param {String} str      full EJS source
 * @param {String} filename file name of the EJS file
 * @param {String} lineno   line number of the error
 * @static
 * @global
 */

/**
 * The callback called by {@link ClientFunction} to include files at runtime with `include()`
 *
 * @callback IncludeCallback
 * @param  {String} path      Path to be included
 * @param  {Object} [data]    Data passed to the template
 * @return {String}           Contents of the file requested
 * @static
 * @global
 */