@types/swig
- Version 0.0.34
- Published
- 8.68 kB
- No dependencies
- MIT license
Install
npm i @types/swig
yarn add @types/swig
pnpm add @types/swig
Overview
TypeScript definitions for swig
Index
Variables
Functions
Classes
Interfaces
Namespaces
Variables
variable version
var version: string;
Functions
function compile
compile: (source: string, options?: SwigOptions) => (locals?: any) => string;
function compileFile
compileFile: { ( pathname: string, options: SwigOptions, cb: (err: Error, compiledRender: (locals?: any) => string) => void ): void; (pathname: string, options?: SwigOptions): (locals?: any) => string;};
function invalidateCache
invalidateCache: () => void;
function parseFile
parseFile: (pathName: string, options?: any) => parser.ParseReturn;
function precompile
precompile: (source: string, options?: SwigOptions) => any;
function render
render: (source: string, options?: SwigOptions) => string;
function renderFile
renderFile: { (pathName: string, locals: any, cb: (err: Error, output: string) => void): void; (pathName: string, locals?: any): string;};
function run
run: (templateFn: Function, locals?: any, filePath?: string) => string;
function setDefaults
setDefaults: (options: SwigOptions) => void;
function setDefaultTZOffset
setDefaultTZOffset: (offset: number) => void;
function setExtension
setExtension: (name: string, object: any) => void;
function setFilter
setFilter: ( name: string, method: (input: any, ...args: any[]) => string) => void;
function setTag
setTag: ( name: string, parse: ( str?: string, line?: string, parser?: Object, types?: lexer.TYPES, stack?: any, opts?: Object, swig?: Swig ) => boolean, compile: ( compiler?: ( content?: string, parents?: any, options?: any, blockName?: string ) => string, args?: any[], content?: string, parents?: any, options?: any, blockName?: string ) => string, ends?: boolean, blockLevel?: boolean) => void;
Classes
class Swig
class Swig {}
constructor
constructor(options?: SwigOptions);
property loaders
loaders: typeof loaders;
method compile
compile: (source: string, options?: SwigOptions) => (locals?: any) => string;
method compileFile
compileFile: { ( pathname: string, options: SwigOptions, cb: (err: Error, compiledRender: (locals?: any) => string) => void ): void; (pathname: string, options?: SwigOptions): (locals?: any) => string;};
method invalidateCache
invalidateCache: () => void;
method parseFile
parseFile: (pathName: string, options?: any) => parser.ParseReturn;
method precompile
precompile: (source: string, options?: SwigOptions) => any;
method render
render: (source: string, options?: SwigOptions) => string;
method renderFile
renderFile: { ( pathName: string, locals: any, cb: (err: Error, output: string) => void ): void; (pathName: string, locals?: any): string;};
method run
run: (templateFn: Function, locals?: any, filePath?: string) => string;
method setExtension
setExtension: (name: string, object: any) => void;
method setFilter
setFilter: ( name: string, method: (input: any, ...args: any[]) => string) => void;
method setTag
setTag: ( name: string, parse: ( str?: string, line?: string, parser?: Object, types?: lexer.TYPES, stack?: any, opts?: Object, swig?: Swig ) => boolean, compile: ( compiler?: ( content?: string, parents?: any, options?: any, blockName?: string ) => string, args?: any[], content?: string, parents?: any, options?: any, blockName?: string ) => string, ends?: boolean, blockLevel?: boolean) => void;
Interfaces
interface SwigOptions
interface SwigOptions {}
property autoescape
autoescape?: boolean | undefined;
property cache
cache?: any;
property cmtControls
cmtControls?: string[] | undefined;
property loader
loader?: TemplateLoader | undefined;
property locals
locals?: any;
property tagControls
tagControls?: string[] | undefined;
property varControls
varControls?: string[] | undefined;
interface TemplateLoader
interface TemplateLoader {}
Namespaces
namespace lexer
namespace lexer {}
function read
read: (str: string) => string[];
enum TYPES
enum TYPES { WHITESPACE = 0, STRING = 1, FILTER = 2, FILTEREMPTY = 3, FUNCTION = 4, FUNCTIONEMPTY = 5, PARENOPEN = 6, PARENCLOSE = 7, COMMA = 8, VAR = 9, NUMBER = 10, OPERATOR = 11, BRACKETOPEN = 12, BRACKETCLOSE = 13, DOTKEY = 14, ARRAYOPEN = 15, CURLYOPEN = 17, CURLYCLOSE = 18, COLON = 19, COMPARATOR = 20, LOGIC = 21, NOT = 22, BOOL = 23, ASSIGNMENT = 24, METHODOPEN = 25, UNKNOWN = 100,}
member ARRAYOPEN
ARRAYOPEN = 15
Start of an array
member ASSIGNMENT
ASSIGNMENT = 24
Variable assignment
member BOOL
BOOL = 23
true or false
member BRACKETCLOSE
BRACKETCLOSE = 13
Close square bracket
member BRACKETOPEN
BRACKETOPEN = 12
Open square bracket
member COLON
COLON = 19
Colon (:)
member COMMA
COMMA = 8
Comma
member COMPARATOR
COMPARATOR = 20
JavaScript-valid comparator
member CURLYCLOSE
CURLYCLOSE = 18
Close curly brace
member CURLYOPEN
CURLYOPEN = 17
Open curly brace
member DOTKEY
DOTKEY = 14
Key on an object using dot-notation
member FILTER
FILTER = 2
Variable filter
member FILTEREMPTY
FILTEREMPTY = 3
Empty variable filter
member FUNCTION
FUNCTION = 4
Function
member FUNCTIONEMPTY
FUNCTIONEMPTY = 5
Function with no arguments
member LOGIC
LOGIC = 21
Boolean logic
member METHODOPEN
METHODOPEN = 25
Start of a method
member NOT
NOT = 22
Boolean logic "not"
member NUMBER
NUMBER = 10
Number
member OPERATOR
OPERATOR = 11
Math operator
member PARENCLOSE
PARENCLOSE = 7
Close parenthesis
member PARENOPEN
PARENOPEN = 6
Open parenthesis
member STRING
STRING = 1
Plain string
member UNKNOWN
UNKNOWN = 100
Unknown type
member VAR
VAR = 9
Variable
member WHITESPACE
WHITESPACE = 0
Whitespace
namespace loaders
namespace loaders {}
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/swig
.
- Markdown[![jsDocs.io](https://img.shields.io/badge/jsDocs.io-reference-blue)](https://www.jsdocs.io/package/@types/swig)
- HTML<a href="https://www.jsdocs.io/package/@types/swig"><img src="https://img.shields.io/badge/jsDocs.io-reference-blue" alt="jsDocs.io"></a>
- Updated .
Package analyzed in 2189 ms. - Missing or incorrect documentation? Open an issue for this package.