import { AuthorizationResult, GrantClientConfig, PermissionQueryOptions, Scope, SignInWithProjectAppOptions } from './types'; /** * Grant Client for browser applications * * Makes HTTP requests to the Grant API to check permissions * and retrieve authorization data. Supports both token-based * and cookie-based authentication with automatic token refresh. */ export declare class GrantClient { private config; private cache; private defaultTtl; constructor(config: GrantClientConfig); /** * Check if the current user has a specific permission * * @example * ```ts * const canEdit = await grant.can('document', 'update'); * if (canEdit) { * // Show edit button * } * ``` */ can(resource: string, action: string, options?: PermissionQueryOptions): Promise; /** * Alias for `can` - check if user has permission */ hasPermission(resource: string, action: string, options?: PermissionQueryOptions): Promise; /** * Start project-app OAuth flow (redirect only). * Navigates the current window to the Grant OAuth entry page; after sign-in and consent, * the user is redirected to the app's `redirect_uri` with token in the URL fragment. * * Requires `config.frontendUrl` and `redirectUri`. */ signInWithProjectApp(options: SignInWithProjectAppOptions): Promise; /** * Check authorization with full result details * * @example * ```ts * const result = await grant.isAuthorized('document', 'update'); * if (!result.authorized) { * console.log('Denied:', result.reason); * } * ``` */ isAuthorized(resource: string, action: string, options?: PermissionQueryOptions): Promise; /** * Clear all cached data */ clearCache(): void; /** * Clear cached data for a specific scope */ clearScopeCache(scope?: Scope): void; /** * Make an authenticated fetch request with automatic token refresh on 401 * and MFA step-up on 403 MFA_REQUIRED. */ private fetchWithAuth; /** * Perform the actual fetch request */ private doFetch; /** * Get the current access token */ private getToken; private buildUrl; private getCacheKey; private getFromCache; private setCache; } //# sourceMappingURL=grant-client.d.ts.map