import { default as React } from 'react'; import { ServiceResolver } from '../utils/atproto-client'; import { BlobCache, DidCache, RecordCache } from '../utils/cache'; /** * Props for the AT Protocol context provider. */ export interface AtProtoProviderProps { /** Child components that will have access to the AT Protocol context. */ children: React.ReactNode; /** Optional custom PLC directory URL. Defaults to https://plc.directory */ plcDirectory?: string; /** Optional custom identity service URL. Defaults to https://public.api.bsky.app */ identityService?: string; /** Optional custom Slingshot service URL. Defaults to https://slingshot.microcosm.blue */ slingshotBaseUrl?: string; /** Optional custom Bluesky appview service URL. Defaults to https://public.api.bsky.app */ blueskyAppviewService?: string; /** Optional custom Bluesky app base URL for links. Defaults to https://bsky.app */ blueskyAppBaseUrl?: string; /** Optional custom Tangled base URL for links. Defaults to https://tangled.org */ tangledBaseUrl?: string; /** Optional custom Constellation API URL for backlinks. Defaults to https://constellation.microcosm.blue */ constellationBaseUrl?: string; } /** * Internal context value shared across all AT Protocol hooks. */ interface AtProtoContextValue { /** Service resolver for DID resolution and PDS endpoint discovery. */ resolver: ServiceResolver; /** Normalized PLC directory base URL. */ plcDirectory: string; /** Normalized Bluesky appview service URL. */ blueskyAppviewService: string; /** Normalized Bluesky app base URL for links. */ blueskyAppBaseUrl: string; /** Normalized Tangled base URL for links. */ tangledBaseUrl: string; /** Normalized Constellation API base URL for backlinks. */ constellationBaseUrl: string; /** Cache for DID documents and handle mappings. */ didCache: DidCache; /** Cache for fetched blob data. */ blobCache: BlobCache; /** Cache for fetched AT Protocol records. */ recordCache: RecordCache; } /** * Context provider that supplies AT Protocol infrastructure to all child components. * * This provider initializes and shares: * - Service resolver for DID and PDS endpoint resolution * - DID cache for identity resolution * - Blob cache for efficient media handling * * All AT Protocol components (`BlueskyPost`, `LeafletDocument`, etc.) must be wrapped * in this provider to function correctly. * * @example * ```tsx * import { AtProtoProvider, BlueskyPost } from 'atproto-ui'; * * function App() { * return ( * * * * ); * } * ``` * * @example * ```tsx * // Using a custom PLC directory * * * * ``` * * @param children - Child components to render within the provider. * @param plcDirectory - Optional PLC directory override (defaults to https://plc.directory). * @returns Provider component that enables AT Protocol functionality. */ export declare function AtProtoProvider({ children, plcDirectory, identityService, slingshotBaseUrl, blueskyAppviewService, blueskyAppBaseUrl, tangledBaseUrl, constellationBaseUrl, }: AtProtoProviderProps): import("react/jsx-runtime").JSX.Element; /** * Hook that accesses the AT Protocol context provided by `AtProtoProvider`. * * This hook exposes the service resolver, DID cache, blob cache, and record cache * for building custom AT Protocol functionality. * * @throws {Error} When called outside of an `AtProtoProvider`. * @returns {AtProtoContextValue} Object containing resolver, caches, and PLC directory URL. * * @example * ```tsx * import { useAtProto } from 'atproto-ui'; * * function MyCustomComponent() { * const { resolver, didCache, blobCache, recordCache } = useAtProto(); * // Use the resolver and caches for custom AT Protocol operations * } * ``` */ export declare function useAtProto(): AtProtoContextValue; export {};