/** * WHAT THIS APP SAW LAST TIME, to open on at once and correct afterwards * (Antonio, 5-11). * * In the platform, the page around the app keeps it (the app's frame has no * storage of its own) and hands it over with the token, before the bundle runs: * `window.__THATOPEN_CONTEXT__.cache`. Writing sends it back to the page for the * next time. Outside the platform (a standalone page, a sandbox, a test) it is * kept in memory, so the same code works there and simply starts empty. * * Keys: `documents`, `files` and `projectData` are the project's listings, filled * by this client whenever a fresh answer arrives (`{ projectId, value, at }`). * An app's own keys start with `app:` and are kept apart per app by the page. */ export interface CachedAnswer { projectId: string; value: T; /** When the answer arrived, in ms since the epoch. */ at: number; } export declare class AppCache { #private; /** What was kept under `key`, or undefined. */ get(key: string): T | undefined; /** Kept for the next time this app opens in this project (structured-cloneable values, bytes too). */ set(key: string, value: unknown): void; delete(key: string): void; /** One of the project's listings as it was last answered, if it is this project's. */ answer(key: 'documents' | 'files' | 'projectData', projectId: string): CachedAnswer | undefined; /** @internal The client keeping a fresh listing. */ keepAnswer(key: 'documents' | 'files' | 'projectData', projectId: string, value: unknown): void; }