/**
 * Public read-only share links for entries.
 *
 * Each row maps an opaque, unguessable token to one entry. The token IS the
 * bearer credential for the public `/share/{token}` surface — there is no
 * signature and no repo/type/id in the public URL, so coords don't leak. The
 * table is the authorization + audit + revocation surface:
 *
 *   mint    → create-or-reuse the active token for an entry (idempotent)
 *   resolve → token → row, or null when missing OR revoked (fail-closed)
 *   revoke  → set revoked_at; the link and its assets stop resolving at once
 *
 * A partial UNIQUE index keeps at most one ACTIVE link per entry, so "Copy
 * public link" is one click and never mints duplicates. Revoked rows stay for
 * audit and don't collide with a freshly minted replacement.
 */
export interface ShareLink {
    token: string;
    repo: string;
    entryType: string;
    entryId: string;
    createdByUserId: number;
    createdAt: string;
    revokedAt: string | null;
    /** The shared entry's `created_at` at mint time, or null for legacy rows.
     *  Used to fail-closed when an entry is deleted and a NEW entry is later
     *  created at the same coords — the old token must not serve the new entry. */
    entityCreatedAt: string | null;
}
export declare class ShareLinkService {
    private db;
    constructor(workspacePath: string);
    /** Keep the token DB (and its WAL sidecars) out of git. Bearer tokens must
     *  never be committed. Mirrors AssetIndexService.ensureGitignore. */
    private ensureGitignore;
    private runMigrations;
    /**
     * Return the active token for an entry, creating one if none exists.
     * Idempotent: repeated calls for the same entry return the same token until
     * it is revoked.
     */
    mint(repo: string, entryType: string, entryId: string, createdByUserId: number, entityCreatedAt?: string | null): ShareLink;
    /** The active link for an entry, or null if it isn't shared. Lets the entry
     *  view show "Unshare" only when a live link exists. */
    getActiveByEntry(repo: string, entryType: string, entryId: string): ShareLink | null;
    /** Revoke an entry's active link (the per-entry "Unshare" action). Returns
     *  true if a live link was revoked, false if the entry wasn't shared. */
    revokeByEntry(repo: string, entryType: string, entryId: string): boolean;
    /** Resolve a token to its entry. Returns null when the token is unknown OR
     *  revoked — callers fail-closed (404) on null so neither case is an oracle. */
    resolve(token: string): ShareLink | null;
    /** Revoke a single link. Returns true if an active link was revoked. */
    revoke(token: string): boolean;
    /** All active links (for the future management UI / audit). */
    listActive(): ShareLink[];
    close(): void;
}
