From 7a52ddeba2a68388b544f529d2d92104420f77b0 Mon Sep 17 00:00:00 2001 From: Shipwreckt Date: Fri, 31 Oct 2025 20:02:14 +0000 Subject: Changed from static to 11ty! --- node_modules/liquidjs/dist/template/analysis.d.ts | 85 +++++++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 node_modules/liquidjs/dist/template/analysis.d.ts (limited to 'node_modules/liquidjs/dist/template/analysis.d.ts') diff --git a/node_modules/liquidjs/dist/template/analysis.d.ts b/node_modules/liquidjs/dist/template/analysis.d.ts new file mode 100644 index 0000000..4a0d647 --- /dev/null +++ b/node_modules/liquidjs/dist/template/analysis.d.ts @@ -0,0 +1,85 @@ +import { Template } from '.'; +/** + * Row, column and file name where a variable was found. + */ +export interface VariableLocation { + row: number; + col: number; + file?: string; +} +/** + * A variable's segments as an array, possibly with nested arrays of segments. + */ +export type SegmentArray = Array; +/** + * A variable's segments and location, which can be coerced to a string. + */ +export declare class Variable { + readonly segments: Array; + readonly location: VariableLocation; + constructor(segments: Array, location: VariableLocation); + toString(): string; + /** Return this variable's segments as an array, possibly with nested arrays for nested paths. */ + toArray(): SegmentArray; +} +/** + * Property names and array indexes that make up a path to a variable. + */ +export type VariableSegments = Array; +/** + * A mapping of variable names to an array of locations at which the variable was found. + */ +export type Variables = { + [key: string]: Variable[]; +}; +/** + * Group variables by the string representation of their root segment. + */ +export declare class VariableMap { + private map; + constructor(); + get(key: Variable): Variable[]; + has(key: Variable): boolean; + push(variable: Variable): void; + asObject(): Variables; +} +/** + * The result of calling `analyze()` or `analyzeSync()`. + */ +export interface StaticAnalysis { + /** + * All variables, whether they are in scope or not. Including references to names + * such as `forloop` from the `for` tag. + */ + variables: Variables; + /** + * Variables that are not in scope. These could be a "global" variables that are + * expected to be provided by the application developer, or possible mistakes + * from the template author. + * + * If a variable is referenced before and after assignment, you should expect + * that variable to be included in `globals`, `variables` and `locals`, each with + * a different location. + */ + globals: Variables; + /** + * Template variables that are added to the template local scope using tags like + * `assign`, `capture` or `increment`. + */ + locals: Variables; +} +export interface StaticAnalysisOptions { + /** + * When `true` (the default), try to load partial templates and analyze them too. + */ + partials?: boolean; +} +export declare const defaultStaticAnalysisOptions: StaticAnalysisOptions; +/** + * Statically analyze a template and report variable usage. + */ +export declare function analyze(template: Template[], options?: StaticAnalysisOptions): Promise; +/** + * Statically analyze a template and report variable usage. + */ +export declare function analyzeSync(template: Template[], options?: StaticAnalysisOptions): StaticAnalysis; -- cgit v1.2.3