import { HandlerUrlOptions, ResolvedHandlerUrls, stackAppInternalsSymbol } from "../../common.js"; import { Result } from "@stackframe/stack-shared/dist/utils/results"; import { InternalSession } from "@stackframe/stack-shared/dist/sessions"; import { Store } from "@stackframe/stack-shared/dist/utils/stores"; import { AsyncCache } from "@stackframe/stack-shared/dist/utils/caches"; //#region src/lib/stack-app/apps/implementations/common.d.ts declare const clientVersion = "STACK_COMPILE_TIME_CLIENT_PACKAGE_VERSION_SENTINEL"; declare const createCache: (fetcher: (dependencies: D) => Promise) => AsyncCache>; declare const createCacheBySession: (fetcher: (session: InternalSession, extraDependencies: D) => Promise) => AsyncCache<[InternalSession, ...D], Result>; type AppLike = { [stackAppInternalsSymbol]: { getConstructorOptions: () => any; }; }; declare function resolveConstructorOptions(options: T): T & { inheritsFrom?: undefined; }; declare function getUrls(partial: HandlerUrlOptions, options: { projectId: string; }): ResolvedHandlerUrls; declare function getDefaultProjectId(): string; declare function getDefaultPublishableClientKey(): string | undefined; declare function getDefaultSecretServerKey(): string; declare function getDefaultSuperSecretAdminKey(): string; declare function getDefaultExtraRequestHeaders(): any; /** * Returns the base URL for the Stack API. * * The URL can be specified in several ways, in order of precedence: * 1. Directly through userSpecifiedBaseUrl parameter as string or browser/server object * 2. Through environment variables: * - Browser: NEXT_PUBLIC_BROWSER_STACK_API_URL * - Server: NEXT_PUBLIC_SERVER_STACK_API_URL * - Fallback: NEXT_PUBLIC_STACK_API_URL or NEXT_PUBLIC_STACK_URL * 3. Default base URL if none of the above are specified * * The function also ensures the URL doesn't end with a trailing slash * by removing it if present. * * @param userSpecifiedBaseUrl - Optional URL override as string or {browser, server} object * @returns The configured base URL without trailing slash */ declare function getBaseUrl(userSpecifiedBaseUrl: string | { browser: string; server: string; } | undefined): string; declare const defaultBaseUrl = "https://api.stack-auth.com"; declare const defaultAnalyticsBaseUrl = "https://r.stack-auth.com"; declare function getAnalyticsBaseUrl(regularBaseUrl: string): string; declare function resolveApiUrls(userExplicitBaseUrl: string | { browser: string; server: string; } | undefined): () => string[]; type TokenObject = { accessToken: string | null; refreshToken: string | null; }; declare function createEmptyTokenStore(): Store; declare function useAsyncCache(cache: AsyncCache>, dependencies: D, caller: string): T; //#endregion export { TokenObject, clientVersion, createCache, createCacheBySession, createEmptyTokenStore, defaultAnalyticsBaseUrl, defaultBaseUrl, getAnalyticsBaseUrl, getBaseUrl, getDefaultExtraRequestHeaders, getDefaultProjectId, getDefaultPublishableClientKey, getDefaultSecretServerKey, getDefaultSuperSecretAdminKey, getUrls, resolveApiUrls, resolveConstructorOptions, useAsyncCache }; //# sourceMappingURL=common.d.ts.map