/** * * Copyright © 2025 - 2026 Ping Identity Corporation. All right reserved. * * This software may be modified and distributed under the terms * of the MIT license. See the LICENSE file for details. * **/ import type { GetAuthorizationUrlOptions, GetTokensOptions, OauthTokens, OidcClient, StorageConfig } from '@forgerock/oidc-client/types'; import type { Readable, Writable } from 'svelte/store'; import type { Maybe } from '../interfaces'; import type { OidcClientConfig } from '../oidc/oidc.store'; export interface OAuthStore extends Pick, 'subscribe'> { background: (options?: GetAuthorizationUrlOptions) => void; exchange: (options?: Partial) => void; get: (getOptions?: GetTokensOptions) => Promise; reset: () => void; } export interface OAuthTokenStoreValue { completed: boolean; error: Maybe<{ code?: Maybe; message: Maybe; troubleshoot: Maybe; }>; loading: boolean; successful: boolean; code: Maybe; state: Maybe; response: Maybe | void; } /** * @function initialize - Initializes the OAuth store with a get function and a reset function * @param {Readable} oidcClientStore - The OIDC client store to read the client from * @param {OidcClientConfig} oidcConfig - The OIDC client config; used to build authorizeOptions for token.get * @returns {OAuthStore} - The OAuth store */ export declare function initialize(oidcClientStore: Readable | undefined, oidcConfig?: Omit): OAuthStore;