import { DalpCookieStore } from "./cookie-store.js"; export interface DalpAuthClientConfig { /** Base URL of the DALP API (e.g., `"https://dalp.example.com"`). */ url: string; /** API key used for Better Auth API-key-authenticated operations. */ apiKey?: string; /** Better Auth session token sent as an Authorization bearer token. */ sessionToken?: string; /** Cookie header value for explicit Node/browser-session handoff. */ cookie?: string; /** Cookie store for Node-side session persistence across Better Auth calls. */ cookieStore?: DalpCookieStore; /** * Organization ID for multi-tenant setups. * Sent as `x-organization-id` when provided. */ organizationId?: string; /** * Additional headers merged into every Better Auth request. * Can override defaults like `User-Agent` but cannot override configured security headers. */ headers?: Record; /** * Custom `fetch` implementation. * Use this to inject logging, proxy configuration, or test doubles. */ fetch?: typeof globalThis.fetch; } export interface DalpAuthError { code?: string; message?: string; status?: number; statusText?: string; [key: string]: unknown; } export interface DalpAuthResult { data: TData | null; error: TError | null; } export type DalpAuthOperation, TData = unknown> = (input?: TInput, options?: unknown) => Promise>; export interface DalpAuthClient { signIn: Record & { email: DalpAuthOperation; }; signUp: Record & { email: DalpAuthOperation; }; getSession: DalpAuthOperation; listSessions: DalpAuthOperation; revokeSession: DalpAuthOperation; revokeOtherSessions: DalpAuthOperation; apiKey: Record & { create: DalpAuthOperation; list: DalpAuthOperation; delete: DalpAuthOperation; }; organization: Record & { create: DalpAuthOperation; list: DalpAuthOperation; setActive: DalpAuthOperation; inviteMember: DalpAuthOperation; acceptInvitation: DalpAuthOperation; listMembers: DalpAuthOperation; addMember: DalpAuthOperation; removeMember: DalpAuthOperation; }; admin: Record & { listUsers: DalpAuthOperation; createUser: DalpAuthOperation; removeUser: DalpAuthOperation; setRole: DalpAuthOperation; }; device: Record & { code: DalpAuthOperation; token: DalpAuthOperation; approve: DalpAuthOperation; deny: DalpAuthOperation; }; passkey: Record; twoFactor: Record & { enable: DalpAuthOperation; disable: DalpAuthOperation; verifyTotp: DalpAuthOperation; verifyBackupCode: DalpAuthOperation; generateBackupCodes: DalpAuthOperation; }; wallet: { pincode: { enable: DalpAuthOperation; disable: DalpAuthOperation; update: DalpAuthOperation; reset: DalpAuthOperation; }; twoFactor: { enable: DalpAuthOperation; disable: DalpAuthOperation; verify: DalpAuthOperation; }; secretCodes: { generate: DalpAuthOperation; confirm: DalpAuthOperation; }; passkey: { register: DalpAuthOperation; complete: DalpAuthOperation; disable: DalpAuthOperation; challenge: DalpAuthOperation; verify: DalpAuthOperation; }; }; $fetch: (path: string, options?: Record) => Promise; $ERROR_CODES: Record; } export declare function createDalpAuthClient(config: DalpAuthClientConfig): DalpAuthClient; //# sourceMappingURL=auth.d.ts.map