import { type CacheDirective, type InvalidationEvent, type ResourceNotification } from './types.js'; import { StateSyncLayer } from './StateSyncLayer.js'; /** * Nested builder for configuring a single State Sync policy. */ export declare class PolicyBuilder { private _cacheControl?; private _invalidates; /** * Mark matching tools as immutable (safe to cache forever). * Use for reference data: countries, currencies, ICD-10 codes. */ cached(): this; /** * Mark matching tools as volatile (never cache). * Use for dynamic data that changes on every call. */ stale(): this; /** * Declare which glob patterns are invalidated when these tools succeed. */ invalidates(...patterns: string[]): this; /** @internal */ build(): { cacheControl?: CacheDirective; invalidates?: string[]; }; } /** * Fluent builder for centralized State Sync configuration. * * Typically accessed via `f.stateSync()` in the `initFusion` instance. */ export declare class StateSyncBuilder { private _policies; private _defaults; private _onInvalidation?; private _notificationSink?; private _cachedLayer?; /** * Set global default cache-control directives. * * Only cache-control directives are valid for defaults. * Invalidation patterns are NOT allowed here — use `.policy()` instead. */ defaults(fn: (p: Omit) => void): this; /** * Add a scoped policy for matching tools using a fluent nested builder. * * @param match - Tool name or glob pattern (e.g. 'users.*', 'billing.create') * @param fn - Callback to configure the policy * * @example * ```typescript * .policy('billing.*', p => p.noStore().invalidates('billing.*')) * ``` */ policy(match: string, fn: (p: PolicyBuilder) => void): this; /** * Set a hook for observability when invalidations occur. */ onInvalidation(fn: (event: InvalidationEvent) => void): this; /** * Set the notification sink for protocol-level resource updates. */ notificationSink(fn: (notification: ResourceNotification) => void | Promise): this; /** * Build the StateSyncLayer instance. */ build(): StateSyncLayer; /** * Shortcut for build() to align with other builders. * Bug #114 fix: cache the result so `sync.layer === sync.layer` is true. */ get layer(): StateSyncLayer; } //# sourceMappingURL=StateSyncBuilder.d.ts.map