@skeptools/skep-organization-project 0.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.gitattributes +23 -0
- package/.jsii +164 -0
- package/.projenrc.ts +29 -0
- package/API.md +3610 -0
- package/LICENSE +202 -0
- package/README.md +8 -0
- package/files/generated/.seed +1 -0
- package/files/scaffolding/.seed +1 -0
- package/files/scaffolding/README.md.liquid +43 -0
- package/lib/index.d.ts +1 -0
- package/lib/index.js +14 -0
- package/lib/skep-organization-project.d.ts +7 -0
- package/lib/skep-organization-project.js +24 -0
- package/node_modules/liquidjs/CHANGELOG.md +1015 -0
- package/node_modules/liquidjs/LICENSE +21 -0
- package/node_modules/liquidjs/README.md +163 -0
- package/node_modules/liquidjs/bin/liquid.js +24 -0
- package/node_modules/liquidjs/dist/builtin/filters/array.d.ts +15 -0
- package/node_modules/liquidjs/dist/builtin/filters/date.d.ts +2 -0
- package/node_modules/liquidjs/dist/builtin/filters/html.d.ts +4 -0
- package/node_modules/liquidjs/dist/builtin/filters/index.d.ts +7 -0
- package/node_modules/liquidjs/dist/builtin/filters/math.d.ts +11 -0
- package/node_modules/liquidjs/dist/builtin/filters/misc.d.ts +5 -0
- package/node_modules/liquidjs/dist/builtin/filters/string.d.ts +16 -0
- package/node_modules/liquidjs/dist/builtin/filters/url.d.ts +2 -0
- package/node_modules/liquidjs/dist/builtin/tags/assign.d.ts +3 -0
- package/node_modules/liquidjs/dist/builtin/tags/block.d.ts +8 -0
- package/node_modules/liquidjs/dist/builtin/tags/break.d.ts +5 -0
- package/node_modules/liquidjs/dist/builtin/tags/capture.d.ts +3 -0
- package/node_modules/liquidjs/dist/builtin/tags/case.d.ts +3 -0
- package/node_modules/liquidjs/dist/builtin/tags/comment.d.ts +3 -0
- package/node_modules/liquidjs/dist/builtin/tags/continue.d.ts +5 -0
- package/node_modules/liquidjs/dist/builtin/tags/cycle.d.ts +3 -0
- package/node_modules/liquidjs/dist/builtin/tags/decrement.d.ts +3 -0
- package/node_modules/liquidjs/dist/builtin/tags/echo.d.ts +3 -0
- package/node_modules/liquidjs/dist/builtin/tags/for.d.ts +3 -0
- package/node_modules/liquidjs/dist/builtin/tags/if.d.ts +3 -0
- package/node_modules/liquidjs/dist/builtin/tags/include.d.ts +3 -0
- package/node_modules/liquidjs/dist/builtin/tags/increment.d.ts +3 -0
- package/node_modules/liquidjs/dist/builtin/tags/index.d.ts +5 -0
- package/node_modules/liquidjs/dist/builtin/tags/inline-comment.d.ts +3 -0
- package/node_modules/liquidjs/dist/builtin/tags/layout.d.ts +3 -0
- package/node_modules/liquidjs/dist/builtin/tags/liquid.d.ts +3 -0
- package/node_modules/liquidjs/dist/builtin/tags/raw.d.ts +3 -0
- package/node_modules/liquidjs/dist/builtin/tags/render.d.ts +13 -0
- package/node_modules/liquidjs/dist/builtin/tags/tablerow.d.ts +3 -0
- package/node_modules/liquidjs/dist/builtin/tags/unless.d.ts +3 -0
- package/node_modules/liquidjs/dist/cache/cache.d.ts +7 -0
- package/node_modules/liquidjs/dist/cache/lru.d.ts +14 -0
- package/node_modules/liquidjs/dist/context/block-mode.d.ts +5 -0
- package/node_modules/liquidjs/dist/context/context.d.ts +53 -0
- package/node_modules/liquidjs/dist/context/scope.d.ts +6 -0
- package/node_modules/liquidjs/dist/drop/blank-drop.d.ts +4 -0
- package/node_modules/liquidjs/dist/drop/block-drop.d.ts +10 -0
- package/node_modules/liquidjs/dist/drop/comparable.d.ts +8 -0
- package/node_modules/liquidjs/dist/drop/drop.d.ts +3 -0
- package/node_modules/liquidjs/dist/drop/empty-drop.d.ts +10 -0
- package/node_modules/liquidjs/dist/drop/forloop-drop.d.ts +15 -0
- package/node_modules/liquidjs/dist/drop/null-drop.d.ts +10 -0
- package/node_modules/liquidjs/dist/drop/tablerowloop-drop.d.ts +10 -0
- package/node_modules/liquidjs/dist/emitters/emitter.d.ts +11 -0
- package/node_modules/liquidjs/dist/emitters/keeping-type-emitter.d.ts +5 -0
- package/node_modules/liquidjs/dist/emitters/simple-emitter.d.ts +5 -0
- package/node_modules/liquidjs/dist/emitters/streamed-emitter-browser.d.ts +10 -0
- package/node_modules/liquidjs/dist/emitters/streamed-emitter.d.ts +9 -0
- package/node_modules/liquidjs/dist/fs/browser.d.ts +7 -0
- package/node_modules/liquidjs/dist/fs/fs.d.ts +20 -0
- package/node_modules/liquidjs/dist/fs/loader.d.ts +24 -0
- package/node_modules/liquidjs/dist/fs/node-require.d.ts +2 -0
- package/node_modules/liquidjs/dist/fs/node.d.ts +9 -0
- package/node_modules/liquidjs/dist/liquid-options.d.ts +128 -0
- package/node_modules/liquidjs/dist/liquid.browser.esm.js +3523 -0
- package/node_modules/liquidjs/dist/liquid.browser.min.js +2 -0
- package/node_modules/liquidjs/dist/liquid.browser.min.js.map +1 -0
- package/node_modules/liquidjs/dist/liquid.browser.umd.js +4811 -0
- package/node_modules/liquidjs/dist/liquid.browser.umd.js.map +1 -0
- package/node_modules/liquidjs/dist/liquid.d.ts +43 -0
- package/node_modules/liquidjs/dist/liquid.node.cjs.js +4820 -0
- package/node_modules/liquidjs/dist/liquid.node.esm.js +3540 -0
- package/node_modules/liquidjs/dist/parser/filter-arg.d.ts +5 -0
- package/node_modules/liquidjs/dist/parser/match-operator.d.ts +2 -0
- package/node_modules/liquidjs/dist/parser/parse-stream.d.ts +16 -0
- package/node_modules/liquidjs/dist/parser/parse-string-literal.d.ts +1 -0
- package/node_modules/liquidjs/dist/parser/parser.d.ts +22 -0
- package/node_modules/liquidjs/dist/parser/token-kind.d.ts +15 -0
- package/node_modules/liquidjs/dist/parser/tokenizer.d.ts +66 -0
- package/node_modules/liquidjs/dist/parser/whitespace-ctrl.d.ts +3 -0
- package/node_modules/liquidjs/dist/render/boolean.d.ts +3 -0
- package/node_modules/liquidjs/dist/render/expression.d.ts +14 -0
- package/node_modules/liquidjs/dist/render/operator.d.ts +5 -0
- package/node_modules/liquidjs/dist/render/render.d.ts +8 -0
- package/node_modules/liquidjs/dist/template/filter/filter-impl-options.d.ts +4 -0
- package/node_modules/liquidjs/dist/template/filter/filter-impl.d.ts +6 -0
- package/node_modules/liquidjs/dist/template/filter/filter-map.d.ts +13 -0
- package/node_modules/liquidjs/dist/template/filter/filter.d.ts +12 -0
- package/node_modules/liquidjs/dist/template/html.d.ts +10 -0
- package/node_modules/liquidjs/dist/template/output.d.ts +11 -0
- package/node_modules/liquidjs/dist/template/tag/hash.d.ts +17 -0
- package/node_modules/liquidjs/dist/template/tag/tag-impl-options.d.ts +10 -0
- package/node_modules/liquidjs/dist/template/tag/tag-impl.d.ts +6 -0
- package/node_modules/liquidjs/dist/template/tag/tag-map.d.ts +6 -0
- package/node_modules/liquidjs/dist/template/tag/tag.d.ts +10 -0
- package/node_modules/liquidjs/dist/template/template-impl.d.ts +4 -0
- package/node_modules/liquidjs/dist/template/template.d.ts +7 -0
- package/node_modules/liquidjs/dist/template/value.d.ts +13 -0
- package/node_modules/liquidjs/dist/tokens/delimited-token.d.ts +8 -0
- package/node_modules/liquidjs/dist/tokens/filter-token.d.ts +7 -0
- package/node_modules/liquidjs/dist/tokens/hash-token.d.ts +12 -0
- package/node_modules/liquidjs/dist/tokens/html-token.d.ts +11 -0
- package/node_modules/liquidjs/dist/tokens/identifier-token.d.ts +10 -0
- package/node_modules/liquidjs/dist/tokens/liquid-tag-token.d.ts +7 -0
- package/node_modules/liquidjs/dist/tokens/literal-token.d.ts +9 -0
- package/node_modules/liquidjs/dist/tokens/number-token.d.ts +7 -0
- package/node_modules/liquidjs/dist/tokens/operator-token.d.ts +21 -0
- package/node_modules/liquidjs/dist/tokens/output-token.d.ts +5 -0
- package/node_modules/liquidjs/dist/tokens/property-access-token.d.ts +9 -0
- package/node_modules/liquidjs/dist/tokens/quoted-token.d.ts +8 -0
- package/node_modules/liquidjs/dist/tokens/range-token.d.ts +11 -0
- package/node_modules/liquidjs/dist/tokens/tag-token.d.ts +7 -0
- package/node_modules/liquidjs/dist/tokens/token.d.ts +12 -0
- package/node_modules/liquidjs/dist/tokens/toplevel-token.d.ts +4 -0
- package/node_modules/liquidjs/dist/tokens/value-token.d.ts +5 -0
- package/node_modules/liquidjs/dist/types.d.ts +30 -0
- package/node_modules/liquidjs/dist/util/assert.d.ts +1 -0
- package/node_modules/liquidjs/dist/util/async.d.ts +3 -0
- package/node_modules/liquidjs/dist/util/character.d.ts +8 -0
- package/node_modules/liquidjs/dist/util/collection.d.ts +2 -0
- package/node_modules/liquidjs/dist/util/error.d.ts +29 -0
- package/node_modules/liquidjs/dist/util/liquid-date.d.ts +19 -0
- package/node_modules/liquidjs/dist/util/literal.d.ts +11 -0
- package/node_modules/liquidjs/dist/util/operator-trie.d.ts +5 -0
- package/node_modules/liquidjs/dist/util/strftime.d.ts +2 -0
- package/node_modules/liquidjs/dist/util/timezone-date.d.ts +39 -0
- package/node_modules/liquidjs/dist/util/type-guards.d.ts +22 -0
- package/node_modules/liquidjs/dist/util/underscore.d.ts +37 -0
- package/node_modules/liquidjs/package.json +165 -0
- package/package.json +133 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Token } from '../tokens/token';
|
|
2
|
+
import { Template } from '../template/template';
|
|
3
|
+
import { TopLevelToken } from '../tokens/toplevel-token';
|
|
4
|
+
declare type ParseToken<T extends Token> = ((token: T, remainTokens: T[]) => Template);
|
|
5
|
+
export declare class ParseStream<T extends Token = TopLevelToken> {
|
|
6
|
+
private tokens;
|
|
7
|
+
private handlers;
|
|
8
|
+
private stopRequested;
|
|
9
|
+
private parseToken;
|
|
10
|
+
constructor(tokens: T[], parseToken: ParseToken<T>);
|
|
11
|
+
on<T2 extends Template | T | undefined>(name: string, cb: (this: ParseStream, arg: T2) => void): ParseStream<T>;
|
|
12
|
+
private trigger;
|
|
13
|
+
start(): this;
|
|
14
|
+
stop(): this;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function parseStringLiteral(str: string): string;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Liquid } from '../liquid';
|
|
2
|
+
import { ParseStream } from './parse-stream';
|
|
3
|
+
import { Tag } from '../template/tag/tag';
|
|
4
|
+
import { Output } from '../template/output';
|
|
5
|
+
import { HTML } from '../template/html';
|
|
6
|
+
import { Template } from '../template/template';
|
|
7
|
+
import { TopLevelToken } from '../tokens/toplevel-token';
|
|
8
|
+
import { LookupType } from '../fs/loader';
|
|
9
|
+
export default class Parser {
|
|
10
|
+
parseFile: (file: string, sync?: boolean, type?: LookupType, currentFile?: string) => Generator<unknown, Template[], Template[] | string>;
|
|
11
|
+
private liquid;
|
|
12
|
+
private fs;
|
|
13
|
+
private cache?;
|
|
14
|
+
private loader;
|
|
15
|
+
constructor(liquid: Liquid);
|
|
16
|
+
parse(html: string, filepath?: string): Template[];
|
|
17
|
+
parseTokens(tokens: TopLevelToken[]): Template[];
|
|
18
|
+
parseToken(token: TopLevelToken, remainTokens: TopLevelToken[]): Tag | Output | HTML;
|
|
19
|
+
parseStream(tokens: TopLevelToken[]): ParseStream<TopLevelToken>;
|
|
20
|
+
private _parseFileCached;
|
|
21
|
+
private _parseFile;
|
|
22
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { IdentifierToken } from '../tokens/identifier-token';
|
|
2
|
+
import { OperatorToken } from '../tokens/operator-token';
|
|
3
|
+
import { TopLevelToken } from '../tokens/toplevel-token';
|
|
4
|
+
import { FilterArg } from './filter-arg';
|
|
5
|
+
import { FilterToken } from '../tokens/filter-token';
|
|
6
|
+
import { HashToken } from '../tokens/hash-token';
|
|
7
|
+
import { QuotedToken } from '../tokens/quoted-token';
|
|
8
|
+
import { HTMLToken } from '../tokens/html-token';
|
|
9
|
+
import { TagToken } from '../tokens/tag-token';
|
|
10
|
+
import { Token } from '../tokens/token';
|
|
11
|
+
import { RangeToken } from '../tokens/range-token';
|
|
12
|
+
import { ValueToken } from '../tokens/value-token';
|
|
13
|
+
import { OutputToken } from '../tokens/output-token';
|
|
14
|
+
import { TokenizationError } from '../util/error';
|
|
15
|
+
import { NormalizedFullOptions } from '../liquid-options';
|
|
16
|
+
import { Trie } from '../util/operator-trie';
|
|
17
|
+
import { Expression } from '../render/expression';
|
|
18
|
+
import { LiquidTagToken } from '../tokens/liquid-tag-token';
|
|
19
|
+
export declare class Tokenizer {
|
|
20
|
+
input: string;
|
|
21
|
+
private trie;
|
|
22
|
+
file: string;
|
|
23
|
+
p: number;
|
|
24
|
+
N: number;
|
|
25
|
+
private rawBeginAt;
|
|
26
|
+
constructor(input: string, trie?: Trie, file?: string);
|
|
27
|
+
readExpression(): Expression;
|
|
28
|
+
readExpressionTokens(): IterableIterator<Token>;
|
|
29
|
+
readOperator(): OperatorToken | undefined;
|
|
30
|
+
readFilters(): FilterToken[];
|
|
31
|
+
readFilter(): FilterToken | null;
|
|
32
|
+
readFilterArg(): FilterArg | undefined;
|
|
33
|
+
readTopLevelTokens(options?: NormalizedFullOptions): TopLevelToken[];
|
|
34
|
+
readTopLevelToken(options: NormalizedFullOptions): TopLevelToken;
|
|
35
|
+
readHTMLToken(stopStrings: string[]): HTMLToken;
|
|
36
|
+
readTagToken(options?: NormalizedFullOptions): TagToken;
|
|
37
|
+
readToDelimiter(delimiter: string): number;
|
|
38
|
+
readOutputToken(options?: NormalizedFullOptions): OutputToken;
|
|
39
|
+
readEndrawOrRawContent(options: NormalizedFullOptions): HTMLToken | TagToken;
|
|
40
|
+
readLiquidTagTokens(options?: NormalizedFullOptions): LiquidTagToken[];
|
|
41
|
+
readLiquidTagToken(options: NormalizedFullOptions): LiquidTagToken;
|
|
42
|
+
mkError(msg: string, begin: number): TokenizationError;
|
|
43
|
+
snapshot(begin?: number): string;
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated
|
|
46
|
+
*/
|
|
47
|
+
readWord(): IdentifierToken;
|
|
48
|
+
readIdentifier(): IdentifierToken;
|
|
49
|
+
readTagName(): string;
|
|
50
|
+
readHashes(jekyllStyle?: boolean): HashToken[];
|
|
51
|
+
readHash(jekyllStyle?: boolean): HashToken | undefined;
|
|
52
|
+
remaining(): string;
|
|
53
|
+
advance(i?: number): void;
|
|
54
|
+
end(): boolean;
|
|
55
|
+
readTo(end: string): number;
|
|
56
|
+
readValue(): ValueToken | undefined;
|
|
57
|
+
readRange(): RangeToken | undefined;
|
|
58
|
+
readValueOrThrow(): ValueToken;
|
|
59
|
+
readQuoted(): QuotedToken | undefined;
|
|
60
|
+
readFileNameTemplate(options: NormalizedFullOptions): IterableIterator<TopLevelToken>;
|
|
61
|
+
match(word: string): boolean;
|
|
62
|
+
rmatch(pattern: string): boolean;
|
|
63
|
+
peekType(n?: number): number;
|
|
64
|
+
peek(n?: number): string;
|
|
65
|
+
skipBlank(): void;
|
|
66
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { QuotedToken } from '../tokens/quoted-token';
|
|
2
|
+
import { Token } from '../tokens/token';
|
|
3
|
+
import { Context } from '../context/context';
|
|
4
|
+
export declare class Expression {
|
|
5
|
+
private postfix;
|
|
6
|
+
constructor(tokens: IterableIterator<Token>);
|
|
7
|
+
evaluate(ctx: Context, lenient?: boolean): Generator<unknown, unknown, unknown>;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* @deprecated use `_evalToken` instead
|
|
11
|
+
*/
|
|
12
|
+
export declare function evalToken(token: Token | undefined, ctx: Context, lenient?: boolean): Generator<never, any, unknown>;
|
|
13
|
+
export declare function _evalToken(token: Token | undefined, ctx: Context, lenient?: boolean): IterableIterator<unknown>;
|
|
14
|
+
export declare function evalQuotedToken(token: QuotedToken): string;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import { Context } from '../context/context';
|
|
3
|
+
import { Template } from '../template/template';
|
|
4
|
+
import { Emitter } from '../emitters/emitter';
|
|
5
|
+
export declare class Render {
|
|
6
|
+
renderTemplatesToNodeStream(templates: Template[], ctx: Context): NodeJS.ReadableStream;
|
|
7
|
+
renderTemplates(templates: Template[], ctx: Context, emitter?: Emitter): IterableIterator<any>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FilterImplOptions } from './filter-impl-options';
|
|
2
|
+
import { Filter } from './filter';
|
|
3
|
+
import { FilterArg } from '../../parser/filter-arg';
|
|
4
|
+
import { Liquid } from '../../liquid';
|
|
5
|
+
export declare class FilterMap {
|
|
6
|
+
private readonly strictFilters;
|
|
7
|
+
private readonly liquid;
|
|
8
|
+
private impls;
|
|
9
|
+
constructor(strictFilters: boolean, liquid: Liquid);
|
|
10
|
+
get(name: string): FilterImplOptions;
|
|
11
|
+
set(name: string, impl: FilterImplOptions): void;
|
|
12
|
+
create(name: string, args: FilterArg[]): Filter;
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Context } from '../../context/context';
|
|
2
|
+
import { FilterImplOptions } from './filter-impl-options';
|
|
3
|
+
import { FilterArg } from '../../parser/filter-arg';
|
|
4
|
+
import { Liquid } from '../../liquid';
|
|
5
|
+
export declare class Filter {
|
|
6
|
+
name: string;
|
|
7
|
+
args: FilterArg[];
|
|
8
|
+
private impl;
|
|
9
|
+
private liquid;
|
|
10
|
+
constructor(name: string, impl: FilterImplOptions, args: FilterArg[], liquid: Liquid);
|
|
11
|
+
render(value: any, context: Context): IterableIterator<unknown>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { TemplateImpl } from '../template/template-impl';
|
|
2
|
+
import { Template } from '../template/template';
|
|
3
|
+
import { HTMLToken } from '../tokens/html-token';
|
|
4
|
+
import { Context } from '../context/context';
|
|
5
|
+
import { Emitter } from '../emitters/emitter';
|
|
6
|
+
export declare class HTML extends TemplateImpl<HTMLToken> implements Template {
|
|
7
|
+
private str;
|
|
8
|
+
constructor(token: HTMLToken);
|
|
9
|
+
render(ctx: Context, emitter: Emitter): IterableIterator<void>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { TemplateImpl } from '../template/template-impl';
|
|
2
|
+
import { Template } from '../template/template';
|
|
3
|
+
import { Context } from '../context/context';
|
|
4
|
+
import { Emitter } from '../emitters/emitter';
|
|
5
|
+
import { OutputToken } from '../tokens/output-token';
|
|
6
|
+
import { Liquid } from '../liquid';
|
|
7
|
+
export declare class Output extends TemplateImpl<OutputToken> implements Template {
|
|
8
|
+
private value;
|
|
9
|
+
constructor(token: OutputToken, liquid: Liquid);
|
|
10
|
+
render(ctx: Context, emitter: Emitter): IterableIterator<unknown>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Context } from '../../context/context';
|
|
2
|
+
export interface HashValue {
|
|
3
|
+
[key: string]: any;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Key-Value Pairs Representing Tag Arguments
|
|
7
|
+
* Example:
|
|
8
|
+
* For the markup `, foo:'bar', coo:2 reversed %}`,
|
|
9
|
+
* hash['foo'] === 'bar'
|
|
10
|
+
* hash['coo'] === 2
|
|
11
|
+
* hash['reversed'] === undefined
|
|
12
|
+
*/
|
|
13
|
+
export declare class Hash {
|
|
14
|
+
hash: HashValue;
|
|
15
|
+
constructor(markup: string, jekyllStyle?: boolean);
|
|
16
|
+
render(ctx: Context): Generator<unknown, HashValue, unknown>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Context } from '../../context/context';
|
|
2
|
+
import { TagToken } from '../../tokens/tag-token';
|
|
3
|
+
import { TopLevelToken } from '../../tokens/toplevel-token';
|
|
4
|
+
import { TagImpl } from './tag-impl';
|
|
5
|
+
import { HashValue } from '../../template/tag/hash';
|
|
6
|
+
import { Emitter } from '../../emitters/emitter';
|
|
7
|
+
export interface TagImplOptions {
|
|
8
|
+
parse?: (this: TagImpl, token: TagToken, remainingTokens: TopLevelToken[]) => void;
|
|
9
|
+
render: (this: TagImpl, ctx: Context, emitter: Emitter, hash: HashValue) => void | string | Promise<void | string> | Generator<unknown, void | string, unknown>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Liquid } from '../../liquid';
|
|
2
|
+
import { TemplateImpl } from '../../template/template-impl';
|
|
3
|
+
import { Emitter, Context, TagToken, Template, TopLevelToken } from '../../types';
|
|
4
|
+
import { HashValue } from './hash';
|
|
5
|
+
export declare class Tag extends TemplateImpl<TagToken> implements Template {
|
|
6
|
+
name: string;
|
|
7
|
+
private impl;
|
|
8
|
+
constructor(token: TagToken, tokens: TopLevelToken[], liquid: Liquid);
|
|
9
|
+
render(ctx: Context, emitter: Emitter): Generator<unknown, unknown, HashValue | unknown>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Expression } from '../render/expression';
|
|
2
|
+
import { Filter } from './filter/filter';
|
|
3
|
+
import { Context } from '../context/context';
|
|
4
|
+
import { Liquid } from '../liquid';
|
|
5
|
+
export declare class Value {
|
|
6
|
+
readonly filters: Filter[];
|
|
7
|
+
readonly initial: Expression;
|
|
8
|
+
/**
|
|
9
|
+
* @param str the value to be valuated, eg.: "foobar" | truncate: 3
|
|
10
|
+
*/
|
|
11
|
+
constructor(str: string, liquid: Liquid);
|
|
12
|
+
value(ctx: Context, lenient: boolean): Generator<unknown, unknown, unknown>;
|
|
13
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Token } from './token';
|
|
2
|
+
import { TokenKind } from '../parser/token-kind';
|
|
3
|
+
export declare abstract class DelimitedToken extends Token {
|
|
4
|
+
trimLeft: boolean;
|
|
5
|
+
trimRight: boolean;
|
|
6
|
+
content: string;
|
|
7
|
+
constructor(kind: TokenKind, content: string, input: string, begin: number, end: number, trimLeft: boolean, trimRight: boolean, file?: string);
|
|
8
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Token } from './token';
|
|
2
|
+
import { FilterArg } from '../parser/filter-arg';
|
|
3
|
+
export declare class FilterToken extends Token {
|
|
4
|
+
name: string;
|
|
5
|
+
args: FilterArg[];
|
|
6
|
+
constructor(name: string, args: FilterArg[], input: string, begin: number, end: number, file?: string);
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Token } from './token';
|
|
2
|
+
import { ValueToken } from './value-token';
|
|
3
|
+
import { IdentifierToken } from './identifier-token';
|
|
4
|
+
export declare class HashToken extends Token {
|
|
5
|
+
input: string;
|
|
6
|
+
begin: number;
|
|
7
|
+
end: number;
|
|
8
|
+
name: IdentifierToken;
|
|
9
|
+
value?: ValueToken | undefined;
|
|
10
|
+
file?: string | undefined;
|
|
11
|
+
constructor(input: string, begin: number, end: number, name: IdentifierToken, value?: ValueToken | undefined, file?: string | undefined);
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Token } from './token';
|
|
2
|
+
export declare class HTMLToken extends Token {
|
|
3
|
+
input: string;
|
|
4
|
+
begin: number;
|
|
5
|
+
end: number;
|
|
6
|
+
file?: string | undefined;
|
|
7
|
+
trimLeft: number;
|
|
8
|
+
trimRight: number;
|
|
9
|
+
constructor(input: string, begin: number, end: number, file?: string | undefined);
|
|
10
|
+
getContent(): string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { Token } from './token';
|
|
2
|
+
export declare class IdentifierToken extends Token {
|
|
3
|
+
input: string;
|
|
4
|
+
begin: number;
|
|
5
|
+
end: number;
|
|
6
|
+
file?: string | undefined;
|
|
7
|
+
content: string;
|
|
8
|
+
constructor(input: string, begin: number, end: number, file?: string | undefined);
|
|
9
|
+
isNumber(allowSign?: boolean): boolean;
|
|
10
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DelimitedToken } from './delimited-token';
|
|
2
|
+
import { NormalizedFullOptions } from '../liquid-options';
|
|
3
|
+
export declare class LiquidTagToken extends DelimitedToken {
|
|
4
|
+
name: string;
|
|
5
|
+
args: string;
|
|
6
|
+
constructor(input: string, begin: number, end: number, options: NormalizedFullOptions, file?: string);
|
|
7
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Token } from './token';
|
|
2
|
+
export declare class LiteralToken extends Token {
|
|
3
|
+
input: string;
|
|
4
|
+
begin: number;
|
|
5
|
+
end: number;
|
|
6
|
+
file?: string | undefined;
|
|
7
|
+
literal: string;
|
|
8
|
+
constructor(input: string, begin: number, end: number, file?: string | undefined);
|
|
9
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { Token } from './token';
|
|
2
|
+
import { IdentifierToken } from './identifier-token';
|
|
3
|
+
export declare class NumberToken extends Token {
|
|
4
|
+
whole: IdentifierToken;
|
|
5
|
+
decimal?: IdentifierToken | undefined;
|
|
6
|
+
constructor(whole: IdentifierToken, decimal?: IdentifierToken | undefined);
|
|
7
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Token } from './token';
|
|
2
|
+
export declare const precedence: {
|
|
3
|
+
'==': number;
|
|
4
|
+
'!=': number;
|
|
5
|
+
'>': number;
|
|
6
|
+
'<': number;
|
|
7
|
+
'>=': number;
|
|
8
|
+
'<=': number;
|
|
9
|
+
contains: number;
|
|
10
|
+
and: number;
|
|
11
|
+
or: number;
|
|
12
|
+
};
|
|
13
|
+
export declare class OperatorToken extends Token {
|
|
14
|
+
input: string;
|
|
15
|
+
begin: number;
|
|
16
|
+
end: number;
|
|
17
|
+
file?: string | undefined;
|
|
18
|
+
operator: string;
|
|
19
|
+
constructor(input: string, begin: number, end: number, file?: string | undefined);
|
|
20
|
+
getPrecedence(): any;
|
|
21
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { DelimitedToken } from './delimited-token';
|
|
2
|
+
import { NormalizedFullOptions } from '../liquid-options';
|
|
3
|
+
export declare class OutputToken extends DelimitedToken {
|
|
4
|
+
constructor(input: string, begin: number, end: number, options: NormalizedFullOptions, file?: string);
|
|
5
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Token } from './token';
|
|
2
|
+
import { IdentifierToken } from './identifier-token';
|
|
3
|
+
import { QuotedToken } from './quoted-token';
|
|
4
|
+
export declare class PropertyAccessToken extends Token {
|
|
5
|
+
variable: IdentifierToken | QuotedToken;
|
|
6
|
+
props: (IdentifierToken | QuotedToken | PropertyAccessToken)[];
|
|
7
|
+
propertyName: string;
|
|
8
|
+
constructor(variable: IdentifierToken | QuotedToken, props: (IdentifierToken | QuotedToken | PropertyAccessToken)[], end: number);
|
|
9
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Token } from './token';
|
|
2
|
+
import { ValueToken } from './value-token';
|
|
3
|
+
export declare class RangeToken extends Token {
|
|
4
|
+
input: string;
|
|
5
|
+
begin: number;
|
|
6
|
+
end: number;
|
|
7
|
+
lhs: ValueToken;
|
|
8
|
+
rhs: ValueToken;
|
|
9
|
+
file?: string | undefined;
|
|
10
|
+
constructor(input: string, begin: number, end: number, lhs: ValueToken, rhs: ValueToken, file?: string | undefined);
|
|
11
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DelimitedToken } from './delimited-token';
|
|
2
|
+
import { NormalizedFullOptions } from '../liquid-options';
|
|
3
|
+
export declare class TagToken extends DelimitedToken {
|
|
4
|
+
name: string;
|
|
5
|
+
args: string;
|
|
6
|
+
constructor(input: string, begin: number, end: number, options: NormalizedFullOptions, file?: string);
|
|
7
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { TokenKind } from '../parser/token-kind';
|
|
2
|
+
export declare abstract class Token {
|
|
3
|
+
kind: TokenKind;
|
|
4
|
+
input: string;
|
|
5
|
+
begin: number;
|
|
6
|
+
end: number;
|
|
7
|
+
file?: string | undefined;
|
|
8
|
+
constructor(kind: TokenKind, input: string, begin: number, end: number, file?: string | undefined);
|
|
9
|
+
getText(): string;
|
|
10
|
+
getPosition(): number[];
|
|
11
|
+
size(): number;
|
|
12
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { RangeToken } from './range-token';
|
|
2
|
+
import { LiteralToken } from './literal-token';
|
|
3
|
+
import { QuotedToken } from './quoted-token';
|
|
4
|
+
import { PropertyAccessToken } from './property-access-token';
|
|
5
|
+
export declare type ValueToken = RangeToken | LiteralToken | QuotedToken | PropertyAccessToken;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as TypeGuards from './util/type-guards';
|
|
2
|
+
export { TypeGuards };
|
|
3
|
+
export { ParseError, TokenizationError, AssertionError } from './util/error';
|
|
4
|
+
export { assert } from './util/assert';
|
|
5
|
+
export { Drop } from './drop/drop';
|
|
6
|
+
export { Emitter } from './emitters/emitter';
|
|
7
|
+
export { Expression } from './render/expression';
|
|
8
|
+
export { isFalsy, isTruthy } from './render/boolean';
|
|
9
|
+
export { TagToken } from './tokens/tag-token';
|
|
10
|
+
export { Context } from './context/context';
|
|
11
|
+
export { Template } from './template/template';
|
|
12
|
+
export { FilterImplOptions } from './template/filter/filter-impl-options';
|
|
13
|
+
export { TagImplOptions } from './template/tag/tag-impl-options';
|
|
14
|
+
export { TagImpl } from './template/tag/tag-impl';
|
|
15
|
+
export { ParseStream } from './parser/parse-stream';
|
|
16
|
+
export { Token } from './tokens/token';
|
|
17
|
+
export { TokenKind } from './parser/token-kind';
|
|
18
|
+
export { TopLevelToken } from './tokens/toplevel-token';
|
|
19
|
+
export { Tokenizer } from './parser/tokenizer';
|
|
20
|
+
export { Hash } from './template/tag/hash';
|
|
21
|
+
export { Value } from './template/value';
|
|
22
|
+
export { _evalToken, evalToken, evalQuotedToken } from './render/expression';
|
|
23
|
+
export { toPromise, toThenable, toValueSync } from './util/async';
|
|
24
|
+
export { defaultOperators, Operators } from './render/operator';
|
|
25
|
+
export { createTrie, Trie } from './util/operator-trie';
|
|
26
|
+
export { toValue } from './util/underscore';
|
|
27
|
+
export { TimezoneDate } from './util/timezone-date';
|
|
28
|
+
export * as filters from './builtin/filters';
|
|
29
|
+
export * as tags from './builtin/tags';
|
|
30
|
+
export { defaultOptions } from './liquid-options';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function assert<T>(predicate: T | null | undefined, message?: string | (() => string)): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const TYPES: number[];
|
|
2
|
+
export declare const IDENTIFIER = 1;
|
|
3
|
+
export declare const OPERATOR = 2;
|
|
4
|
+
export declare const BLANK = 4;
|
|
5
|
+
export declare const QUOTE = 8;
|
|
6
|
+
export declare const INLINE_BLANK = 16;
|
|
7
|
+
export declare const NUMBER = 32;
|
|
8
|
+
export declare const SIGN = 64;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Token } from '../tokens/token';
|
|
2
|
+
import { Template } from '../template/template';
|
|
3
|
+
export declare abstract class LiquidError extends Error {
|
|
4
|
+
private token;
|
|
5
|
+
context: string;
|
|
6
|
+
private originalError;
|
|
7
|
+
constructor(err: Error, token: Token);
|
|
8
|
+
protected update(): void;
|
|
9
|
+
}
|
|
10
|
+
export declare class TokenizationError extends LiquidError {
|
|
11
|
+
constructor(message: string, token: Token);
|
|
12
|
+
}
|
|
13
|
+
export declare class ParseError extends LiquidError {
|
|
14
|
+
constructor(err: Error, token: Token);
|
|
15
|
+
}
|
|
16
|
+
export declare class RenderError extends LiquidError {
|
|
17
|
+
constructor(err: Error, tpl: Template);
|
|
18
|
+
static is(obj: any): obj is RenderError;
|
|
19
|
+
}
|
|
20
|
+
export declare class UndefinedVariableError extends LiquidError {
|
|
21
|
+
constructor(err: Error, token: Token);
|
|
22
|
+
}
|
|
23
|
+
export declare class InternalUndefinedVariableError extends Error {
|
|
24
|
+
variableName: string;
|
|
25
|
+
constructor(variableName: string);
|
|
26
|
+
}
|
|
27
|
+
export declare class AssertionError extends Error {
|
|
28
|
+
constructor(message: string);
|
|
29
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The date interface LiquidJS uses.
|
|
3
|
+
* Basically a subset of JavaScript Date,
|
|
4
|
+
* it's defined abstractly here to allow different implementation
|
|
5
|
+
*/
|
|
6
|
+
export interface LiquidDate {
|
|
7
|
+
getTime(): number;
|
|
8
|
+
getMilliseconds(): number;
|
|
9
|
+
getSeconds(): number;
|
|
10
|
+
getMinutes(): number;
|
|
11
|
+
getHours(): number;
|
|
12
|
+
getDay(): number;
|
|
13
|
+
getDate(): number;
|
|
14
|
+
getMonth(): number;
|
|
15
|
+
getFullYear(): number;
|
|
16
|
+
getTimezoneOffset(): number;
|
|
17
|
+
toLocaleTimeString(): string;
|
|
18
|
+
toLocaleDateString(): string;
|
|
19
|
+
}
|