import { Ref, ComputedRef } from 'vue'; import { Rack, SlotPosition, WellEditData, WellPlateFormat, WellSampleDropData, Well } from '../types'; export interface UseRackEditorOptions { defaultFormat?: WellPlateFormat; defaultInjectionVolume?: number; maxRacks?: number; minRacks?: number; } export interface UseRackEditorReturn { racks: Ref; activeRack: ComputedRef; activeRackId: Ref; addRack(name?: string): Rack; removeRack(rackId: string): void; reorderRacks(fromIndex: number, toIndex: number): void; updateRack(rackId: string, data: Partial): void; setActiveRack(rackId: string): void; setWellData(rackId: string, wellId: string, data: Partial): void; clearWell(rackId: string, wellId: string): void; clearAllWells(rackId: string): void; fillSeries(rackId: string, prefix?: string): void; /** Swaps two wells (a move when the target is empty). */ moveWell(rackId: string, sourceWellId: string, targetWellId: string): void; /** Puts every well in group `groupId` (an empty well becomes a sample); `undefined` empties them. */ assignWells(rackId: string, wellIds: string[], groupId: string | undefined): void; /** * Applies every PlateEditor intent to this state, so the component can hold * data it never mutates itself: * `` */ plateEditorListeners: PlateEditorListeners; /** Steps back through every change to `racks` (at most 50), restoring the plate that was showing. */ undo(): void; redo(): void; canUndo: ComputedRef; canRedo: ComputedRef; /** Forgets every undo and redo step, e.g. after loading unrelated plates. */ clearHistory(): void; getAllWells(): Array<{ rackId: string; wellId: string; well: Partial; }>; totalSampleCount: ComputedRef; reset(): void; } /** Handlers for PlateEditor's intent events, keyed by event name (bind with `v-on`). */ export interface PlateEditorListeners { 'update:activeRackId': (rackId: string) => void; 'rack-add': () => void; 'rack-remove': (rackId: string) => void; 'rack-reorder': (rackIds: string[]) => void; 'update:format': (rackId: string, format: WellPlateFormat) => void; 'update:slot': (rackId: string, slot: SlotPosition) => void; 'well-edit': (rackId: string, wellId: string, data: WellEditData) => void; 'well-clear': (rackId: string, wellId: string) => void; 'well-move': (rackId: string, sourceWellId: string, targetWellId: string) => void; 'sample-drop': (rackId: string, wellId: string, data: WellSampleDropData, event: DragEvent) => void; 'assign': (rackId: string, wellIds: string[], groupId: string | undefined) => void; 'clear': (rackId: string) => void; 'fill-series': (rackId: string) => void; 'undo': () => void; 'redo': () => void; } /** Manages a set of sample racks with well-level assignment, series fill, and multi-rack reordering. */ export declare function useRackEditor(initialRacks?: Rack[], options?: UseRackEditorOptions): UseRackEditorReturn;