import { Kernel, Logger } from "oly-core"; import { IPixieSetOptions } from "../interfaces"; /** * Use Pixie for handling ServerClient data use cases. * * For cache http call: PixieHttp. * For cache session: PixieSession. * * Pixie writes server-data into HTML then browser use this data. */ export declare class Pixie { static stateName: string; protected logger: Logger; protected kernel: Kernel; /** * Volatile data */ protected data: {}; /** * Getter * * @param key * @returns {T} */ get(key: string): T; /** * Set value in pixie; * By default, store data only once and only on server env. * * @param key Key * @param value Value * @param options only+once * @returns {T} */ set(key: string, value: T, options?: IPixieSetOptions): T; /** * Like set, but for functions. * * Function will be executed only in Server. * ```ts * // SERVER * pixie.fly(() => "DATA"); // called + cached * // BROWSER * pixie.fly(() => "DATA"); // use cache, remove cache * pixie.fly(() => "DATA"); // called * ``` * * Async function with Promise is allowed. * * @param key Identifier * @param func Function to call which returns a value * @returns The value */ fly(key: string, func: () => Promise | T): Promise; /** * Stringify store. * * @returns {string} */ toString(): string; /** * Wrap data into