import { Layer } from 'effect';
import { Fetch } from 'fx-fetch';
/**
 * Table-scoped `Fetch` Layer. Cells that fetch options through `Fetch.layer`
 * fan out to one request per row; this layer dedupes by request signature so
 * identical GETs collapse to a single in-flight call shared across every cell.
 * Non-GET requests bypass the cache entirely (writes must never dedupe — two
 * rows toggling concurrently must hit the server twice).
 *
 * The signature mirrors `HttpRequestBuilder.describe()`: URL, method, sorted
 * headers. Bodies are intentionally ignored — GETs do not carry them in this
 * codebase, and including them would force a representation choice for the
 * `Promise<Blob>` body that fx-fetch lazy-reads.
 */
type SharedFetchLayer = Layer.Layer<Fetch.Fetch, never, never>;
export declare function makeCachedFetchLayer(): SharedFetchLayer;
/**
 * Mounts a cache instance scoped to the calling component's scope and provides
 * it to descendants. Call once from the table host. The cache is dropped on
 * unmount so a table that remounts starts fresh — no leaked Promises tying
 * the old instance's responses to the new one.
 */
export declare function provideSharedFetchLayer(): SharedFetchLayer;
/**
 * Returns the table-scoped shared Fetch layer, or the default `Fetch.layer`
 * when no host has provided one (e.g. a column rendered standalone in a unit
 * test or outside a table). The fallback keeps the runtime self-contained.
 */
export declare function useSharedFetchLayer(): SharedFetchLayer;
export {};
