import { type Fs, type Ps } from "webappwiz/system"; import type { SecretStore } from "./secret-store.js"; /** What `SystemSecretStore.forProject` reads through; the real ones by default. */ export interface ForProjectOptions { fs?: Fs; ps?: Ps; } /** * The operating system's own store, through `Bun.secrets`: the Keychain on * macOS, Credential Manager on Windows, and on Linux whatever secret service * daemon is running, such as GNOME Keyring or KWallet. A project's values are * kept under the service `webappwiz:`, so each project's are its * own, and the device's under `webappwiz`, for keys that belong to the person * rather than to one project. Encrypted at rest by the system. A headless * server often has no secret service, which is why a deployed app reads the * environment instead. The system cannot list a service's entries, so each * keeps one more, `.names`, listing the rest. */ export declare class SystemSecretStore implements SecretStore { /** The service its values are kept under. */ readonly service: string; readonly label: string; private constructor(); /** The store of the project named `project`, kept as `webappwiz:`. */ static project(project: string): SystemSecretStore; /** * The store of the project around `dir` (the working directory by * default). Its name is `credentials.project` from the user's * `~/.config/wiz/config.ts`, else from the project's `.wiz/config.ts`, * else the directory of the repository's main worktree, so a value added * from one git worktree is there in every other. */ static forProject(dir?: string, opts?: ForProjectOptions): Promise; /** The device's store, kept as `webappwiz`, shared by every project. */ static device(): SystemSecretStore; get(name: string): Promise; set(name: string, value: string): Promise; delete(name: string): Promise; names(): Promise; /** Keeps `names` as the service's list, sorted, or none when empty. */ private list; } /** * What the project around `dir` is called on this device, which its * credentials and anything else kept outside it go under: the last * `credentials.project` among its config and the user's, else the directory * of the repository's main worktree, so every worktree shares it. */ export declare function projectName(dir: string | undefined, opts?: ForProjectOptions): Promise;