/**
 * Saved-view **scope** — the structured location a saved view points at.
 *
 * Saved-Views architecture, Phase 2. A view's scope decouples the durable
 * lens (visualization + filters + sort) from *where* it looks. Three kinds
 * ship in P2 (a fourth, boards, is reserved):
 *   - `recent` — the cross-folder Recent aggregate (all accessible folders).
 *   - `type:<entityType>` — a single-type aggregate across folders.
 *   - `folder:<id>` — a specific folder, keyed by its **stable sidecar id**
 *     (D2) so the view survives folder rename / move. The path is never the
 *     stored key.
 *
 * This module is the single `parseScope()` validator with an explicit error
 * policy (§4a): an unrecognized / malformed scope string parses to
 * `{ kind: 'invalid' }` rather than throwing, so a corrupt row can never blank
 * the sidebar or a route — the caller renders a "this view's location is gone"
 * state instead.
 *
 * Pure + framework-free (no fs, no db, no web runtime) so it is shared by the
 * server route (which resolves `folder:<id>` → repo/path against the
 * filesystem) and the web client (which consumes the already-resolved scope),
 * and runs in the `web-unit` vitest project via the `@core/view-scope` alias.
 */
/** The stored-scope string for the Recent aggregate. */
export declare const VIEW_SCOPE_RECENT = "recent";
/**
 * A scope string after parsing. `folder` carries only the opaque sidecar id —
 * resolving it to a concrete `{ repo, folderPath }` is the server's job
 * (`ResolvedScope`), since it needs filesystem + access-control context.
 */
export type ParsedScope = {
    kind: 'recent';
} | {
    kind: 'type';
    entityType: string;
} | {
    kind: 'folder';
    folderId: string;
} | {
    kind: 'invalid';
    raw: string;
};
/**
 * Parse a stored scope string. Never throws. `null` / `''` / `'recent'` /
 * `'all'` all map to Recent (the universal default); anything unrecognized or
 * empty-after-prefix maps to `{ kind: 'invalid' }`.
 */
export declare function parseScope(raw: string | null | undefined): ParsedScope;
/** Build the stored scope string for a type-scoped view. */
export declare function buildTypeScope(entityType: string): string;
/** Build the stored scope string for a folder-scoped view from its stable id. */
export declare function buildFolderScope(folderId: string): string;
/**
 * The scope a save request carries from the client. Folder scopes are
 * expressed as concrete `{ repo, folderPath }` coordinates; the server mints /
 * reads the folder's stable sidecar id and stores `folder:<id>` (D2). `recent`
 * and `type` are stored verbatim.
 */
export type SaveScope = {
    kind: 'recent';
} | {
    kind: 'type';
    entityType: string;
} | {
    kind: 'folder';
    repo: string;
    folderPath: string;
};
/**
 * A scope resolved for the client. `folder:<id>` is resolved to its concrete
 * `{ repo, folderPath }` (or `gone` when the id no longer maps to any folder
 * the caller can see — §4a). Recent / type pass through. The client uses this
 * to build the route URL, the scratch storage key, and the sidebar row.
 */
export type ResolvedScope = {
    kind: 'recent';
} | {
    kind: 'type';
    entityType: string;
} | {
    kind: 'folder';
    repo: string;
    folderPath: string;
} | {
    kind: 'gone';
};
/** Validate that a SaveScope is well-formed before persisting. */
export declare function isValidSaveScope(s: unknown): s is SaveScope;
