import { AutoGroupResult, ClassSchema, ColumnInfo, ColumnRole, SampleClass } from '../types/auto-group'; import { SampleGroup } from '../types'; import { FieldRecipeGroup, QcRoute, SmartGroupField } from './SmartGroupFieldRecipe.groups'; import { ManualSample } from './SmartGroupManual.cohorts'; import { FieldRecipeAnatomyToken, FieldRecipeQcChip, SmartGroupSeed } from './SmartGroup.types'; import { ExperimentHeader } from '../composables/autoGroup'; /** Value preview of a field card: the first three values, then the count of the rest. */ export declare function previewValues(values: string[]): string; /** Experiment line of the modal header: `exp157 · 2025-10-13 · LT`. */ export declare function experimentLabel(header: ExperimentHeader): string; /** * Names of all columns of the experimental classes. A field cannot take one * of them: the engine merges fields by name. */ export declare function engineColumnNames(schemas: Record): string[]; /** One chip for each QC-type class, with its sample count. */ export declare function engineQcChips(classes: SampleClass[]): FieldRecipeQcChip[]; /** * The tokens of one study sample with the role the engine gave each of them, * so the user sees how the names were read. The sample is the first member of * the largest experimental class. `cards` supplies the on/off state and the * layer of the tokens that are grouping fields. */ export declare function engineAnatomy(classes: SampleClass[], schemas: Record, tokenized: string[][], cards: { fields: SmartGroupField[]; layers: (number | null)[]; }): FieldRecipeAnatomyToken[]; /** Human label for a column role; defaults to `Factor` when unset. */ export declare function roleLabel(role?: ColumnRole): string; /** * Columns worth offering as grouping toggles: factors, numerics, replicates and * sample IDs (the last two are off by default), plus any column already enabled * in `groupBy` (so a manual group-by choice still shows). * Preserves the engine's column order. `groupBy` is the schema's ORDERED layer * list — entry N is hierarchy layer N of the composed group names. */ export declare function candidateColumns(columns: ColumnInfo[], groupBy: readonly number[]): ColumnInfo[]; /** * Map engine columns to Field Recipe cards + their on/off state (same order). * `layers` aligns with the cards: the column's 1-based position in the * `groupBy` layer order, or `null` when the column is not grouped by. */ export declare function engineFieldsToCards(columns: ColumnInfo[], groupBy: readonly number[]): { fields: SmartGroupField[]; enabled: boolean[]; layers: (number | null)[]; }; /** * Build the batch-wide field recipe from every class schema. The active schema * stays first for a stable card order; fields and enabled hierarchy layers that * only exist in another token-length/class split are appended instead of being * hidden from the controlled UI. */ export declare function engineSchemasToCards(schemas: Record, activeClassKey: string): { fields: SmartGroupField[]; enabled: boolean[]; layers: (number | null)[]; }; /** Map engine sample groups to the live preview rail shape. */ export declare function engineGroupsToRail(groups: SampleGroup[]): FieldRecipeGroup[]; /** Map the Field Recipe QC label to the engine's class disposition routing. */ export declare function qcRouteToEngine(route: QcRoute): 'overlay' | 'exclude' | 'mix'; /** Map the engine's QC routing back to the Field Recipe label. */ export declare function engineToQcRoute(routing: 'overlay' | 'exclude' | 'mix'): QcRoute; /** * Seed the manual cohort builder from existing groups. The hierarchical group * name (`group/sub/sub2`) splits into the three cohort levels; colour carries * over. One seed entry per sample. Names with more than three `/`-segments keep * the remainder in `sub2` (rejoined with `/`) so the round-trip is lossless — * `manualSamplesToResult` re-joins on `/`. */ export declare function seedFromGroups(groups: SampleGroup[]): Record; /** * Convert the manual cohort assignments back into an `AutoGroupResult`. * `baseGroups` (the modal's incoming `groups` prop) are preserved in their * original order and colour — including any that end up empty — so re-opening * the modal and moving samples between cohorts is non-destructive. Newly created * cohorts are appended in first-seen order. */ export declare function manualSamplesToResult(samples: ManualSample[], baseGroups?: SampleGroup[]): AutoGroupResult;