export interface AuthorizationParams { /** * The default scope to be used on authentication requests. * * This defaults to `profile email` if not set. If you are setting extra scopes and require * `profile` and `email` to be included then you must include them in the provided scope. */ scope?: string; /** * Allowed host domains, registered in the oauth client config. */ authorities?: string; } /** * @ignore */ export interface AuthorizeOptions extends AuthorizationParams { state: string; scope: string; response_type: string; redirection_url: string; authorities: string; code_challenge: string; code_challenge_method: string; } export interface ClientOptions { /** * The Application Client ID */ clientId: string; /** * HTC account domain such as `'https://account.htcvive.com/'` */ domain: string; /** * Specify the timeout for HTTP calls using `fetch`. The default is 10000 milliseconds. */ httpTimeoutInMS?: number; /** * The domain the cookie is accessible from. If not set, the cookie is scoped to * the current domain, including the subdomain. * * Note: setting this incorrectly may cause silent authentication to stop working * on page load. * * * To keep a user logged in across multiple subdomains set this to your * top-level domain and prefixed with a `.` (eg: `.example.com`). */ cookieDomain?: string; /** * URL parameters that will be sent back to the Authorization Server. This can be known parameters * defined by HTC Account. */ authorizationParams?: AuthorizationParams; } export interface RedirectLoginOptions { /** * A customize value. If this request parameter is set in the request, * then it is returned to the application as part of the redirection_url. */ state?: string; /** * When login success, will redirect to this URL. */ redirectionUrl?: string; /** * Used to control the redirect and not rely on the SDK to do the actual redirect. */ openUrl?: (url: string) => Promise | void; /** * Distinguish between logging in directly with the SDK or using the viverse-web popup mode. */ ux?: string; } export interface PopupLoginOptions { htcAccessTokenName?: string; viverseDomain?: string; timeoutInSeconds?: number; popup?: any; authorities?: string; } export interface iframeLoginOptions { state?: string; } export interface checkAuthOptions { allowedOrigin?: string; /** * The number of milliseconds to wait for a response before timing out. * Defaults to 60000 (60 seconds). */ timeout?: number; } export type SGTokenResponse = { client_id: string; access_token: string; account_id: string; expires_in: number; scope: string; token_type?: string; refresh_token?: string; }; export interface PopupConfigOptions { /** * The number of seconds to wait for a popup response before * throwing a timeout error. Defaults to 60s */ timeoutInSeconds?: number; /** * Accepts an already-created popup window to use. If not specified, the SDK * will create its own. This may be useful for platforms like iOS that have * security restrictions around when popups can be invoked (e.g. from a user click event) */ popup?: any; origin: string; source: Window; } export interface AccessTokenResponse { access_token: string; account_id: string; expires_in: number; } export interface GetTokenOptions { /** * If true, the full response from the /api/oauth/v1/vendor/token/authorization-code endpoint * (or the cache, if the cache was used) is returned. Otherwise, just the access token is returned. * * The default is `false`. */ detailedResponse?: boolean; } export interface LogoutUrlOptions { redirectionUrl: string; } export interface LogoutOptions extends LogoutUrlOptions { /** * Used to control the redirect and not rely on the SDK to do the actual redirect. * * Set to `false` to disable the redirect, or provide a function to handle the actual redirect yourself. * * @example * await client.logout({ * openUrl(url) { * window.location.replace(url); * } * }); * * @example * import { Browser } from '@capacitor/browser'; * * await client.logout({ * async openUrl(url) { * await Browser.open({ url }); * } * }); */ openUrl?: false | ((url: string) => Promise | void); } export interface RedirectLoginResult { /** * State stored when the redirect request was made */ appState?: TAppState; } /** * @ignore */ export interface AuthenticationResult { state: string; code?: string; } export interface PopupAuthenticationResult { access_token: string; account_id: string; expires_in: number; state?: string; } /** * @ignore */ export interface TokenEndpointOptions { baseUrl: string; client_id: string; grant_type: string; code_verifier: string; code: string; timeout?: number; [key: string]: any; } export type TokenEndpointResponse = { access_token: string; account_id: string; expires_in: number; scope?: string; token_type?: string; refresh_token?: string; created_at?: number; state?: string; }; /** * @ignore */ export interface RefreshTokenEndpointOptions { baseUrl: string; grant_type: string; timeout?: number; [key: string]: any; } export type RefreshTokenEndpointResponse = { client_id: string; access_token: string; account_id: string; expires_in: number; scope: string; token_type: string; refresh_token: string; }; export interface IdToken { __raw: string; name?: string; given_name?: string; family_name?: string; middle_name?: string; nickname?: string; preferred_username?: string; profile?: string; picture?: string; website?: string; email?: string; email_verified?: boolean; gender?: string; birthdate?: string; zoneinfo?: string; locale?: string; phone_number?: string; phone_number_verified?: boolean; address?: string; updated_at?: string; iss?: string; aud?: string; exp?: number; nbf?: number; iat?: number; jti?: string; azp?: string; nonce?: string; auth_time?: string; at_hash?: string; c_hash?: string; acr?: string; amr?: string[]; sub_jwk?: string; cnf?: string; sid?: string; org_id?: string; org_name?: string; [key: string]: any; } export interface AccessToken { __raw: string; exp?: number; iat?: number; jti?: string; token?: string; [key: string]: any; } export declare class User { name?: string; given_name?: string; family_name?: string; middle_name?: string; nickname?: string; preferred_username?: string; profile?: string; picture?: string; website?: string; email?: string; email_verified?: boolean; gender?: string; birthdate?: string; zoneinfo?: string; locale?: string; phone_number?: string; phone_number_verified?: boolean; address?: string; updated_at?: string; sub?: string; [key: string]: any; } export type FetchOptions = { method?: string; headers?: Record; credentials?: 'include' | 'omit'; body?: string; signal?: AbortSignal; }; export type GetTokenVerboseResponse = Omit; export declare const DEFAULT_SCOPE = "email"; export interface AvatarClientOptions { baseURL: string; token?: string; } export type Avatar = { id: string | number; isPrivate: boolean; vrmUrl: string; headIconUrl: string; snapshot: string; createTime: number; updateTime: number; }; export type AuthHeader = { AccessToken?: string; AuthKey?: string; }; export declare enum TokenType { AccessToken = "access_token", AuthKey = "auth_key" } export type TokenSet = { accessToken: string; authKey: string; }; export interface GameDashboardClientOptions { baseURL: string; communityBaseURL: string; targetUserIriURL?: string; token: string; } export interface LeaderboardConfig { name: string; range_start: number; range_end: number; region: string; time_range: string; around_user?: boolean; } export interface GuestLeaderboardConfig { name: string; range_start: number; range_end: number; region: string; time_range: string; country_code: string; } export interface Scores { name: string; value: string; } export interface Achievements { api_name: string; unlock: boolean; } export interface CommunityConfig { targetUserIriList: string[]; } export interface PlayClientOptions { sdkURL?: string; } export interface StorageClientOptions { sdkURL?: string; }