import { DiscoveredMetadata, OAuthServerMetadata, ProtectedResourceMetadata } from "./types.js"; //#region src/oauth/discovery.d.ts /** Strategy hook used by tests so the unit suite never hits the network. */ type DiscoveryFetcher = (url: string, init: { signal?: AbortSignal; }) => Promise<{ ok: boolean; status: number; json: () => Promise; }>; /** * Override the discovery fetcher. Used by the test suite to inject * synthetic metadata documents. * * @experimental */ declare function _setDiscoveryFetcherForTesting(fetcher: DiscoveryFetcher | null): void; /** * Resolve full discovery metadata for `serverUrl`. The pipeline * tries the protected-resource metadata first (RFC 9728), then falls * back to the authorization-server metadata directly (RFC 8414 + * OpenID Connect Discovery). * * @stable */ declare function discoverMetadata(serverUrl: string, signal?: AbortSignal): Promise; /** * Fetch authorization-server metadata (RFC 8414). Tries * `/.well-known/oauth-authorization-server` first, then * `/.well-known/openid-configuration` as the OpenID-Connect fallback. * * @stable */ declare function fetchAuthorizationServerMetadata(serverUrl: string, signal?: AbortSignal): Promise; /** * Try to resolve protected-resource metadata (RFC 9728). Returns * `undefined` when the resource does not advertise the document. * * @stable */ declare function tryProtectedResourceMetadata(resourceUrl: string, signal?: AbortSignal): Promise; //#endregion export { DiscoveryFetcher, _setDiscoveryFetcherForTesting, discoverMetadata, fetchAuthorizationServerMetadata, tryProtectedResourceMetadata }; //# sourceMappingURL=discovery.d.ts.map