mirror of
https://github.com/harttle/liquidjs.git
synced 2026-09-15 04:10:40 -07:00
refactor: remove /dist from repo
This commit is contained in:
Vendored
-1
@@ -1 +0,0 @@
|
||||
export default function (): Promise<{}>;
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
export {};
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
export default function (): Promise<{}>;
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
export default function (): Promise<{}>;
|
||||
Vendored
-15
@@ -1,15 +0,0 @@
|
||||
declare const _default: {
|
||||
'join': (v: any[], arg: string) => string;
|
||||
'last': <T>(v: T[]) => T;
|
||||
'first': <T>(v: T[]) => T;
|
||||
'map': <T1, T2>(arr: {
|
||||
[key: string]: T1;
|
||||
}[], arg: string) => T1[];
|
||||
'reverse': (v: any[]) => any[];
|
||||
'sort': <T>(v: T[], arg: (lhs: T, rhs: T) => number) => T[];
|
||||
'size': (v: string | any[]) => number;
|
||||
'concat': <T1, T2>(v: T1[], arg: T2 | T2[]) => (T1 | T2)[];
|
||||
'slice': <T>(v: T[], begin: number, length: number) => T[];
|
||||
'uniq': <T>(arr: T[]) => T[];
|
||||
};
|
||||
export default _default;
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
declare const _default: {
|
||||
'date': (v: string | Date, arg: string) => string | Date;
|
||||
};
|
||||
export default _default;
|
||||
Vendored
-8
@@ -1,8 +0,0 @@
|
||||
declare function escape(str: string): string;
|
||||
declare const _default: {
|
||||
'escape': typeof escape;
|
||||
'escape_once': (str: string) => string;
|
||||
'newline_to_br': (v: string) => string;
|
||||
'strip_html': (v: string) => string;
|
||||
};
|
||||
export default _default;
|
||||
Vendored
-32
@@ -1,32 +0,0 @@
|
||||
declare const _default: {
|
||||
'join': (v: any[], arg: string) => string;
|
||||
'last': <T>(v: T[]) => T;
|
||||
'first': <T>(v: T[]) => T;
|
||||
'map': <T1, T2>(arr: {
|
||||
[key: string]: T1;
|
||||
}[], arg: string) => T1[];
|
||||
'reverse': (v: any[]) => any[];
|
||||
'sort': <T>(v: T[], arg: (lhs: T, rhs: T) => number) => T[];
|
||||
'size': (v: string | any[]) => number;
|
||||
'concat': <T1, T2>(v: T1[], arg: T2 | T2[]) => (T1 | T2)[];
|
||||
'slice': <T>(v: T[], begin: number, length: number) => T[];
|
||||
'uniq': <T>(arr: T[]) => T[];
|
||||
'default': <T1, T2>(v: T1, arg: T2) => T1 | T2;
|
||||
'date': (v: string | Date, arg: string) => string | Date;
|
||||
'url_decode': (x: string) => string;
|
||||
'url_encode': (x: string) => string;
|
||||
'abs': (v: number) => number;
|
||||
'ceil': (v: number) => number;
|
||||
'divided_by': (v: number, arg: number) => number;
|
||||
'floor': (v: number) => number;
|
||||
'minus': (l: number, r: number) => string;
|
||||
'modulo': (l: number, r: number) => string;
|
||||
'round': (v: number, arg?: number) => number;
|
||||
'plus': (l: number, r: number) => string;
|
||||
'times': (v: number, arg: number) => number;
|
||||
'escape': (str: string) => string;
|
||||
'escape_once': (str: string) => string;
|
||||
'newline_to_br': (v: string) => string;
|
||||
'strip_html': (v: string) => string;
|
||||
};
|
||||
export default _default;
|
||||
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
declare const _default: {
|
||||
'abs': (v: number) => number;
|
||||
'ceil': (v: number) => number;
|
||||
'divided_by': (v: number, arg: number) => number;
|
||||
'floor': (v: number) => number;
|
||||
'minus': (l: number, r: number) => string;
|
||||
'modulo': (l: number, r: number) => string;
|
||||
'round': (v: number, arg?: number) => number;
|
||||
'plus': (l: number, r: number) => string;
|
||||
'times': (v: number, arg: number) => number;
|
||||
};
|
||||
export default _default;
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
declare const _default: {
|
||||
'default': <T1, T2>(v: T1, arg: T2) => T1 | T2;
|
||||
};
|
||||
export default _default;
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
import { FilterImpl } from 'src/template/filter/filter-impl';
|
||||
declare const _default: {
|
||||
[key: string]: FilterImpl;
|
||||
};
|
||||
export default _default;
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
declare const _default: {
|
||||
'url_decode': (x: string) => string;
|
||||
'url_encode': (x: string) => string;
|
||||
};
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
declare const _default: {
|
||||
render: () => Promise<never>;
|
||||
};
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
declare const _default: {
|
||||
render: () => Promise<never>;
|
||||
};
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const tags: {
|
||||
[key: string]: ITagImplOptions;
|
||||
};
|
||||
export default tags;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-1
@@ -1 +0,0 @@
|
||||
export {};
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import IFS from './ifs';
|
||||
declare const _default: IFS;
|
||||
export default _default;
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
export default interface IFS {
|
||||
exists: (filepath: string) => Promise<boolean>;
|
||||
readFile: (filepath: string) => Promise<string>;
|
||||
resolve: (root: string, file: string, ext: string) => string;
|
||||
}
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import IFS from './ifs';
|
||||
declare const fs: IFS;
|
||||
export default fs;
|
||||
Vendored
-52
@@ -1,52 +0,0 @@
|
||||
export interface LiquidOptions {
|
||||
/** `root` is a directory or an array of directories to resolve layouts and includes, as well as the filename passed in when calling `.renderFile()`. If an array, the files are looked up in the order they occur in the array. Defaults to `["."]` */
|
||||
root?: string | string[];
|
||||
/** `extname` is used to lookup the template file when filepath doesn't include an extension name. Eg: setting to `".html"` will allow including file by basename. Defaults to `""`. */
|
||||
extname?: string;
|
||||
/** `cache` indicates whether or not to cache resolved templates. Defaults to `false`. */
|
||||
cache?: boolean;
|
||||
/** `dynamicPartials`: if set, treat `<filepath>` parameter in `{%include filepath %}`, `{%layout filepath%}` as a variable, otherwise as a literal value. Defaults to `true`. */
|
||||
dynamicPartials?: boolean;
|
||||
/** `strict_filters` is used to enable strict filter existence. If set to `false`, undefined filters will be rendered as empty string. Otherwise, undefined filters will cause an exception. Defaults to `false`. */
|
||||
strict_filters?: boolean;
|
||||
/** `strict_variables` is used to enable strict variable derivation. If set to `false`, undefined variables will be rendered as empty string. Otherwise, undefined variables will cause an exception. Defaults to `false`. */
|
||||
strict_variables?: boolean;
|
||||
/** `trim_tag_right` is used to strip blank characters (including ` `, `\t`, and `\r`) from the right of tags (`{% %}`) until `\n` (inclusive). Defaults to `false`. */
|
||||
trim_tag_right?: boolean;
|
||||
/** `trim_tag_left` is similar to `trim_tag_right`, whereas the `\n` is exclusive. Defaults to `false`. See Whitespace Control for details. */
|
||||
trim_tag_left?: boolean;
|
||||
/** ``trim_output_right` is used to strip blank characters (including ` `, `\t`, and `\r`) from the right of values (`{{ }}`) until `\n` (inclusive). Defaults to `false`. */
|
||||
trim_output_right?: boolean;
|
||||
/** `trim_output_left` is similar to `trim_output_right`, whereas the `\n` is exclusive. Defaults to `false`. See Whitespace Control for details. */
|
||||
trim_output_left?: boolean;
|
||||
/** `tag_delimiter_left` and `tag_delimiter_right` are used to override the delimiter for liquid tags **/
|
||||
tag_delimiter_left?: string;
|
||||
tag_delimiter_right?: string;
|
||||
/** `output_delimiter_left` and `output_delimiter_right` are used to override the delimiter for liquid outputs **/
|
||||
output_delimiter_left?: string;
|
||||
output_delimiter_right?: string;
|
||||
/** `greedy` is used to specify whether `trim_left`/`trim_right` is greedy. When set to `true`, all consecutive blank characters including `\n` will be trimed regardless of line breaks. Defaults to `true`. */
|
||||
greedy?: boolean;
|
||||
}
|
||||
export interface NormalizedOptions extends LiquidOptions {
|
||||
root?: string[];
|
||||
}
|
||||
export interface NormalizedFullOptions extends NormalizedOptions {
|
||||
root: string[];
|
||||
extname: string;
|
||||
cache: boolean;
|
||||
dynamicPartials: boolean;
|
||||
strict_filters: boolean;
|
||||
strict_variables: boolean;
|
||||
trim_tag_right: boolean;
|
||||
trim_tag_left: boolean;
|
||||
trim_output_right: boolean;
|
||||
trim_output_left: boolean;
|
||||
tag_delimiter_left: string;
|
||||
tag_delimiter_right: string;
|
||||
output_delimiter_left: string;
|
||||
output_delimiter_right: string;
|
||||
greedy: boolean;
|
||||
}
|
||||
export declare function normalize(options?: LiquidOptions): NormalizedOptions;
|
||||
export declare function applyDefault(options?: NormalizedOptions): NormalizedFullOptions;
|
||||
Vendored
-2397
File diff suppressed because it is too large
Load Diff
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
-33
@@ -1,33 +0,0 @@
|
||||
import Scope from './scope/scope';
|
||||
import * as Types from './types';
|
||||
import ITemplate from './template/itemplate';
|
||||
import Render from './render/render';
|
||||
import Parser from './parser/parser';
|
||||
import ITagImplOptions from './template/tag/itag-impl-options';
|
||||
import { isTruthy, isFalsy, evalExp, evalValue } from './render/syntax';
|
||||
import { LiquidOptions, NormalizedFullOptions } from './liquid-options';
|
||||
import { FilterImpl } from './template/filter/filter-impl';
|
||||
export default class Liquid {
|
||||
options: NormalizedFullOptions;
|
||||
renderer: Render;
|
||||
parser: Parser;
|
||||
private cache;
|
||||
private tokenizer;
|
||||
constructor(opts?: LiquidOptions);
|
||||
parse(html: string, filepath?: string): ITemplate[];
|
||||
render(tpl: Array<ITemplate>, ctx?: object, opts?: LiquidOptions): Promise<string>;
|
||||
parseAndRender(html: string, ctx?: object, opts?: LiquidOptions): Promise<string>;
|
||||
getTemplate(file: string, opts?: LiquidOptions): Promise<any>;
|
||||
renderFile(file: string, ctx?: object, opts?: LiquidOptions): Promise<string>;
|
||||
evalValue(str: string, scope: Scope): any;
|
||||
registerFilter(name: string, filter: FilterImpl): void;
|
||||
registerTag(name: string, tag: ITagImplOptions): void;
|
||||
plugin(plugin: (this: Liquid, L: typeof Liquid) => void): void;
|
||||
express(): (this: any, filePath: string, ctx: object, cb: (err: Error | null, html?: string | undefined) => void) => void;
|
||||
static default: typeof Liquid;
|
||||
static isTruthy: typeof isTruthy;
|
||||
static isFalsy: typeof isFalsy;
|
||||
static evalExp: typeof evalExp;
|
||||
static evalValue: typeof evalValue;
|
||||
static Types: typeof Types;
|
||||
}
|
||||
Vendored
-2424
File diff suppressed because it is too large
Load Diff
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
-2
File diff suppressed because one or more lines are too long
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
-6
@@ -1,6 +0,0 @@
|
||||
import Token from './token';
|
||||
export default class DelimitedToken extends Token {
|
||||
trimLeft: boolean;
|
||||
trimRight: boolean;
|
||||
constructor(raw: string, value: string, input: string, line: number, pos: number, file?: string);
|
||||
}
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
import Token from './token';
|
||||
export default class HTMLToken extends Token {
|
||||
constructor(str: string, input: string, line: number, col: number, file?: string);
|
||||
}
|
||||
Vendored
-35
@@ -1,35 +0,0 @@
|
||||
export declare const quoted: RegExp;
|
||||
export declare const quoteBalanced: RegExp;
|
||||
export declare const integer: RegExp;
|
||||
export declare const number: RegExp;
|
||||
export declare const bool: RegExp;
|
||||
export declare const identifier: RegExp;
|
||||
export declare const subscript: RegExp;
|
||||
export declare const literal: RegExp;
|
||||
export declare const variable: RegExp;
|
||||
export declare const rangeLimit: RegExp;
|
||||
export declare const range: RegExp;
|
||||
export declare const rangeCapture: RegExp;
|
||||
export declare const value: RegExp;
|
||||
export declare const hash: RegExp;
|
||||
export declare const hashCapture: RegExp;
|
||||
export declare const tagLine: RegExp;
|
||||
export declare const literalLine: RegExp;
|
||||
export declare const variableLine: RegExp;
|
||||
export declare const numberLine: RegExp;
|
||||
export declare const boolLine: RegExp;
|
||||
export declare const quotedLine: RegExp;
|
||||
export declare const rangeLine: RegExp;
|
||||
export declare const integerLine: RegExp;
|
||||
export declare const valueDeclaration: RegExp;
|
||||
export declare const valueList: RegExp;
|
||||
export declare const filter: RegExp;
|
||||
export declare const filterCapture: RegExp;
|
||||
export declare const filterLine: RegExp;
|
||||
export declare const operators: RegExp[];
|
||||
export declare function isInteger(str: string): boolean;
|
||||
export declare function isLiteral(str: string): boolean;
|
||||
export declare function isRange(str: string): boolean;
|
||||
export declare function isVariable(str: string): boolean;
|
||||
export declare function matchValue(str: string): RegExpExecArray | null;
|
||||
export declare function parseLiteral(str: string): string | number | boolean;
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
import DelimitedToken from './delimited-token';
|
||||
export default class OutputToken extends DelimitedToken {
|
||||
constructor(raw: string, value: string, input: string, line: number, pos: number, file?: string);
|
||||
}
|
||||
Vendored
-15
@@ -1,15 +0,0 @@
|
||||
import Token from 'src/parser/token';
|
||||
import ITemplate from 'src/template/itemplate';
|
||||
declare type ParseToken = ((token: Token, remainTokens: Array<Token>) => ITemplate);
|
||||
export default class ParseStream {
|
||||
private tokens;
|
||||
private handlers;
|
||||
private stopRequested;
|
||||
private parseToken;
|
||||
constructor(tokens: Array<Token>, parseToken: ParseToken);
|
||||
on<T extends ITemplate | Token | undefined>(name: string, cb: (arg: T) => void): ParseStream;
|
||||
trigger<T extends Token | ITemplate>(event: string, arg?: T): boolean;
|
||||
start(): this;
|
||||
stop(): this;
|
||||
}
|
||||
export {};
|
||||
Vendored
-14
@@ -1,14 +0,0 @@
|
||||
import Liquid from 'src/liquid';
|
||||
import ParseStream from './parse-stream';
|
||||
import Token from './token';
|
||||
import Tag from 'src/template/tag/tag';
|
||||
import Output from 'src/template/output';
|
||||
import HTML from 'src/template/html';
|
||||
import ITemplate from 'src/template/itemplate';
|
||||
export default class Parser {
|
||||
liquid: Liquid;
|
||||
constructor(liquid: Liquid);
|
||||
parse(tokens: Array<Token>): ITemplate[];
|
||||
parseToken(token: Token, remainTokens: Array<Token>): Tag | Output | HTML;
|
||||
parseStream(tokens: Array<Token>): ParseStream;
|
||||
}
|
||||
Vendored
-6
@@ -1,6 +0,0 @@
|
||||
import DelimitedToken from './delimited-token';
|
||||
export default class TagToken extends DelimitedToken {
|
||||
name: string;
|
||||
args: string;
|
||||
constructor(raw: string, value: string, input: string, line: number, pos: number, file?: string);
|
||||
}
|
||||
Vendored
-10
@@ -1,10 +0,0 @@
|
||||
export default class Token {
|
||||
type: string;
|
||||
line: number;
|
||||
col: number;
|
||||
raw: string;
|
||||
input: string;
|
||||
file?: string;
|
||||
value: string;
|
||||
constructor(raw: string, input: string, line: number, col: number, file?: string);
|
||||
}
|
||||
Vendored
-7
@@ -1,7 +0,0 @@
|
||||
import Token from './token';
|
||||
import { NormalizedFullOptions } from '../liquid-options';
|
||||
export default class Tokenizer {
|
||||
options: NormalizedFullOptions;
|
||||
constructor(options?: NormalizedFullOptions);
|
||||
tokenize(input: string, file?: string): Token[];
|
||||
}
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import Token from 'src/parser/token';
|
||||
import { NormalizedFullOptions } from 'src/liquid-options';
|
||||
export default function whiteSpaceCtrl(tokens: Token[], options: NormalizedFullOptions): void;
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
import Scope from 'src/scope/scope';
|
||||
import ITemplate from 'src/template/itemplate';
|
||||
export default class Render {
|
||||
renderTemplates(templates: ITemplate[], scope: Scope): Promise<string>;
|
||||
}
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
import Scope from 'src/scope/scope';
|
||||
export declare function evalExp(exp: string, scope: Scope): any;
|
||||
export declare function evalValue(str: string, scope: Scope): any;
|
||||
export declare function isTruthy(val: any): boolean;
|
||||
export declare function isFalsy(val: any): boolean;
|
||||
Vendored
-43
@@ -1,43 +0,0 @@
|
||||
declare const _default: ({
|
||||
output: {
|
||||
file: string;
|
||||
name: string;
|
||||
format: string;
|
||||
sourcemap: boolean;
|
||||
banner: string;
|
||||
}[];
|
||||
external: string[];
|
||||
plugins: import("rollup").Plugin[];
|
||||
treeshake: {
|
||||
propertyReadSideEffects: boolean;
|
||||
};
|
||||
input: string;
|
||||
} | {
|
||||
output: {
|
||||
file: string;
|
||||
name: string;
|
||||
format: string;
|
||||
sourcemap: boolean;
|
||||
banner: string;
|
||||
}[];
|
||||
plugins: any[];
|
||||
treeshake: {
|
||||
propertyReadSideEffects: boolean;
|
||||
};
|
||||
input: string;
|
||||
external?: undefined;
|
||||
} | {
|
||||
output: {
|
||||
file: string;
|
||||
name: string;
|
||||
format: string;
|
||||
sourcemap: boolean;
|
||||
}[];
|
||||
plugins: any[];
|
||||
treeshake: {
|
||||
propertyReadSideEffects: boolean;
|
||||
};
|
||||
input: string;
|
||||
external?: undefined;
|
||||
})[];
|
||||
export default _default;
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
declare enum BlockMode {
|
||||
OUTPUT = 0,
|
||||
STORE = 1
|
||||
}
|
||||
export default BlockMode;
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
export default interface IContext {
|
||||
[key: string]: any;
|
||||
liquid_method_missing?: (key: string) => any;
|
||||
}
|
||||
Vendored
-22
@@ -1,22 +0,0 @@
|
||||
import { NormalizedFullOptions } from '../liquid-options';
|
||||
import BlockMode from './block-mode';
|
||||
import IContext from './icontext';
|
||||
export default class Scope {
|
||||
opts: NormalizedFullOptions;
|
||||
contexts: Array<IContext>;
|
||||
blocks: object;
|
||||
groups: {
|
||||
[key: string]: number;
|
||||
};
|
||||
blockMode: BlockMode;
|
||||
constructor(ctx?: object, opts?: NormalizedFullOptions);
|
||||
getAll(): IContext;
|
||||
get(path: string): any;
|
||||
set(path: string, v: any): void;
|
||||
unshift(ctx: object): number;
|
||||
push(ctx: object): number;
|
||||
pop(ctx?: object): object | undefined;
|
||||
findContextFor(key: string, filter?: ((conttext: object) => boolean)): IContext | null;
|
||||
private readProperty;
|
||||
propertyAccessSeq(str: string): string[];
|
||||
}
|
||||
Vendored
-8
@@ -1,8 +0,0 @@
|
||||
export declare class CaptureScope {
|
||||
}
|
||||
export declare class AssignScope {
|
||||
}
|
||||
export declare class IncrementScope {
|
||||
}
|
||||
export declare class DecrementScope {
|
||||
}
|
||||
Vendored
-15
@@ -1,15 +0,0 @@
|
||||
declare const _default: {
|
||||
'join': (v: any[], arg: string) => string;
|
||||
'last': <T>(v: T[]) => T;
|
||||
'first': <T>(v: T[]) => T;
|
||||
'map': <T1, T2>(arr: {
|
||||
[key: string]: T1;
|
||||
}[], arg: string) => T1[];
|
||||
'reverse': (v: any[]) => any[];
|
||||
'sort': <T>(v: T[], arg: (lhs: T, rhs: T) => number) => T[];
|
||||
'size': (v: string | any[]) => number;
|
||||
'concat': <T1, T2>(v: T1[], arg: T2 | T2[]) => (T1 | T2)[];
|
||||
'slice': <T>(v: T[], begin: number, length: number) => T[];
|
||||
'uniq': <T>(arr: T[]) => T[];
|
||||
};
|
||||
export default _default;
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
declare const _default: {
|
||||
'date': (v: string | Date, arg: string) => string | Date;
|
||||
};
|
||||
export default _default;
|
||||
Vendored
-8
@@ -1,8 +0,0 @@
|
||||
declare function escape(str: string): string;
|
||||
declare const _default: {
|
||||
'escape': typeof escape;
|
||||
'escape_once': (str: string) => string;
|
||||
'newline_to_br': (v: string) => string;
|
||||
'strip_html': (v: string) => string;
|
||||
};
|
||||
export default _default;
|
||||
Vendored
-32
@@ -1,32 +0,0 @@
|
||||
declare const _default: {
|
||||
'join': (v: any[], arg: string) => string;
|
||||
'last': <T>(v: T[]) => T;
|
||||
'first': <T>(v: T[]) => T;
|
||||
'map': <T1, T2>(arr: {
|
||||
[key: string]: T1;
|
||||
}[], arg: string) => T1[];
|
||||
'reverse': (v: any[]) => any[];
|
||||
'sort': <T>(v: T[], arg: (lhs: T, rhs: T) => number) => T[];
|
||||
'size': (v: string | any[]) => number;
|
||||
'concat': <T1, T2>(v: T1[], arg: T2 | T2[]) => (T1 | T2)[];
|
||||
'slice': <T>(v: T[], begin: number, length: number) => T[];
|
||||
'uniq': <T>(arr: T[]) => T[];
|
||||
'default': <T1, T2>(v: T1, arg: T2) => T1 | T2;
|
||||
'date': (v: string | Date, arg: string) => string | Date;
|
||||
'url_decode': (x: string) => string;
|
||||
'url_encode': (x: string) => string;
|
||||
'abs': (v: number) => number;
|
||||
'ceil': (v: number) => number;
|
||||
'divided_by': (v: number, arg: number) => number;
|
||||
'floor': (v: number) => number;
|
||||
'minus': (l: number, r: number) => string;
|
||||
'modulo': (l: number, r: number) => string;
|
||||
'round': (v: number, arg?: number) => number;
|
||||
'plus': (l: number, r: number) => string;
|
||||
'times': (v: number, arg: number) => number;
|
||||
'escape': (str: string) => string;
|
||||
'escape_once': (str: string) => string;
|
||||
'newline_to_br': (v: string) => string;
|
||||
'strip_html': (v: string) => string;
|
||||
};
|
||||
export default _default;
|
||||
Vendored
-12
@@ -1,12 +0,0 @@
|
||||
declare const _default: {
|
||||
'abs': (v: number) => number;
|
||||
'ceil': (v: number) => number;
|
||||
'divided_by': (v: number, arg: number) => number;
|
||||
'floor': (v: number) => number;
|
||||
'minus': (l: number, r: number) => string;
|
||||
'modulo': (l: number, r: number) => string;
|
||||
'round': (v: number, arg?: number) => number;
|
||||
'plus': (l: number, r: number) => string;
|
||||
'times': (v: number, arg: number) => number;
|
||||
};
|
||||
export default _default;
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
declare const _default: {
|
||||
'default': <T1, T2>(v: T1, arg: T2) => T1 | T2;
|
||||
};
|
||||
export default _default;
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
import { FilterImpl } from 'src/template/filter/filter-impl';
|
||||
declare const _default: {
|
||||
[key: string]: FilterImpl;
|
||||
};
|
||||
export default _default;
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
declare const _default: {
|
||||
'url_decode': (x: string) => string;
|
||||
'url_encode': (x: string) => string;
|
||||
};
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
declare const _default: {
|
||||
render: () => Promise<never>;
|
||||
};
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
declare const _default: {
|
||||
render: () => Promise<never>;
|
||||
};
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const tags: {
|
||||
[key: string]: ITagImplOptions;
|
||||
};
|
||||
export default tags;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import ITagImplOptions from 'src/template/tag/itag-impl-options';
|
||||
declare const _default: ITagImplOptions;
|
||||
export default _default;
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
import { EmptyDrop } from 'src/drop/empty-drop';
|
||||
export declare class BlankDrop extends EmptyDrop {
|
||||
equals(value: any): boolean;
|
||||
}
|
||||
Vendored
-2
@@ -1,2 +0,0 @@
|
||||
export declare abstract class Drop {
|
||||
}
|
||||
Vendored
-11
@@ -1,11 +0,0 @@
|
||||
import { Drop } from './drop';
|
||||
import { IComparable } from './icomparable';
|
||||
import { IDrop } from 'src/drop/idrop';
|
||||
export declare class EmptyDrop extends Drop implements IDrop, IComparable {
|
||||
equals(value: any): boolean;
|
||||
gt(): boolean;
|
||||
geq(): boolean;
|
||||
lt(): boolean;
|
||||
leq(): boolean;
|
||||
value(): string;
|
||||
}
|
||||
Vendored
-8
@@ -1,8 +0,0 @@
|
||||
export interface IComparable {
|
||||
equals: (rhs: any) => boolean;
|
||||
gt: (rhs: any) => boolean;
|
||||
geq: (rhs: any) => boolean;
|
||||
lt: (rhs: any) => boolean;
|
||||
leq: (rhs: any) => boolean;
|
||||
}
|
||||
export declare function isComparable(arg: any): arg is IComparable;
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
export interface IDrop {
|
||||
value(): any;
|
||||
}
|
||||
export declare function isDrop(value: any): value is IDrop;
|
||||
Vendored
-11
@@ -1,11 +0,0 @@
|
||||
import { Drop } from './drop';
|
||||
import { IComparable } from './icomparable';
|
||||
import { IDrop } from 'src/drop/idrop';
|
||||
export declare class NullDrop extends Drop implements IDrop, IComparable {
|
||||
equals(value: any): boolean;
|
||||
gt(): boolean;
|
||||
geq(): boolean;
|
||||
lt(): boolean;
|
||||
leq(): boolean;
|
||||
value(): null;
|
||||
}
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import IFS from './ifs';
|
||||
declare const _default: IFS;
|
||||
export default _default;
|
||||
Vendored
-5
@@ -1,5 +0,0 @@
|
||||
export default interface IFS {
|
||||
exists: (filepath: string) => Promise<boolean>;
|
||||
readFile: (filepath: string) => Promise<string>;
|
||||
resolve: (root: string, file: string, ext: string) => string;
|
||||
}
|
||||
Vendored
-3
@@ -1,3 +0,0 @@
|
||||
import IFS from './ifs';
|
||||
declare const fs: IFS;
|
||||
export default fs;
|
||||
Vendored
-53
@@ -1,53 +0,0 @@
|
||||
export interface LiquidOptions {
|
||||
/** `root` is a directory or an array of directories to resolve layouts and includes, as well as the filename passed in when calling `.renderFile()`. If an array, the files are looked up in the order they occur in the array. Defaults to `["."]` */
|
||||
root?: string | string[];
|
||||
/** `extname` is used to lookup the template file when filepath doesn't include an extension name. Eg: setting to `".html"` will allow including file by basename. Defaults to `""`. */
|
||||
extname?: string;
|
||||
/** `cache` indicates whether or not to cache resolved templates. Defaults to `false`. */
|
||||
cache?: boolean;
|
||||
/** `dynamicPartials`: if set, treat `<filepath>` parameter in `{%include filepath %}`, `{%layout filepath%}` as a variable, otherwise as a literal value. Defaults to `true`. */
|
||||
dynamicPartials?: boolean;
|
||||
/** `strict_filters` is used to enable strict filter existence. If set to `false`, undefined filters will be rendered as empty string. Otherwise, undefined filters will cause an exception. Defaults to `false`. */
|
||||
strict_filters?: boolean;
|
||||
/** `strict_variables` is used to enable strict variable derivation. If set to `false`, undefined variables will be rendered as empty string. Otherwise, undefined variables will cause an exception. Defaults to `false`. */
|
||||
strict_variables?: boolean;
|
||||
/** `trim_tag_right` is used to strip blank characters (including ` `, `\t`, and `\r`) from the right of tags (`{% %}`) until `\n` (inclusive). Defaults to `false`. */
|
||||
trim_tag_right?: boolean;
|
||||
/** `trim_tag_left` is similar to `trim_tag_right`, whereas the `\n` is exclusive. Defaults to `false`. See Whitespace Control for details. */
|
||||
trim_tag_left?: boolean;
|
||||
/** ``trim_output_right` is used to strip blank characters (including ` `, `\t`, and `\r`) from the right of values (`{{ }}`) until `\n` (inclusive). Defaults to `false`. */
|
||||
trim_output_right?: boolean;
|
||||
/** `trim_output_left` is similar to `trim_output_right`, whereas the `\n` is exclusive. Defaults to `false`. See Whitespace Control for details. */
|
||||
trim_output_left?: boolean;
|
||||
/** `tag_delimiter_left` and `tag_delimiter_right` are used to override the delimiter for liquid tags **/
|
||||
tag_delimiter_left?: string;
|
||||
tag_delimiter_right?: string;
|
||||
/** `output_delimiter_left` and `output_delimiter_right` are used to override the delimiter for liquid outputs **/
|
||||
output_delimiter_left?: string;
|
||||
output_delimiter_right?: string;
|
||||
/** `greedy` is used to specify whether `trim_left`/`trim_right` is greedy. When set to `true`, all consecutive blank characters including `\n` will be trimed regardless of line breaks. Defaults to `true`. */
|
||||
greedy?: boolean;
|
||||
}
|
||||
interface NormalizedOptions extends LiquidOptions {
|
||||
root?: string[];
|
||||
}
|
||||
export interface NormalizedFullOptions extends NormalizedOptions {
|
||||
root: string[];
|
||||
extname: string;
|
||||
cache: boolean;
|
||||
dynamicPartials: boolean;
|
||||
strict_filters: boolean;
|
||||
strict_variables: boolean;
|
||||
trim_tag_right: boolean;
|
||||
trim_tag_left: boolean;
|
||||
trim_output_right: boolean;
|
||||
trim_output_left: boolean;
|
||||
tag_delimiter_left: string;
|
||||
tag_delimiter_right: string;
|
||||
output_delimiter_left: string;
|
||||
output_delimiter_right: string;
|
||||
greedy: boolean;
|
||||
}
|
||||
export declare function normalize(options?: LiquidOptions): NormalizedOptions;
|
||||
export declare function applyDefault(options?: NormalizedOptions): NormalizedFullOptions;
|
||||
export {};
|
||||
Vendored
-33
@@ -1,33 +0,0 @@
|
||||
import Scope from './scope/scope';
|
||||
import * as Types from './types';
|
||||
import ITemplate from './template/itemplate';
|
||||
import Render from './render/render';
|
||||
import Parser from './parser/parser';
|
||||
import ITagImplOptions from './template/tag/itag-impl-options';
|
||||
import { isTruthy, isFalsy, evalExp, evalValue } from './render/syntax';
|
||||
import { LiquidOptions, NormalizedFullOptions } from './liquid-options';
|
||||
import { FilterImpl } from './template/filter/filter-impl';
|
||||
export default class Liquid {
|
||||
options: NormalizedFullOptions;
|
||||
renderer: Render;
|
||||
parser: Parser;
|
||||
private cache;
|
||||
private tokenizer;
|
||||
constructor(opts?: LiquidOptions);
|
||||
parse(html: string, filepath?: string): ITemplate[];
|
||||
render(tpl: Array<ITemplate>, ctx?: object, opts?: LiquidOptions): Promise<string>;
|
||||
parseAndRender(html: string, ctx?: object, opts?: LiquidOptions): Promise<string>;
|
||||
getTemplate(file: string, opts?: LiquidOptions): Promise<any>;
|
||||
renderFile(file: string, ctx?: object, opts?: LiquidOptions): Promise<string>;
|
||||
evalValue(str: string, scope: Scope): any;
|
||||
registerFilter(name: string, filter: FilterImpl): void;
|
||||
registerTag(name: string, tag: ITagImplOptions): void;
|
||||
plugin(plugin: (this: Liquid, L: typeof Liquid) => void): void;
|
||||
express(): (this: any, filePath: string, ctx: object, cb: (err: Error | null, html?: string | undefined) => void) => void;
|
||||
static default: typeof Liquid;
|
||||
static isTruthy: typeof isTruthy;
|
||||
static isFalsy: typeof isFalsy;
|
||||
static evalExp: typeof evalExp;
|
||||
static evalValue: typeof evalValue;
|
||||
static Types: typeof Types;
|
||||
}
|
||||
Vendored
-6
@@ -1,6 +0,0 @@
|
||||
import Token from './token';
|
||||
export default class DelimitedToken extends Token {
|
||||
trimLeft: boolean;
|
||||
trimRight: boolean;
|
||||
constructor(raw: string, value: string, input: string, line: number, pos: number, file?: string);
|
||||
}
|
||||
Vendored
-4
@@ -1,4 +0,0 @@
|
||||
import Token from './token';
|
||||
export default class HTMLToken extends Token {
|
||||
constructor(str: string, input: string, line: number, col: number, file?: string);
|
||||
}
|
||||
Vendored
-21
@@ -1,21 +0,0 @@
|
||||
export declare const quoted: RegExp;
|
||||
export declare const quoteBalanced: RegExp;
|
||||
export declare const number: RegExp;
|
||||
export declare const bool: RegExp;
|
||||
export declare const identifier: RegExp;
|
||||
export declare const subscript: RegExp;
|
||||
export declare const literal: RegExp;
|
||||
export declare const variable: RegExp;
|
||||
export declare const rangeLimit: RegExp;
|
||||
export declare const range: RegExp;
|
||||
export declare const rangeCapture: RegExp;
|
||||
export declare const value: RegExp;
|
||||
export declare const hash: RegExp;
|
||||
export declare const hashCapture: RegExp;
|
||||
export declare const tagLine: RegExp;
|
||||
export declare const numberLine: RegExp;
|
||||
export declare const boolLine: RegExp;
|
||||
export declare const quotedLine: RegExp;
|
||||
export declare const rangeLine: RegExp;
|
||||
export declare const operators: RegExp[];
|
||||
export declare function isRange(str: string): boolean;
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user