@nocobase/plugin-flow-engine 2.2.27 → 2.2.28

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.
Files changed (173) hide show
  1. package/dist/externalVersion.js +9 -9
  2. package/dist/node_modules/@ant-design/icons-svg/package.json +1 -1
  3. package/dist/node_modules/acorn/package.json +1 -1
  4. package/dist/node_modules/acorn-jsx/package.json +1 -1
  5. package/dist/node_modules/acorn-walk/package.json +1 -1
  6. package/dist/node_modules/liquidjs/LICENSE +21 -0
  7. package/dist/node_modules/liquidjs/bin/liquid.js +139 -0
  8. package/dist/node_modules/liquidjs/dist/build/fs-impl-browser.d.ts +7 -0
  9. package/dist/node_modules/liquidjs/dist/build/fs-impl-browser.spec.d.ts +1 -0
  10. package/dist/node_modules/liquidjs/dist/build/streamed-emitter-browser.d.ts +10 -0
  11. package/dist/node_modules/liquidjs/dist/build/streamed-emitter-browser.spec.d.ts +1 -0
  12. package/dist/node_modules/liquidjs/dist/cache/cache.d.ts +7 -0
  13. package/dist/node_modules/liquidjs/dist/cache/index.d.ts +2 -0
  14. package/dist/node_modules/liquidjs/dist/cache/lru.d.ts +14 -0
  15. package/dist/node_modules/liquidjs/dist/cache/lru.spec.d.ts +1 -0
  16. package/dist/node_modules/liquidjs/dist/context/block-mode.d.ts +4 -0
  17. package/dist/node_modules/liquidjs/dist/context/context.d.ts +64 -0
  18. package/dist/node_modules/liquidjs/dist/context/context.spec.d.ts +1 -0
  19. package/dist/node_modules/liquidjs/dist/context/index.d.ts +3 -0
  20. package/dist/node_modules/liquidjs/dist/context/scope.d.ts +6 -0
  21. package/dist/node_modules/liquidjs/dist/drop/blank-drop.d.ts +5 -0
  22. package/dist/node_modules/liquidjs/dist/drop/block-drop.d.ts +11 -0
  23. package/dist/node_modules/liquidjs/dist/drop/comparable.d.ts +8 -0
  24. package/dist/node_modules/liquidjs/dist/drop/drop.d.ts +4 -0
  25. package/dist/node_modules/liquidjs/dist/drop/empty-drop.d.ts +11 -0
  26. package/dist/node_modules/liquidjs/dist/drop/forloop-drop.d.ts +15 -0
  27. package/dist/node_modules/liquidjs/dist/drop/index.d.ts +7 -0
  28. package/dist/node_modules/liquidjs/dist/drop/null-drop.d.ts +10 -0
  29. package/dist/node_modules/liquidjs/dist/drop/tablerowloop-drop.d.ts +10 -0
  30. package/dist/node_modules/liquidjs/dist/emitters/emitter.d.ts +11 -0
  31. package/dist/node_modules/liquidjs/dist/emitters/index.d.ts +4 -0
  32. package/dist/node_modules/liquidjs/dist/emitters/keeping-type-emitter.d.ts +5 -0
  33. package/dist/node_modules/liquidjs/dist/emitters/simple-emitter.d.ts +5 -0
  34. package/dist/node_modules/liquidjs/dist/emitters/streamed-emitter.d.ts +9 -0
  35. package/dist/node_modules/liquidjs/dist/filters/array.d.ts +32 -0
  36. package/dist/node_modules/liquidjs/dist/filters/date.d.ts +6 -0
  37. package/dist/node_modules/liquidjs/dist/filters/html.d.ts +6 -0
  38. package/dist/node_modules/liquidjs/dist/filters/index.d.ts +2 -0
  39. package/dist/node_modules/liquidjs/dist/filters/math.d.ts +11 -0
  40. package/dist/node_modules/liquidjs/dist/filters/misc.d.ts +18 -0
  41. package/dist/node_modules/liquidjs/dist/filters/string.d.ts +27 -0
  42. package/dist/node_modules/liquidjs/dist/filters/url.d.ts +14 -0
  43. package/dist/node_modules/liquidjs/dist/fs/fs-impl.d.ts +9 -0
  44. package/dist/node_modules/liquidjs/dist/fs/fs-impl.spec.d.ts +1 -0
  45. package/dist/node_modules/liquidjs/dist/fs/fs.d.ts +20 -0
  46. package/dist/node_modules/liquidjs/dist/fs/index.d.ts +2 -0
  47. package/dist/node_modules/liquidjs/dist/fs/loader.d.ts +24 -0
  48. package/dist/node_modules/liquidjs/dist/fs/loader.spec.d.ts +1 -0
  49. package/dist/node_modules/liquidjs/dist/fs/map-fs.d.ts +13 -0
  50. package/dist/node_modules/liquidjs/dist/fs/map-fs.spec.d.ts +1 -0
  51. package/dist/node_modules/liquidjs/dist/fs/node-require.d.ts +1 -0
  52. package/dist/node_modules/liquidjs/dist/index.d.ts +16 -0
  53. package/dist/node_modules/liquidjs/dist/liquid-options.d.ts +159 -0
  54. package/dist/node_modules/liquidjs/dist/liquid-options.spec.d.ts +1 -0
  55. package/dist/node_modules/liquidjs/dist/liquid.browser.min.js +2 -0
  56. package/dist/node_modules/liquidjs/dist/liquid.browser.umd.js +7265 -0
  57. package/dist/node_modules/liquidjs/dist/liquid.d.ts +70 -0
  58. package/dist/node_modules/liquidjs/dist/liquid.node.js +1 -0
  59. package/dist/node_modules/liquidjs/dist/parser/filter-arg.d.ts +5 -0
  60. package/dist/node_modules/liquidjs/dist/parser/index.d.ts +4 -0
  61. package/dist/node_modules/liquidjs/dist/parser/parse-stream.d.ts +15 -0
  62. package/dist/node_modules/liquidjs/dist/parser/parse-stream.spec.d.ts +1 -0
  63. package/dist/node_modules/liquidjs/dist/parser/parser.d.ts +20 -0
  64. package/dist/node_modules/liquidjs/dist/parser/parser.spec.d.ts +1 -0
  65. package/dist/node_modules/liquidjs/dist/parser/token-kind.d.ts +16 -0
  66. package/dist/node_modules/liquidjs/dist/parser/tokenizer.d.ts +63 -0
  67. package/dist/node_modules/liquidjs/dist/parser/tokenizer.spec.d.ts +1 -0
  68. package/dist/node_modules/liquidjs/dist/parser/whitespace-ctrl.d.ts +3 -0
  69. package/dist/node_modules/liquidjs/dist/render/boolean.d.ts +3 -0
  70. package/dist/node_modules/liquidjs/dist/render/boolean.spec.d.ts +1 -0
  71. package/dist/node_modules/liquidjs/dist/render/expression.d.ts +10 -0
  72. package/dist/node_modules/liquidjs/dist/render/expression.spec.d.ts +1 -0
  73. package/dist/node_modules/liquidjs/dist/render/index.d.ts +4 -0
  74. package/dist/node_modules/liquidjs/dist/render/operator.d.ts +8 -0
  75. package/dist/node_modules/liquidjs/dist/render/render.d.ts +8 -0
  76. package/dist/node_modules/liquidjs/dist/render/render.spec.d.ts +1 -0
  77. package/dist/node_modules/liquidjs/dist/render/string.d.ts +1 -0
  78. package/dist/node_modules/liquidjs/dist/render/string.spec.d.ts +1 -0
  79. package/dist/node_modules/liquidjs/dist/tags/assign.d.ts +12 -0
  80. package/dist/node_modules/liquidjs/dist/tags/block.d.ts +11 -0
  81. package/dist/node_modules/liquidjs/dist/tags/break.d.ts +4 -0
  82. package/dist/node_modules/liquidjs/dist/tags/capture.d.ts +13 -0
  83. package/dist/node_modules/liquidjs/dist/tags/case.d.ts +15 -0
  84. package/dist/node_modules/liquidjs/dist/tags/comment.d.ts +5 -0
  85. package/dist/node_modules/liquidjs/dist/tags/continue.d.ts +4 -0
  86. package/dist/node_modules/liquidjs/dist/tags/cycle.d.ts +9 -0
  87. package/dist/node_modules/liquidjs/dist/tags/decrement.d.ts +9 -0
  88. package/dist/node_modules/liquidjs/dist/tags/echo.d.ts +8 -0
  89. package/dist/node_modules/liquidjs/dist/tags/for.d.ts +15 -0
  90. package/dist/node_modules/liquidjs/dist/tags/if.d.ts +14 -0
  91. package/dist/node_modules/liquidjs/dist/tags/include.d.ts +12 -0
  92. package/dist/node_modules/liquidjs/dist/tags/increment.d.ts +9 -0
  93. package/dist/node_modules/liquidjs/dist/tags/index.d.ts +24 -0
  94. package/dist/node_modules/liquidjs/dist/tags/inline-comment.d.ts +5 -0
  95. package/dist/node_modules/liquidjs/dist/tags/layout.d.ts +14 -0
  96. package/dist/node_modules/liquidjs/dist/tags/liquid.d.ts +8 -0
  97. package/dist/node_modules/liquidjs/dist/tags/raw.d.ts +6 -0
  98. package/dist/node_modules/liquidjs/dist/tags/render.d.ts +22 -0
  99. package/dist/node_modules/liquidjs/dist/tags/tablerow.d.ts +14 -0
  100. package/dist/node_modules/liquidjs/dist/tags/unless.d.ts +15 -0
  101. package/dist/node_modules/liquidjs/dist/template/analysis.d.ts +85 -0
  102. package/dist/node_modules/liquidjs/dist/template/analysis.spec.d.ts +1 -0
  103. package/dist/node_modules/liquidjs/dist/template/filter-impl-options.d.ts +14 -0
  104. package/dist/node_modules/liquidjs/dist/template/filter.d.ts +15 -0
  105. package/dist/node_modules/liquidjs/dist/template/filter.spec.d.ts +1 -0
  106. package/dist/node_modules/liquidjs/dist/template/hash.d.ts +18 -0
  107. package/dist/node_modules/liquidjs/dist/template/hash.spec.d.ts +1 -0
  108. package/dist/node_modules/liquidjs/dist/template/html.d.ts +9 -0
  109. package/dist/node_modules/liquidjs/dist/template/index.d.ts +11 -0
  110. package/dist/node_modules/liquidjs/dist/template/output.d.ts +12 -0
  111. package/dist/node_modules/liquidjs/dist/template/output.spec.d.ts +1 -0
  112. package/dist/node_modules/liquidjs/dist/template/tag-options-adapter.d.ts +10 -0
  113. package/dist/node_modules/liquidjs/dist/template/tag.d.ts +18 -0
  114. package/dist/node_modules/liquidjs/dist/template/template-impl.d.ts +4 -0
  115. package/dist/node_modules/liquidjs/dist/template/template.d.ts +36 -0
  116. package/dist/node_modules/liquidjs/dist/template/value.d.ts +15 -0
  117. package/dist/node_modules/liquidjs/dist/template/value.spec.d.ts +1 -0
  118. package/dist/node_modules/liquidjs/dist/tokens/delimited-token.d.ts +9 -0
  119. package/dist/node_modules/liquidjs/dist/tokens/filter-token.d.ts +7 -0
  120. package/dist/node_modules/liquidjs/dist/tokens/filtered-value-token.d.ts +17 -0
  121. package/dist/node_modules/liquidjs/dist/tokens/hash-token.d.ts +12 -0
  122. package/dist/node_modules/liquidjs/dist/tokens/html-token.d.ts +11 -0
  123. package/dist/node_modules/liquidjs/dist/tokens/identifier-token.d.ts +9 -0
  124. package/dist/node_modules/liquidjs/dist/tokens/index.d.ts +18 -0
  125. package/dist/node_modules/liquidjs/dist/tokens/liquid-tag-token.d.ts +12 -0
  126. package/dist/node_modules/liquidjs/dist/tokens/literal-token.d.ts +11 -0
  127. package/dist/node_modules/liquidjs/dist/tokens/number-token.d.ts +9 -0
  128. package/dist/node_modules/liquidjs/dist/tokens/operator-token.d.ts +38 -0
  129. package/dist/node_modules/liquidjs/dist/tokens/output-token.d.ts +5 -0
  130. package/dist/node_modules/liquidjs/dist/tokens/property-access-token.d.ts +12 -0
  131. package/dist/node_modules/liquidjs/dist/tokens/quoted-token.d.ts +9 -0
  132. package/dist/node_modules/liquidjs/dist/tokens/range-token.d.ts +11 -0
  133. package/dist/node_modules/liquidjs/dist/tokens/tag-token.d.ts +9 -0
  134. package/dist/node_modules/liquidjs/dist/tokens/token.d.ts +12 -0
  135. package/dist/node_modules/liquidjs/dist/tokens/top-level-token.d.ts +4 -0
  136. package/dist/node_modules/liquidjs/dist/tokens/value-token.d.ts +6 -0
  137. package/dist/node_modules/liquidjs/dist/util/assert.d.ts +2 -0
  138. package/dist/node_modules/liquidjs/dist/util/assert.spec.d.ts +1 -0
  139. package/dist/node_modules/liquidjs/dist/util/async.d.ts +2 -0
  140. package/dist/node_modules/liquidjs/dist/util/async.spec.d.ts +1 -0
  141. package/dist/node_modules/liquidjs/dist/util/character.d.ts +10 -0
  142. package/dist/node_modules/liquidjs/dist/util/error.d.ts +35 -0
  143. package/dist/node_modules/liquidjs/dist/util/error.spec.d.ts +1 -0
  144. package/dist/node_modules/liquidjs/dist/util/index.d.ts +12 -0
  145. package/dist/node_modules/liquidjs/dist/util/intl.d.ts +6 -0
  146. package/dist/node_modules/liquidjs/dist/util/limiter.d.ts +8 -0
  147. package/dist/node_modules/liquidjs/dist/util/liquid-date.d.ts +52 -0
  148. package/dist/node_modules/liquidjs/dist/util/liquid-date.spec.d.ts +1 -0
  149. package/dist/node_modules/liquidjs/dist/util/literal.d.ts +11 -0
  150. package/dist/node_modules/liquidjs/dist/util/operator-trie.d.ts +14 -0
  151. package/dist/node_modules/liquidjs/dist/util/performance.d.ts +5 -0
  152. package/dist/node_modules/liquidjs/dist/util/performance.spec.d.ts +1 -0
  153. package/dist/node_modules/liquidjs/dist/util/strftime.d.ts +2 -0
  154. package/dist/node_modules/liquidjs/dist/util/strftime.spec.d.ts +1 -0
  155. package/dist/node_modules/liquidjs/dist/util/type-guards.d.ts +13 -0
  156. package/dist/node_modules/liquidjs/dist/util/type-guards.spec.d.ts +1 -0
  157. package/dist/node_modules/liquidjs/dist/util/underscore.d.ts +40 -0
  158. package/dist/node_modules/liquidjs/dist/util/underscore.spec.d.ts +1 -0
  159. package/dist/node_modules/liquidjs/node_modules/commander/index.js +27 -0
  160. package/dist/node_modules/liquidjs/node_modules/commander/lib/argument.js +147 -0
  161. package/dist/node_modules/liquidjs/node_modules/commander/lib/command.js +2179 -0
  162. package/dist/node_modules/liquidjs/node_modules/commander/lib/error.js +45 -0
  163. package/dist/node_modules/liquidjs/node_modules/commander/lib/help.js +464 -0
  164. package/dist/node_modules/liquidjs/node_modules/commander/lib/option.js +331 -0
  165. package/dist/node_modules/liquidjs/node_modules/commander/lib/suggestSimilar.js +100 -0
  166. package/dist/node_modules/liquidjs/node_modules/commander/package-support.json +16 -0
  167. package/dist/node_modules/liquidjs/node_modules/commander/package.json +80 -0
  168. package/dist/node_modules/liquidjs/node_modules/commander/typings/index.d.ts +889 -0
  169. package/dist/node_modules/liquidjs/package.json +1 -0
  170. package/dist/node_modules/ses/package.json +1 -1
  171. package/dist/node_modules/zod/package.json +1 -1
  172. package/dist/server/variables/runjs-variable-dependencies.js +21 -1
  173. package/package.json +3 -2
@@ -0,0 +1,15 @@
1
+ import { Hash, ValueToken, Liquid, Tag, Emitter, TagToken, TopLevelToken, Context, Template } from '..';
2
+ import { Parser } from '../parser';
3
+ import { Arguments } from '../template';
4
+ export default class extends Tag {
5
+ variable: string;
6
+ collection: ValueToken;
7
+ hash: Hash;
8
+ templates: Template[];
9
+ elseTemplates: Template[];
10
+ constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
11
+ render(ctx: Context, emitter: Emitter): Generator<unknown, void | string, Template[]>;
12
+ children(): Generator<unknown, Template[]>;
13
+ arguments(): Arguments;
14
+ blockScope(): Iterable<string>;
15
+ }
@@ -0,0 +1,14 @@
1
+ import { Liquid, Tag, Value, Emitter, TagToken, TopLevelToken, Context, Template } from '..';
2
+ import { Parser } from '../parser';
3
+ import { Arguments } from '../template';
4
+ export default class extends Tag {
5
+ branches: {
6
+ value: Value;
7
+ templates: Template[];
8
+ }[];
9
+ elseTemplates: Template[] | undefined;
10
+ constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
11
+ render(ctx: Context, emitter: Emitter): Generator<unknown, void, string>;
12
+ children(): Generator<unknown, Template[]>;
13
+ arguments(): Arguments;
14
+ }
@@ -0,0 +1,12 @@
1
+ import { Template, TopLevelToken, Liquid, Tag, Emitter, TagToken, Context } from '..';
2
+ import { Parser } from '../parser';
3
+ import { Arguments, PartialScope } from '../template';
4
+ export default class extends Tag {
5
+ private withVar?;
6
+ private hash;
7
+ constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
8
+ render(ctx: Context, emitter: Emitter): Generator<unknown, void, unknown>;
9
+ children(partials: boolean, sync: boolean): Generator<unknown, Template[]>;
10
+ partialScope(): PartialScope | undefined;
11
+ arguments(): Arguments;
12
+ }
@@ -0,0 +1,9 @@
1
+ import { Tag, Liquid, TopLevelToken, Emitter, TagToken, Context } from '..';
2
+ import { IdentifierToken } from '../tokens';
3
+ export default class extends Tag {
4
+ private identifier;
5
+ private variable;
6
+ constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
7
+ render(context: Context, emitter: Emitter): void;
8
+ localScope(): Iterable<string | IdentifierToken>;
9
+ }
@@ -0,0 +1,24 @@
1
+ import AssignTag from './assign';
2
+ import ForTag from './for';
3
+ import CaptureTag from './capture';
4
+ import CaseTag from './case';
5
+ import CommentTag from './comment';
6
+ import IncludeTag from './include';
7
+ import RenderTag from './render';
8
+ import DecrementTag from './decrement';
9
+ import CycleTag from './cycle';
10
+ import IfTag from './if';
11
+ import IncrementTag from './increment';
12
+ import LayoutTag from './layout';
13
+ import BlockTag from './block';
14
+ import RawTag from './raw';
15
+ import TablerowTag from './tablerow';
16
+ import UnlessTag from './unless';
17
+ import BreakTag from './break';
18
+ import ContinueTag from './continue';
19
+ import EchoTag from './echo';
20
+ import LiquidTag from './liquid';
21
+ import InlineCommentTag from './inline-comment';
22
+ import type { TagClass } from '../template/tag';
23
+ export declare const tags: Record<string, TagClass>;
24
+ export { AssignTag, ForTag, CaptureTag, CaseTag, CommentTag, IncludeTag, RenderTag, DecrementTag, IncrementTag, CycleTag, IfTag, LayoutTag, BlockTag, RawTag, TablerowTag, UnlessTag, BreakTag, ContinueTag, EchoTag, LiquidTag, InlineCommentTag };
@@ -0,0 +1,5 @@
1
+ import { TagToken, Liquid, TopLevelToken, Tag } from '..';
2
+ export default class extends Tag {
3
+ constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
4
+ render(): void;
5
+ }
@@ -0,0 +1,14 @@
1
+ import { Template, Liquid, Tag, Emitter, Hash, TagToken, TopLevelToken, Context } from '..';
2
+ import { ParsedFileName } from './render';
3
+ import { Parser } from '../parser';
4
+ import { Arguments, PartialScope } from '../template';
5
+ export default class extends Tag {
6
+ args: Hash;
7
+ templates: Template[];
8
+ file?: ParsedFileName;
9
+ constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
10
+ render(ctx: Context, emitter: Emitter): Generator<unknown, unknown, unknown>;
11
+ children(partials: boolean): Generator<unknown, Template[]>;
12
+ arguments(): Arguments;
13
+ partialScope(): PartialScope | undefined;
14
+ }
@@ -0,0 +1,8 @@
1
+ import { Template, Emitter, Liquid, TopLevelToken, TagToken, Context, Tag } from '..';
2
+ import { Parser } from '../parser';
3
+ export default class extends Tag {
4
+ templates: Template[];
5
+ constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
6
+ render(ctx: Context, emitter: Emitter): Generator<unknown, void, unknown>;
7
+ children(): Generator<unknown, Template[]>;
8
+ }
@@ -0,0 +1,6 @@
1
+ import { Liquid, TagToken, TopLevelToken, Tag } from '..';
2
+ export default class extends Tag {
3
+ private tokens;
4
+ constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
5
+ render(): string;
6
+ }
@@ -0,0 +1,22 @@
1
+ import { TopLevelToken, Liquid, Token, Template, Tokenizer, Emitter, TagToken, Context, Tag } from '..';
2
+ import { Parser } from '../parser';
3
+ import { Arguments, PartialScope } from '../template';
4
+ export type ParsedFileName = Template[] | Token | string | undefined;
5
+ export default class extends Tag {
6
+ private file;
7
+ private currentFile?;
8
+ private hash;
9
+ constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
10
+ render(ctx: Context, emitter: Emitter): Generator<unknown, void, unknown>;
11
+ children(partials: boolean, sync: boolean): Generator<unknown, Template[]>;
12
+ partialScope(): PartialScope | undefined;
13
+ arguments(): Arguments;
14
+ }
15
+ /**
16
+ * @return null for "none",
17
+ * @return Template[] for quoted with tags and/or filters
18
+ * @return Token for expression (not quoted)
19
+ * @throws TypeError if cannot read next token
20
+ */
21
+ export declare function parseFilePath(tokenizer: Tokenizer, liquid: Liquid, parser: Parser): ParsedFileName;
22
+ export declare function renderFilePath(file: ParsedFileName, ctx: Context, liquid: Liquid): IterableIterator<unknown>;
@@ -0,0 +1,14 @@
1
+ import { ValueToken, Liquid, Tag, Emitter, Hash, TagToken, TopLevelToken, Context, Template } from '..';
2
+ import { Parser } from '../parser';
3
+ import { Arguments } from '../template';
4
+ export default class extends Tag {
5
+ variable: string;
6
+ args: Hash;
7
+ templates: Template[];
8
+ collection: ValueToken;
9
+ constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
10
+ render(ctx: Context, emitter: Emitter): Generator<unknown, void, unknown>;
11
+ children(): Generator<unknown, Template[]>;
12
+ arguments(): Arguments;
13
+ blockScope(): string[];
14
+ }
@@ -0,0 +1,15 @@
1
+ import { Liquid, Tag, Value, TopLevelToken, Template, Emitter, Context, TagToken } from '..';
2
+ import { Parser } from '../parser';
3
+ import { Arguments } from '../template';
4
+ export default class extends Tag {
5
+ branches: {
6
+ value: Value;
7
+ test: (val: any, ctx: Context) => boolean;
8
+ templates: Template[];
9
+ }[];
10
+ elseTemplates: Template[];
11
+ constructor(tagToken: TagToken, remainTokens: TopLevelToken[], liquid: Liquid, parser: Parser);
12
+ render(ctx: Context, emitter: Emitter): Generator<unknown, unknown, unknown>;
13
+ children(): Generator<unknown, Template[]>;
14
+ arguments(): Arguments;
15
+ }
@@ -0,0 +1,85 @@
1
+ import { Template } from '.';
2
+ /**
3
+ * Row, column and file name where a variable was found.
4
+ */
5
+ export interface VariableLocation {
6
+ row: number;
7
+ col: number;
8
+ file?: string;
9
+ }
10
+ /**
11
+ * A variable's segments as an array, possibly with nested arrays of segments.
12
+ */
13
+ export type SegmentArray = Array<string | number | SegmentArray>;
14
+ /**
15
+ * A variable's segments and location, which can be coerced to a string.
16
+ */
17
+ export declare class Variable {
18
+ readonly segments: Array<string | number | Variable>;
19
+ readonly location: VariableLocation;
20
+ constructor(segments: Array<string | number | Variable>, location: VariableLocation);
21
+ toString(): string;
22
+ /** Return this variable's segments as an array, possibly with nested arrays for nested paths. */
23
+ toArray(): SegmentArray;
24
+ }
25
+ /**
26
+ * Property names and array indexes that make up a path to a variable.
27
+ */
28
+ export type VariableSegments = Array<string | number | Variable>;
29
+ /**
30
+ * A mapping of variable names to an array of locations at which the variable was found.
31
+ */
32
+ export type Variables = {
33
+ [key: string]: Variable[];
34
+ };
35
+ /**
36
+ * Group variables by the string representation of their root segment.
37
+ */
38
+ export declare class VariableMap {
39
+ private map;
40
+ constructor();
41
+ get(key: Variable): Variable[];
42
+ has(key: Variable): boolean;
43
+ push(variable: Variable): void;
44
+ asObject(): Variables;
45
+ }
46
+ /**
47
+ * The result of calling `analyze()` or `analyzeSync()`.
48
+ */
49
+ export interface StaticAnalysis {
50
+ /**
51
+ * All variables, whether they are in scope or not. Including references to names
52
+ * such as `forloop` from the `for` tag.
53
+ */
54
+ variables: Variables;
55
+ /**
56
+ * Variables that are not in scope. These could be a "global" variables that are
57
+ * expected to be provided by the application developer, or possible mistakes
58
+ * from the template author.
59
+ *
60
+ * If a variable is referenced before and after assignment, you should expect
61
+ * that variable to be included in `globals`, `variables` and `locals`, each with
62
+ * a different location.
63
+ */
64
+ globals: Variables;
65
+ /**
66
+ * Template variables that are added to the template local scope using tags like
67
+ * `assign`, `capture` or `increment`.
68
+ */
69
+ locals: Variables;
70
+ }
71
+ export interface StaticAnalysisOptions {
72
+ /**
73
+ * When `true` (the default), try to load partial templates and analyze them too.
74
+ */
75
+ partials?: boolean;
76
+ }
77
+ export declare const defaultStaticAnalysisOptions: StaticAnalysisOptions;
78
+ /**
79
+ * Statically analyze a template and report variable usage.
80
+ */
81
+ export declare function analyze(template: Template[], options?: StaticAnalysisOptions): Promise<StaticAnalysis>;
82
+ /**
83
+ * Statically analyze a template and report variable usage.
84
+ */
85
+ export declare function analyzeSync(template: Template[], options?: StaticAnalysisOptions): StaticAnalysis;
@@ -0,0 +1,14 @@
1
+ import type { Context } from '../context';
2
+ import type { Liquid } from '../liquid';
3
+ import type { FilterToken } from '../tokens';
4
+ export interface FilterImpl {
5
+ context: Context;
6
+ token: FilterToken;
7
+ liquid: Liquid;
8
+ }
9
+ export type FilterHandler = (this: FilterImpl, value: any, ...args: any[]) => any;
10
+ export interface FilterOptions {
11
+ handler: FilterHandler;
12
+ raw: boolean;
13
+ }
14
+ export type FilterImplOptions = FilterHandler | FilterOptions;
@@ -0,0 +1,15 @@
1
+ import { Context } from '../context';
2
+ import { FilterImplOptions } from './filter-impl-options';
3
+ import { FilterArg } from '../parser/filter-arg';
4
+ import { Liquid } from '../liquid';
5
+ import { FilterToken } from '../tokens';
6
+ export declare class Filter {
7
+ name: string;
8
+ args: FilterArg[];
9
+ readonly raw: boolean;
10
+ private handler;
11
+ private liquid;
12
+ private token;
13
+ constructor(token: FilterToken, options: FilterImplOptions | undefined, liquid: Liquid);
14
+ render(value: any, context: Context): IterableIterator<unknown>;
15
+ }
@@ -0,0 +1,18 @@
1
+ import { Context } from '../context/context';
2
+ import { Tokenizer } from '../parser/tokenizer';
3
+ import { Token } from '../tokens/token';
4
+ type HashValueTokens = Record<string, Token | undefined>;
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: HashValueTokens;
15
+ constructor(input: string | Tokenizer, jekyllStyle?: boolean | string);
16
+ render(ctx: Context): Generator<unknown, Record<string, any>, unknown>;
17
+ }
18
+ export {};
@@ -0,0 +1,9 @@
1
+ import { TemplateImpl, Template } from '../template';
2
+ import { HTMLToken } from '../tokens';
3
+ import { Context } from '../context';
4
+ import { Emitter } from '../emitters';
5
+ export declare class HTML extends TemplateImpl<HTMLToken> implements Template {
6
+ private str;
7
+ constructor(token: HTMLToken);
8
+ render(ctx: Context, emitter: Emitter): IterableIterator<void>;
9
+ }
@@ -0,0 +1,11 @@
1
+ export * from './template';
2
+ export * from './template-impl';
3
+ export * from './tag';
4
+ export * from './tag-options-adapter';
5
+ export * from './filter';
6
+ export * from './filter-impl-options';
7
+ export * from './hash';
8
+ export * from './value';
9
+ export * from './output';
10
+ export * from './html';
11
+ export * from './analysis';
@@ -0,0 +1,12 @@
1
+ import { Value } from './value';
2
+ import { Arguments, Template, TemplateImpl } from '../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
+ value: Value;
9
+ constructor(token: OutputToken, liquid: Liquid);
10
+ render(ctx: Context, emitter: Emitter): IterableIterator<unknown>;
11
+ arguments(): Arguments;
12
+ }
@@ -0,0 +1,10 @@
1
+ import { Tag, TagClass, TagRenderReturn } from './tag';
2
+ import { TagToken, TopLevelToken } from '../tokens';
3
+ import { Emitter } from '../emitters';
4
+ import { Context } from '../context';
5
+ export interface TagImplOptions {
6
+ [key: string]: any;
7
+ parse?: (this: Tag & TagImplOptions, token: TagToken, remainingTokens: TopLevelToken[]) => void;
8
+ render: (this: Tag & TagImplOptions, ctx: Context, emitter: Emitter, hash: Record<string, any>) => TagRenderReturn;
9
+ }
10
+ export declare function createTagClass(options: TagImplOptions): TagClass;
@@ -0,0 +1,18 @@
1
+ import { TemplateImpl } from './template-impl';
2
+ import type { Emitter } from '../emitters/emitter';
3
+ import type { Parser, Tokenizer } from '../parser';
4
+ import type { Context } from '../context/context';
5
+ import type { TopLevelToken, TagToken } from '../tokens';
6
+ import type { Template } from './template';
7
+ import type { Liquid } from '../liquid';
8
+ export type TagRenderReturn = Generator<unknown, unknown, unknown> | Promise<unknown> | unknown;
9
+ export declare abstract class Tag extends TemplateImpl<TagToken> implements Template {
10
+ name: string;
11
+ liquid: Liquid;
12
+ protected tokenizer: Tokenizer;
13
+ constructor(token: TagToken, remainTokens: TopLevelToken[], liquid: Liquid);
14
+ abstract render(ctx: Context, emitter: Emitter): TagRenderReturn;
15
+ }
16
+ export interface TagClass {
17
+ new (token: TagToken, tokens: TopLevelToken[], liquid: Liquid, parser: Parser): Tag;
18
+ }
@@ -0,0 +1,4 @@
1
+ export declare abstract class TemplateImpl<T> {
2
+ token: T;
3
+ constructor(token: T);
4
+ }
@@ -0,0 +1,36 @@
1
+ import { Context } from '../context/context';
2
+ import { Token } from '../tokens/token';
3
+ import { Emitter } from '../emitters/emitter';
4
+ import { IdentifierToken, QuotedToken, ValueToken } from '../tokens';
5
+ import { Value } from './value';
6
+ export type Argument = Value | ValueToken;
7
+ export type Arguments = Iterable<Argument>;
8
+ /** Scope information used when analyzing partial templates. */
9
+ export interface PartialScope {
10
+ /**
11
+ * The name of the partial template. We need this to make sure we only analyze
12
+ * each template once.
13
+ * */
14
+ name: string;
15
+ /**
16
+ * If `true`, names in `scope` will be added to a new, isolated scope before
17
+ * analyzing any child templates, without access to the parent template's scope.
18
+ */
19
+ isolated: boolean;
20
+ /**
21
+ * A list of names that will be in scope for the child template.
22
+ *
23
+ * If an item is a [string, Argument] tuple, the string is considered an alias
24
+ * for the argument.
25
+ */
26
+ scope: Iterable<string | [string, Argument]>;
27
+ }
28
+ export interface Template {
29
+ token: Token;
30
+ render(ctx: Context, emitter: Emitter): any;
31
+ children?(partials: boolean, sync: boolean): Generator<unknown, Template[]>;
32
+ arguments?(): Arguments;
33
+ blockScope?(): Iterable<string>;
34
+ localScope?(): Iterable<IdentifierToken | QuotedToken>;
35
+ partialScope?(): PartialScope | undefined;
36
+ }
@@ -0,0 +1,15 @@
1
+ import { Filter } from './filter';
2
+ import { Expression } from '../render';
3
+ import type { FilteredValueToken } from '../tokens';
4
+ import type { Liquid } from '../liquid';
5
+ import type { Context } from '../context';
6
+ export declare class Value {
7
+ readonly filters: Filter[];
8
+ readonly initial: Expression;
9
+ /**
10
+ * @param str the value to be valuated, eg.: "foobar" | truncate: 3
11
+ */
12
+ constructor(input: string | FilteredValueToken, liquid: Liquid);
13
+ value(ctx: Context, lenient?: boolean): Generator<unknown, unknown, unknown>;
14
+ private getFilter;
15
+ }
@@ -0,0 +1,9 @@
1
+ import { Token } from './token';
2
+ import { TokenKind } from '../parser';
3
+ export declare abstract class DelimitedToken extends Token {
4
+ trimLeft: boolean;
5
+ trimRight: boolean;
6
+ contentRange: [number, number];
7
+ constructor(kind: TokenKind, [contentBegin, contentEnd]: [number, number], input: string, begin: number, end: number, trimLeft: boolean, trimRight: boolean, file?: string);
8
+ get content(): string;
9
+ }
@@ -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,17 @@
1
+ import { Token } from './token';
2
+ import { FilterToken } from './filter-token';
3
+ import { Expression } from '../render';
4
+ /**
5
+ * value expression with optional filters
6
+ * e.g.
7
+ * {% assign foo="bar" | append: "coo" %}
8
+ */
9
+ export declare class FilteredValueToken extends Token {
10
+ initial: Expression;
11
+ filters: FilterToken[];
12
+ input: string;
13
+ begin: number;
14
+ end: number;
15
+ file?: string | undefined;
16
+ constructor(initial: Expression, filters: FilterToken[], input: string, begin: number, end: number, file?: string | undefined);
17
+ }
@@ -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,9 @@
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
+ }
@@ -0,0 +1,18 @@
1
+ export * from './top-level-token';
2
+ export * from './tag-token';
3
+ export * from './output-token';
4
+ export * from './html-token';
5
+ export * from './number-token';
6
+ export * from './identifier-token';
7
+ export * from './literal-token';
8
+ export * from './operator-token';
9
+ export * from './property-access-token';
10
+ export * from './filter-token';
11
+ export * from './hash-token';
12
+ export * from './quoted-token';
13
+ export * from './token';
14
+ export * from './range-token';
15
+ export * from './value-token';
16
+ export * from './liquid-tag-token';
17
+ export * from './delimited-token';
18
+ export * from './filtered-value-token';
@@ -0,0 +1,12 @@
1
+ import { DelimitedToken } from './delimited-token';
2
+ import { NormalizedFullOptions } from '../liquid-options';
3
+ import { Tokenizer } from '../parser';
4
+ /**
5
+ * LiquidTagToken is different from TagToken by not having delimiters `{%` or `%}`
6
+ */
7
+ export declare class LiquidTagToken extends DelimitedToken {
8
+ name: string;
9
+ tokenizer: Tokenizer;
10
+ constructor(input: string, begin: number, end: number, options: NormalizedFullOptions, file?: string);
11
+ get args(): string;
12
+ }
@@ -0,0 +1,11 @@
1
+ import { Token } from './token';
2
+ import { LiteralValue } from '../util';
3
+ export declare class LiteralToken extends Token {
4
+ input: string;
5
+ begin: number;
6
+ end: number;
7
+ file?: string | undefined;
8
+ content: LiteralValue;
9
+ literal: string;
10
+ constructor(input: string, begin: number, end: number, file?: string | undefined);
11
+ }
@@ -0,0 +1,9 @@
1
+ import { Token } from './token';
2
+ export declare class NumberToken extends Token {
3
+ input: string;
4
+ begin: number;
5
+ end: number;
6
+ file?: string | undefined;
7
+ content: number;
8
+ constructor(input: string, begin: number, end: number, file?: string | undefined);
9
+ }
@@ -0,0 +1,38 @@
1
+ import { Token } from './token';
2
+ export declare const enum OperatorType {
3
+ Binary = 0,
4
+ Unary = 1
5
+ }
6
+ export declare const operatorPrecedences: {
7
+ '==': number;
8
+ '!=': number;
9
+ '>': number;
10
+ '<': number;
11
+ '>=': number;
12
+ '<=': number;
13
+ contains: number;
14
+ not: number;
15
+ and: number;
16
+ or: number;
17
+ };
18
+ export declare const operatorTypes: {
19
+ '==': OperatorType;
20
+ '!=': OperatorType;
21
+ '>': OperatorType;
22
+ '<': OperatorType;
23
+ '>=': OperatorType;
24
+ '<=': OperatorType;
25
+ contains: OperatorType;
26
+ not: OperatorType;
27
+ and: OperatorType;
28
+ or: OperatorType;
29
+ };
30
+ export declare class OperatorToken extends Token {
31
+ input: string;
32
+ begin: number;
33
+ end: number;
34
+ file?: string | undefined;
35
+ operator: string;
36
+ constructor(input: string, begin: number, end: number, file?: string | undefined);
37
+ getPrecedence(): any;
38
+ }
@@ -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
+ }