UNPKG

1.42 kBTypeScriptView Raw
1import { NormalizedFullOptions, RenderOptions } from '../liquid-options';
2import { Scope } from './scope';
3export declare class Context {
4 /**
5 * insert a Context-level empty scope,
6 * for tags like {% capture %} {% assign %} to operate
7 */
8 private scopes;
9 private registers;
10 /**
11 * user passed in scope
12 * {% increment %}, {% decrement %} changes this scope,
13 * whereas {% capture %}, {% assign %} only hide this scope
14 */
15 environments: Scope;
16 /**
17 * global scope used as fallback for missing variables
18 */
19 globals: Scope;
20 sync: boolean;
21 /**
22 * The normalized liquid options object
23 */
24 opts: NormalizedFullOptions;
25 /**
26 * Throw when accessing undefined variable?
27 */
28 strictVariables: boolean;
29 constructor(env?: object, opts?: NormalizedFullOptions, renderOptions?: RenderOptions);
30 getRegister(key: string): any;
31 setRegister(key: string, value: any): any;
32 saveRegister(...keys: string[]): [string, any][];
33 restoreRegister(keyValues: [string, any][]): void;
34 getAll(): Scope;
35 get(paths: string[]): object;
36 getFromScope(scope: object, paths: string[] | string): object;
37 push(ctx: object): number;
38 pop(): Scope | undefined;
39 bottom(): Scope;
40 private findScope;
41}
42export declare function readProperty(obj: Scope, key: string): any;