import { AxiosInstance } from 'axios';
import { AxiosResponse } from 'axios';
import { default as default_2 } from 'react';
import { JSX as JSX_2 } from 'react';
import { ReactNode } from 'react';
import { UseMutationResult } from '@tanstack/react-query';
import { UseQueryResult } from '@tanstack/react-query';

export declare function ConfirmDialog({ open, onOpenChange, title, description, confirmText, cancelText, onConfirm, variant, loading, }: {
    open: boolean;
    onOpenChange: (o: boolean) => void;
    title: string;
    description: string;
    confirmText?: string;
    cancelText?: string;
    onConfirm: () => void;
    variant?: 'default' | 'destructive';
    loading?: boolean;
}): default_2.JSX.Element | null;

export declare function EntriesPage({ vaultId, isOwner, onNavigate }: EntriesPageProps): JSX_2.Element;

declare interface EntriesPageProps {
    vaultId: string;
    isOwner?: boolean;
    onNavigate: (to: 'vaults') => void;
}

export declare function EntryFormDialog({ open, onOpenChange, vaultId, editEntry }: {
    open: boolean;
    onOpenChange: (o: boolean) => void;
    vaultId: string;
    editEntry?: VaultEntry;
}): default_2.JSX.Element | null;

export declare type ExpiresIn = '1h' | '8h' | '24h' | '7d' | '30d' | null;

export declare interface Grant {
    id: string;
    scope: 'vault' | 'entry';
    scope_id: string;
    grantee_id: string;
    granted_by_id: string;
    expires_at: string | null;
    revoked_at: string | null;
    created_at: string;
}

export declare function GrantAccessDialog({ open, onOpenChange, scope, scopeId, scopeLabel }: {
    open: boolean;
    onOpenChange: (o: boolean) => void;
    scope: 'vault' | 'entry';
    scopeId: string;
    scopeLabel?: string;
}): default_2.JSX.Element | null;

export declare function useCreateEntry(vaultId: string): UseMutationResult<VaultEntry, any, {
alias?: string;
username?: string;
password?: string;
domain?: string;
notes?: string;
}, unknown>;

export declare function useCreateGrant(): UseMutationResult<Grant, Error, {
scope: "vault" | "entry";
scope_id: string;
grantee_id: string;
expires_in: ExpiresIn;
}, unknown>;

export declare function useCreateVault(): UseMutationResult<Vault, Error, string, unknown>;

export declare function useDeleteEntry(vaultId: string): UseMutationResult<AxiosResponse<any, any, {}>, Error, string, unknown>;

export declare function useDeleteVault(): UseMutationResult<AxiosResponse<any, any, {}>, Error, string, unknown>;

export declare function useEntries(vaultId: string): UseQueryResult<NoInfer<VaultEntry[]>, Error>;

export declare function useGrants(): UseQueryResult<NoInfer<Grant[]>, Error>;

export declare function useRevokeGrant(): UseMutationResult<AxiosResponse<any, any, {}>, Error, string, unknown>;

export declare function useUpdateEntry(vaultId: string): UseMutationResult<VaultEntry, any, {
entryId: string;
data: any;
}, unknown>;

export declare function useUpdateVault(): UseMutationResult<Vault, Error, {
id: string;
name: string;
}, unknown>;

export declare function useVaults(): UseQueryResult<NoInfer<Vault[]>, Error>;

export declare function useVaultStats(): UseQueryResult<NoInfer<{
vault_count: number;
active_grants: number;
entry_count: number;
}>, Error>;

export declare interface Vault {
    id: string;
    name: string;
    owner_id: string;
    created_at: string;
    is_owner: boolean;
}

/**
 * VaultApp — the complete self-contained vault UI.
 * Now uses real URL-based navigation for better UX and breadcrumb support.
 */
export declare function VaultApp({ path: externalPath }?: {
    path?: string;
}): JSX_2.Element;

declare interface VaultContextValue {
    /** Fetch all users for the grant picker — provided by host */
    getUsers: () => Promise<Array<{
        id: string;
        full_name: string;
        email: string;
        role: string;
    }>>;
    /** Mount path prefix used by the host's router */
    basePath: string;
}

export declare function VaultCreateDialog({ open, onOpenChange, editVault }: {
    open: boolean;
    onOpenChange: (o: boolean) => void;
    editVault?: Vault;
}): default_2.JSX.Element | null;

export declare interface VaultEntry {
    id: string;
    vault_id: string;
    domain: string;
    alias: string;
    username: string;
    has_password?: boolean;
    has_notes?: boolean;
    notes: string;
    created_at: string;
    updated_at: string;
}

export declare const vaultKeys: {
    vaults: () => readonly ["vault", "vaults"];
    entries: (vaultId: string) => readonly ["vault", "entries", string];
    grants: () => readonly ["vault", "grants"];
    stats: () => readonly ["vault", "stats"];
    me: () => readonly ["vault", "me"];
    audit: (params: any) => readonly ["vault", "audit", any];
};

export declare const vaultNavItems: readonly [{
    readonly title: "Vaults";
    readonly url: "/vault";
    readonly icon: "FolderLock";
    readonly roles: readonly ["admin", "user"];
    readonly plugin: "vault";
}, {
    readonly title: "Audit";
    readonly url: "/vault/audit";
    readonly icon: "ScrollText";
    readonly roles: readonly ["admin"];
    readonly plugin: "vault";
}];

export declare function VaultPage({ onNavigate }: VaultPageProps): JSX_2.Element;

declare interface VaultPageProps {
    onNavigate: (to: 'entries' | 'audit', vaultId?: string) => void;
}

export declare const vaultPluginMeta: {
    name: string;
    displayName: string;
    description: string;
    version: string;
    icon: string;
    author: string;
    requires: {
        server: string;
        minServerVersion: string;
    };
};

/**
 * VaultProvider must wrap the vault UI.
 * The host passes its own axios instance so vault-client shares
 * auth, base URL, and token refresh — no duplicate auth code.
 */
export declare function VaultProvider({ api, getUsers, basePath, children, }: VaultProviderProps): JSX_2.Element;

export declare interface VaultProviderProps {
    /** Host's configured axios instance (shares auth headers + interceptors) */
    api: AxiosInstance;
    /** Function to fetch all users — delegates to host's existing user service */
    getUsers: VaultContextValue['getUsers'];
    /** Base path the host mounts vault routes at. Default: '/vault' */
    basePath?: string;
    children: ReactNode;
}

export { }
