/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ /** * The sources of a builder's rail its tabs follow (#1340, #1345): a tab over * a source's rows — the Sheet's templates lists and its author's tabs, the * Calendar's templates — shows what that source shows. Each source's * visibility is read through the shared source visibility * (`useSourceVisibility`), so a choice on the rail narrows every place the * source's rows appear; a source the rail does not narrow reads no page and * hides nothing. One component reads one source — the shared chain, * `each-source.tsx` — so a payload naming another set of sources keeps each * one's hooks in order. * * @packageDocumentation */ import { type ReactNode } from "react"; import { StringType, type ArrayType, type ValueTypeOf } from "@elaraai/east"; import type { RowSourceType } from "@elaraai/east-ui"; import type { RecordSlicesChromeType } from "@elaraai/east-ui/internal"; import { type KeyVisibilityWords } from "./visibility.js"; import { type SourceShown } from "./source-tab.js"; /** The rail's chrome, as a builder's payload carries it. */ type Chrome = ValueTypeOf; /** A source's narrowed keys, paged through its part, as a builder's payload carries them. */ type NarrowedKeys = ValueTypeOf>>; /** What one source a builder's tabs follow shows, and how its narrowing stands. */ export interface FollowedSource { /** What the source shows of a tab: its keys, whether it is busy or ready, and its own Clear filters. */ shown: SourceShown; /** Why its narrowing could not be read; `undefined` while it reads, or has read. */ error: string | undefined; /** Reads its narrowing again. */ retry: () => void; /** Its name, as its banner says it: its label, else the noun the builder counts it in, else its name. */ name: string; } /** The sources a builder's tabs follow, by the source's name. */ export type FollowedSources = ReadonlyMap; /** Props of {@link FollowSources}. */ export interface FollowSourcesProps { /** The rail; `undefined` with no slice. */ chrome: Chrome | undefined; /** Each source's narrowed keys, paged through its part, by the source's name, as the payload carries them. */ narrowed: ReadonlyMap; /** The sources the builder's tabs follow, each once. */ sources: readonly string[]; /** What the builder counts each source in, by its name: a source's name where it has no label of its own. */ nouns: ReadonlyMap; /** What a source's failed narrowing says, by the source's name: its results moved while read, or could not be read. */ said: (name: string) => KeyVisibilityWords; /** What renders once every source is read. */ children: (followed: FollowedSources) => ReactNode; } /** * Reads each source a builder's tabs follow, and renders `children` with * what each shows — see the module docs. * * @param props - The rail, the narrowed keys, the sources, their nouns and what a failed narrowing says * @returns What `children` renders */ export declare function FollowSources({ chrome, narrowed, sources, nouns, said, children }: FollowSourcesProps): ReactNode; export {}; //# sourceMappingURL=follow-sources.d.ts.map