Interface TwingCache

interface TwingCache {
    getTimestamp: ((key: string) => Promise<number>);
    load: ((key: string) => Promise<null | TwingTemplateNode>);
    write: ((key: string, content: TwingTemplateNode) => Promise<void>);
}

Properties

getTimestamp: ((key: string) => Promise<number>)

Returns the modification timestamp of a key.

Type declaration

    • (key): Promise<number>
    • Parameters

      • key: string

        The cache key

      Returns Promise<number>

      The modification timestamp

load: ((key: string) => Promise<null | TwingTemplateNode>)

Loads a template AST from the cache.

Type declaration

write: ((key: string, content: TwingTemplateNode) => Promise<void>)

Writes a template AST to the cache.

Type declaration

    • (key, content): Promise<void>
    • Parameters

      Returns Promise<void>