import { type TransportClient, READY_STATE } from "@tensamin/ttp-core"; import { createSchema } from "./schema"; import type { z, ZodObject } from "zod"; /** * @param redirectUrl The URL should point to the TAuth HTTP Server at http://hostname:port/callback */ export declare class TAuthClient { frontendUrl: string; identifier: string; privateKey: string; publicKey: string; saveSession: (userId: number, sessionId: number) => Promise | void; redirectUrl: URL; schema: ReturnType; httpServer: { port: number; hostname: string; }; clientMap: Map; response: z.ZodObject<{ challenge: z.ZodBase64; public_key: z.ZodBase64; }, z.core.$strip>; }; challenge_response: { request: z.ZodObject<{ challenge: z.ZodBase64; }, z.core.$strip>; response: z.ZodObject<{}, z.core.$strip>; }; load_app_data: { request: z.ZodObject<{}, z.core.$strip>; response: z.ZodObject<{ app_data: z.ZodString; }, z.core.$strip>; }; save_app_data: { request: z.ZodObject<{ app_data: z.ZodString; }, z.core.$strip>; response: z.ZodObject<{}, z.core.$strip>; }; }>>; private appData; constructor({ frontendUrl, identifier, privateKey, publicKey, saveSession, redirectUrl, appData, httpServer, htmlSuccessPage, }: { frontendUrl: string; identifier: string; privateKey: string; publicKey: string; saveSession: (userId: number, sessionId: number) => Promise | void; redirectUrl: string; appData: ZodObject; httpServer?: { port: number; hostname: string; }; htmlSuccessPage?: string; }); generateChallenge(userId: number): Promise; solveChallenge(userId: number, challenge: string): Promise; createTTP(userId: number, sessionId: number, omikronUrl: string): void; loadData(userId: number, sessionId: number): Promise>; saveData(userId: number, sessionId: number, data: any): Promise; private createTemporaryTTPConnection; generateLink(challenge?: string): string; } export declare function getFriendlyReadyState(stateIndex: number): keyof typeof READY_STATE; export declare function generateKeyPair(): { private: string; public: string; }; export * from "./crypto"; export * from "./schema"; export * from "./user";