/**
 * Admin RPC adapter helpers for consumer UIs.
 *
 * Bridges a typed throwing RPC client to the four narrow admin RPC
 * interfaces the state classes consume — `AdminAccountsRpc`,
 * `AdminInvitesRpc`, `AuditLogRpc`, `AppSettingsRpc`. Two calls at the
 * admin shell layout wire everything.
 *
 * Intentionally admin-only despite the backend-side
 * `create_standard_rpc_actions` rename (admin + role-grant-offer + account).
 * Account-surface methods flow through `account_sessions_rpc_context`
 * (wired at the self-service layout), and role-grant-offer methods that
 * surface in the admin UI (`role_grant_offer_create`, `role_grant_revoke`,
 * `role_grant_offer_retract`) live inside the `AdminAccountsRpc` interface —
 * they belong to the admin UX, not a separate wire pairing. The UI side
 * and backend factory names diverge by design.
 *
 * ```ts
 * // `api` is the typed throwing Proxy from `create_frontend_rpc_client`.
 * provide_admin_rpc_contexts(create_admin_rpc_adapters(api));
 * ```
 *
 * The throwing Proxy spreads the JSON-RPC `{code, message, data?}` onto
 * the thrown `Error` so form components (e.g. `ui/RoleGrantOfferForm.svelte`)
 * can match on `error.data?.reason` via `ERROR_ROLE_GRANT_OFFER_*` constants —
 * optional chaining is required because JSON-RPC `data` is spec-level
 * optional. Consumers that need a custom unwrap strategy can construct
 * their own object satisfying `AdminRpcApi` and pass it directly.
 *
 * No `.svelte.ts` suffix — this module holds no reactive state, only
 * method-name mappings.
 *
 * @module
 */
import type { AdminAccountListInput, AdminAccountListOutput, AccountDeleteInput, AccountDeleteOutput, AccountUndeleteInput, AccountUndeleteOutput, AdminSessionListOutput, AdminSessionRevokeAllInput, AdminSessionRevokeAllOutput, AdminTokenRevokeAllInput, AdminTokenRevokeAllOutput, AuditLogListInput, AuditLogListOutput, AuditLogRoleGrantHistoryInput, AuditLogRoleGrantHistoryOutput, InviteCreateInput, InviteCreateOutput, InviteDeleteInput, InviteDeleteOutput, InviteListOutput, AppSettingsGetOutput, AppSettingsUpdateInput, AppSettingsUpdateOutput } from '../auth/admin_action_specs.js';
import type { RoleGrantOfferCreateInput, RoleGrantOfferCreateOutput, RoleGrantOfferRetractInput, RoleGrantOfferOkOutput, RoleGrantRevokeInput, RoleGrantRevokeOutput } from '../auth/role_grant_offer_action_specs.js';
import { type AdminAccountsRpc } from './admin_accounts_state.svelte.js';
import { type AdminInvitesRpc } from './admin_invites_state.svelte.js';
import { type AuditLogRpc } from './audit_log_state.svelte.js';
import { type AppSettingsRpc } from './app_settings_state.svelte.js';
import { type FormatScope } from './format_scope.js';
/**
 * The wire-method surface this module needs from the typed throwing RPC
 * client. Every method returns the unwrapped value or throws an `Error`
 * carrying the JSON-RPC `{code, message, data?}` shape — i.e. the
 * `ThrowingApi<...>` view of the corresponding action specs.
 *
 * Consumers pass the typed throwing Proxy returned by
 * `create_frontend_rpc_client` directly. Structural typing means any
 * superset (e.g. the consumer's full `ThrowingApi<ActionsApi>`) is
 * assignable as long as these methods are present at these signatures.
 */
export interface AdminRpcApi {
    admin_account_list: (input?: AdminAccountListInput) => Promise<AdminAccountListOutput>;
    account_delete: (input: AccountDeleteInput) => Promise<AccountDeleteOutput>;
    account_undelete: (input: AccountUndeleteInput) => Promise<AccountUndeleteOutput>;
    admin_session_list: () => Promise<AdminSessionListOutput>;
    admin_session_revoke_all: (input: AdminSessionRevokeAllInput) => Promise<AdminSessionRevokeAllOutput>;
    admin_token_revoke_all: (input: AdminTokenRevokeAllInput) => Promise<AdminTokenRevokeAllOutput>;
    audit_log_list: (input: AuditLogListInput) => Promise<AuditLogListOutput>;
    audit_log_role_grant_history: (input: AuditLogRoleGrantHistoryInput) => Promise<AuditLogRoleGrantHistoryOutput>;
    invite_list: () => Promise<InviteListOutput>;
    invite_create: (input: InviteCreateInput) => Promise<InviteCreateOutput>;
    invite_delete: (input: InviteDeleteInput) => Promise<InviteDeleteOutput>;
    app_settings_get: () => Promise<AppSettingsGetOutput>;
    app_settings_update: (input: AppSettingsUpdateInput) => Promise<AppSettingsUpdateOutput>;
    role_grant_offer_create: (input: RoleGrantOfferCreateInput) => Promise<RoleGrantOfferCreateOutput>;
    role_grant_offer_retract: (input: RoleGrantOfferRetractInput) => Promise<RoleGrantOfferOkOutput>;
    role_grant_revoke: (input: RoleGrantRevokeInput) => Promise<RoleGrantRevokeOutput>;
}
/** The four admin RPC adapters assembled from a shared `api`. */
export interface AdminRpcAdapters {
    admin_accounts: AdminAccountsRpc;
    admin_invites: AdminInvitesRpc;
    audit_log: AuditLogRpc;
    app_settings: AppSettingsRpc;
}
/**
 * Build the four admin RPC adapters from a typed throwing RPC client.
 *
 * Method-name mapping:
 *
 * | Narrow RPC method                   | Action spec method           |
 * | ----------------------------------- | ---------------------------- |
 * | `admin_accounts.list_accounts`      | `admin_account_list`         |
 * | `admin_accounts.delete_account`     | `account_delete` (soft)      |
 * | `admin_accounts.undelete_account`   | `account_undelete`           |
 * | `admin_accounts.list_sessions`      | `admin_session_list`         |
 * | `admin_accounts.create_role_grant`       | `role_grant_offer_create`        |
 * | `admin_accounts.revoke_role_grant`      | `role_grant_revoke`              |
 * | `admin_accounts.retract_offer`      | `role_grant_offer_retract`       |
 * | `admin_accounts.session_revoke_all` | `admin_session_revoke_all`   |
 * | `admin_accounts.token_revoke_all`   | `admin_token_revoke_all`     |
 * | `admin_invites.list`                | `invite_list`                |
 * | `admin_invites.create`              | `invite_create`              |
 * | `admin_invites.delete`              | `invite_delete`              |
 * | `audit_log.list`                    | `audit_log_list`             |
 * | `audit_log.role_grant_history`          | `audit_log_role_grant_history`   |
 * | `app_settings.get`                  | `app_settings_get`           |
 * | `app_settings.update`               | `app_settings_update`        |
 *
 * All four adapter factories call through the same `api` — consumers
 * pass the typed throwing Proxy from `create_frontend_rpc_client` once,
 * regardless of how many admin surfaces they mount.
 */
export declare const create_admin_rpc_adapters: (api: AdminRpcApi) => AdminRpcAdapters;
/** Optional knobs alongside the adapters when wiring admin contexts. */
export interface ProvideAdminRpcContextsOptions {
    /**
     * Render `{scope_id, role}` as a human label across role-grant-display
     * components. Omit (or return `null`) to fall back to the raw uuid.
     */
    format_scope?: FormatScope;
}
/**
 * Wire all four admin RPC contexts in a single call.
 *
 * Call once at the admin shell layout (e.g. `src/routes/admin/+layout.svelte`)
 * with adapters built from `create_admin_rpc_adapters`. Every `Admin*.svelte`
 * component that reads a context below this point sees the adapters.
 *
 * Each context accessor reads `adapters.{domain}` on every invocation, so
 * mutating an adapter field on the same object propagates. Replacing the
 * whole adapter set requires calling `provide_admin_rpc_contexts` again
 * during init — in practice this is one-shot at layout mount.
 *
 * Pass `options.format_scope` to render role_grant/offer `scope_id` values as
 * human labels across `AdminAccounts`, `AdminRoleGrantHistory`,
 * `RoleGrantOfferInbox`, `RoleGrantOfferForm`, and `RoleGrantOfferHistory`.
 * Components that accept a `format_scope` prop honor the prop first; the
 * context is the fallback.
 */
export declare const provide_admin_rpc_contexts: (adapters: AdminRpcAdapters, options?: ProvideAdminRpcContextsOptions) => void;
//# sourceMappingURL=admin_rpc_adapters.d.ts.map