import type { ProductKind, User, TokenResponse, RefreshTokenResponse } from "./types"; import * as client from "openid-client"; export declare function checkSignature(userId: number, authKeyId: string, deviceToken: string, signatureBase64: string, publicKey: string): boolean; export declare function getUser(cookie: string): User; export declare function getAuthorization(cookie: string): string | null; export declare function getDeviceToken(cookie: string): string | null; /** * This function performs OpenID Connect discovery and sets up a custom fetch handler * to sanitize and normalize redirect URIs used in token requests. * * @param {string} server - The issuer URL for OpenID Connect discovery. * @param {string} clientId - The client ID registered with the authorization server. * @param {client.ClientMetadata} clientMetadata - Additional metadata about the client. * @param {string} clientSecret - The secret associated with the client ID. * * @returns {Promise} A promise resolving to the discovered OpenID configuration with a custom fetch handler. */ export declare const receiveConfig: (server: string, clientId: string, clientMetadata: client.ClientMetadata, clientSecret: string) => Promise; export declare function getAppVersionFromUA(userAgent: string, productKind: ProductKind): string | null; export declare const grantAuthorizationCode: (config: client.Configuration, currentURL: string, codeVerifier: string, state: string, nonce: string) => Promise; export declare const buildAuthorization: (config: client.Configuration, redirectURI: string, prompt?: "consent" | "none") => Promise<{ code_verifier: string; code_challenge: string; nonce: string; state: string; redirectHref: string; }>; export declare const fetchUser: (config: client.Configuration, token?: string, sub?: string) => Promise; export declare const refreshAccessToken: (config: client.Configuration, refreshToken: string, additionalParameters?: Record) => Promise; export declare const refreshAccessTokenDebug: (config: client.Configuration, refreshToken: string, additionalParameters?: Record) => Promise;