export interface IFronteggRecord { __frontegg__loader?: boolean; __frontegg__error?: boolean; } export interface PaginationResult { totalPages: number; items: T[]; } export interface FronteggPaginationLinks { next: string; prev: string; first: string; last: string; } export interface FronteggPaginationResult { _metadata: { totalPages: number; totalItems: number; }; items: T[]; } export interface FronteggPaginationWrapper extends FronteggPaginationResult { _links?: FronteggPaginationLinks; } export interface KeyValuePair { key: string; value: string; } export interface ResolvedTenantResult { tenant?: string | null; } export type LogLevel = 'warn' | 'error'; export declare const fronteggHeaders: { frameWork: string; fronteggSdkVersion: string; contentType: string; source: string; scopedTenant: string; }; export declare enum RequestSource { AdminPortal = "admin-portal", LoginBox = "login-box" } export declare enum FronteggFrameworks { Nextjs = "nextjs", React = "react", Angular = "angular", Vuejs = "vuejs", Flutter = "flutter", Ios = "ios", Android = "android", Vanillajs = "vanillajs" } export interface MetadataHeaders { framework?: FronteggFrameworks; fronteggSdkVersion?: string; } export interface SessionContext { enableSessionPerTenant?: boolean; skipUserLoading?: boolean; } export interface ContextOptions { baseUrl: string | ((url: string) => string); clientId?: string; /** * Will be used to identify the application, use only for multi applications */ appId?: string; tokenResolver?: () => Promise | string; /** * custom login header value * @returns `{ tenant: string | null }` */ tenantResolver?: () => Promise | ResolvedTenantResult; /** * * @param opts all modifiable request options (RequestOptions) * @param url url to be called, non-modifiable * @returns RequestOptions */ beforeRequestInterceptor?: (opts: Omit, url: string) => RequestOptions; additionalQueryParamsResolver?: () => Promise | KeyValuePair[]; additionalHeadersResolver?: () => Promise | KeyValuePair[]; currentUserRoles?: string[]; requestCredentials?: RequestCredentials; urlPrefix?: string; logLevel?: LogLevel; auditsOptions?: { virtualScroll?: boolean; }; metadataHeaders?: MetadataHeaders; } export interface QuerySort { id: string; desc?: boolean; } export interface QueryFilter { id: string; value: any; } export interface RedirectOptions { refresh?: boolean; replace?: boolean; preserveQueryParams?: boolean; } export interface UserJwtOptions { jwt?: string; } export declare enum PaginationOrderEnum { ASC = "ASC", DESC = "DESC" } export interface RequestOptions { url: string; method: 'GET' | 'POST' | 'PATCH' | 'PUT' | 'DELETE'; body?: any; params?: any; contentType?: string; responseType?: 'json' | 'plain' | 'blob' | 'stream'; headers?: Record; credentials?: RequestCredentials; }