@types/nunjucks
- Version 3.2.6
- Published
- 9.13 kB
- No dependencies
- MIT license
Install
npm i @types/nunjucksyarn add @types/nunjuckspnpm add @types/nunjucksOverview
TypeScript definitions for nunjucks
Index
Functions
Classes
Interfaces
Type Aliases
Namespaces
Functions
function compile
compile: ( src: string, env?: Environment, callback?: TemplateCallback<Template>) => Template;function configure
configure: { (options: ConfigureOptions): Environment; (path: string | string[], options?: ConfigureOptions): Environment;};function installJinjaCompat
installJinjaCompat: () => void;function precompile
precompile: (path: string, opts?: PrecompileOptions) => string;function precompileString
precompileString: (src: string, opts?: PrecompileOptions) => string;function render
render: { (name: string, context?: object): string; (name: string, context?: object, callback?: TemplateCallback<string>): void;};function renderString
renderString: { (src: string, context: object): string; (src: string, context: object, callback?: TemplateCallback<string>): void;};Classes
class Environment
class Environment {}constructor
constructor(loader?: ILoaderAny | ILoaderAny[], opts?: ConfigureOptions);property options
options: { autoescape: boolean };method addExtension
addExtension: (name: string, ext: Extension) => Environment;method addFilter
addFilter: ( name: string, func: (...args: any[]) => any, async?: boolean) => Environment;method addGlobal
addGlobal: (name: string, value: any) => Environment;method express
express: (app: object) => void;method getExtension
getExtension: (name: string) => Extension;method getFilter
getFilter: (name: string) => (...args: any[]) => any;method getGlobal
getGlobal: (name: string) => any;method getTemplate
getTemplate: { (name: string, eagerCompile?: boolean): Template; ( name: string, eagerCompile?: boolean, callback?: Callback<Error, Template> ): void;};method hasExtension
hasExtension: (name: string) => boolean;method on
on: ( event: 'load', fn: ( name: string, source: { src: string; path: string; noCache: boolean }, loader: Loader ) => void) => void;method removeExtension
removeExtension: (name: string) => void;method render
render: { (name: string, context?: object): string; (name: string, context?: object, callback?: TemplateCallback<string>): void;};method renderString
renderString: { (name: string, context: object): string; (name: string, context: object, callback?: TemplateCallback<string>): void;};class FileSystemLoader
class FileSystemLoader extends Loader implements ILoader {}constructor
constructor(searchPaths?: string | string[], opts?: LoaderOptions);method getSource
getSource: (name: string) => LoaderSource;class Loader
class Loader {}method emit
emit: (name: string, ...args: any[]) => void;method extend
static extend: <LoaderClass extends typeof Loader>( this: LoaderClass, toExtend: ILoaderAny) => LoaderClass;method isRelative
isRelative: (filename: string) => boolean;method on
on: (name: string, func: (...args: any[]) => any) => void;method resolve
resolve: (from: string, to: string) => string;class NodeResolveLoader
class NodeResolveLoader extends Loader implements ILoader {}constructor
constructor(searchPaths?: string | string[], opts?: LoaderOptions);method getSource
getSource: (name: string) => LoaderSource;class PrecompiledLoader
class PrecompiledLoader extends Loader implements ILoader {}constructor
constructor(compiledTemplates?: any[]);method getSource
getSource: (name: string) => LoaderSource;class Template
class Template {}constructor
constructor( src: string, env?: Environment, path?: string, eagerCompile?: boolean);method render
render: { (context?: object): string; (context?: object, callback?: TemplateCallback<string>): void;};class WebLoader
class WebLoader extends Loader {}constructor
constructor(baseUrl?: string, opts?: WebLoaderOptions);property async
async: boolean;property getSource
getSource: ( name: string, callback: Callback<Error, LoaderSource>) => LoaderSource;Interfaces
interface ConfigureOptions
interface ConfigureOptions {}property autoescape
autoescape?: boolean | undefined;property dev
dev?: boolean | undefined;property express
express?: object | undefined;property lstripBlocks
lstripBlocks?: boolean | undefined;property noCache
noCache?: boolean | undefined;property tags
tags?: | { blockStart?: string | undefined; blockEnd?: string | undefined; variableStart?: string | undefined; variableEnd?: string | undefined; commentStart?: string | undefined; commentEnd?: string | undefined; } | undefined;property throwOnUndefined
throwOnUndefined?: boolean | undefined;property trimBlocks
trimBlocks?: boolean | undefined;property watch
watch?: boolean | undefined;property web
web?: | { useCache?: boolean | undefined; async?: boolean | undefined; } | undefined;interface Extension
interface Extension {}interface ILoader
interface ILoader {}A synchronous loader.
interface ILoaderAsync
interface ILoaderAsync {}An asynchronous loader.
interface LoaderOptions
interface LoaderOptions {}interface LoaderSource
interface LoaderSource {}interface PrecompileOptions
interface PrecompileOptions {}property asFunction
asFunction?: boolean | undefined;property env
env?: Environment | undefined;property exclude
exclude?: string[] | undefined;property force
force?: boolean | undefined;property include
include?: string[] | undefined;property name
name?: string | undefined;method wrapper
wrapper: ( templates: { name: string; template: string }, opts: PrecompileOptions) => string;interface WebLoaderOptions
interface WebLoaderOptions {}Type Aliases
type Callback
type Callback<E, T> = (err: E | null, res: T | null) => void;type FileSystemLoaderOptions
type FileSystemLoaderOptions = LoaderOptions;type ILoaderAny
type ILoaderAny = ILoader | ILoaderAsync | WebLoader;A synchronous or an asynchronous loader.
type NodeResolveLoaderOptions
type NodeResolveLoaderOptions = LoaderOptions;type TemplateCallback
type TemplateCallback<T> = (err: lib.TemplateError | null, res: T | null) => void;Namespaces
namespace lib
namespace lib {}class TemplateError
class TemplateError extends Error {}namespace runtime
namespace runtime {}class SafeString
class SafeString {}constructor
constructor(val: string);property length
length: number;property val
val: string;method toString
toString: () => string;method valueOf
valueOf: () => string;Package Files (1)
Dependencies (0)
No dependencies.
Dev Dependencies (0)
No dev dependencies.
Peer Dependencies (0)
No peer dependencies.
Badge
To add a badge like this oneto your package's README, use the codes available below.
You may also use Shields.io to create a custom badge linking to https://www.jsdocs.io/package/@types/nunjucks.
- Markdown[](https://www.jsdocs.io/package/@types/nunjucks)
- HTML<a href="https://www.jsdocs.io/package/@types/nunjucks"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 4411 ms. - Missing or incorrect documentation? Open an issue for this package.
