@mdfriday/foundry
Version:
The core engine of MDFriday. Convert Markdown and shortcodes into fully themed static sites – Hugo-style, powered by TypeScript.
38 lines • 1.24 kB
TypeScript
/**
* Scratch is a writable context used for stateful operations in Page/Node rendering.
* TypeScript equivalent of Go's maps.Scratch
*/
export declare class Scratch {
private values;
constructor();
/**
* Add will, for single values, add (using the + operator) the addend to the existing addend (if found).
* Supports numeric values and strings.
* If the first add for a key is an array or slice, then the next value(s) will be appended.
*/
add(key: string, newAddend: any): string;
/**
* Set stores a value with the given key in the Node context.
* This value can later be retrieved with Get.
*/
set(key: string, value: any): string;
Set(key: string, value: any): string;
/**
* Delete deletes the given key.
*/
delete(key: string): string;
/**
* Get returns a value previously set by Add or Set.
*/
get(key: string): any;
Get(key: string): any;
/**
* Values returns the raw backing map.
*/
getValues(): Map<string, any>;
/**
* SetInMap stores a value to a map with the given key in the Node context.
*/
setInMap(key: string, mapKey: string, value: any): string;
}
//# sourceMappingURL=scratch.d.ts.map