summaryrefslogtreecommitdiff
path: root/node_modules/liquidjs/dist/context/context.d.ts
blob: c35999343316808ad4a4a4aa0827cee5f9a7dc16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import { Drop } from '../drop/drop';
import { NormalizedFullOptions, RenderOptions } from '../liquid-options';
import { Scope } from './scope';
import { Limiter } from '../util';
type PropertyKey = string | number;
export declare class Context {
    /**
     * insert a Context-level empty scope,
     * for tags like `{% capture %}` `{% assign %}` to operate
     */
    private scopes;
    private registers;
    /**
     * user passed in scope
     * `{% increment %}`, `{% decrement %}` changes this scope,
     * whereas `{% capture %}`, `{% assign %}` only hide this scope
     */
    environments: Scope;
    /**
     * global scope used as fallback for missing variables
     */
    globals: Scope;
    sync: boolean;
    breakCalled: boolean;
    continueCalled: boolean;
    /**
     * The normalized liquid options object
     */
    opts: NormalizedFullOptions;
    /**
     * Throw when accessing undefined variable?
     */
    strictVariables: boolean;
    ownPropertyOnly: boolean;
    memoryLimit: Limiter;
    renderLimit: Limiter;
    constructor(env?: object, opts?: NormalizedFullOptions, renderOptions?: RenderOptions, { memoryLimit, renderLimit }?: {
        [key: string]: Limiter;
    });
    getRegister(key: string): any;
    setRegister(key: string, value: any): any;
    saveRegister(...keys: string[]): [string, any][];
    restoreRegister(keyValues: [string, any][]): void;
    getAll(): Scope;
    /**
     * @deprecated use `_get()` or `getSync()` instead
     */
    get(paths: PropertyKey[]): unknown;
    getSync(paths: PropertyKey[]): unknown;
    _get(paths: (PropertyKey | Drop)[]): IterableIterator<unknown>;
    /**
     * @deprecated use `_get()` instead
     */
    getFromScope(scope: unknown, paths: PropertyKey[] | string): IterableIterator<unknown>;
    _getFromScope(scope: unknown, paths: (PropertyKey | Drop)[] | string, strictVariables?: boolean): IterableIterator<unknown>;
    push(ctx: object): number;
    pop(): Scope | undefined;
    bottom(): Scope;
    spawn(scope?: {}): Context;
    private findScope;
    readProperty(obj: Scope, key: (PropertyKey | Drop)): any;
}
export declare function readJSProperty(obj: Scope, key: PropertyKey, ownPropertyOnly: boolean): any;
export {};