import type { IStateDB } from '@jupyterlab/statedb'; /** * Kinds of omnibox results whose uses are recorded. */ export type RecentKind = 'command' | 'file'; /** * A single recorded use: a command that was run or a file that was opened. */ interface IRecentEntry { kind: RecentKind; /** * The command id, or the workspace-relative file path. */ id: string; } /** * A most-recently-used list of omnibox results, generic over the result kind * so commands and files (and future kinds) share one store. Entries are kept * most-recent-first, capped at `maxItems` per kind, and persisted through the * state database so they survive reloads. Without a state database the list * still works for the lifetime of the page. */ export declare class OmniboxRecents { constructor(options?: OmniboxRecents.IOptions); /** * Maximum number of entries remembered per kind. Lowering it trims the list * immediately; `0` disables recents entirely. */ get maxItems(): number; set maxItems(value: number); /** * The recorded entries, most recent first — all of them, or only those of * one kind. */ entries(kind?: RecentKind): IRecentEntry[]; /** * Record a use of `id`, moving it to the front of its kind's list. */ touch(kind: RecentKind, id: string): void; /** * Load the persisted list. Entries recorded before the load completes stay * at the front, ahead of the restored history. */ restore(): Promise; /** * Keep at most `maxItems` entries of each kind, preserving order. */ private _trim; private _save; private _state; private _entries; private _maxItems; } export declare namespace OmniboxRecents { /** * Construction options for {@link OmniboxRecents}. */ interface IOptions { /** * The state database to persist through, if available. */ state?: IStateDB | null; } } export {};