/** * Copyright (c) 2025 Elara AI Pty Ltd * Dual-licensed under AGPL-3.0 and commercial license. See LICENSE for details. */ import { type SortedMap, type ValueTypeOf } from "@elaraai/east"; import { RosterFitResultType, RosterNeedType } from "@elaraai/e3-ui/internal"; import { type Context, type Coverage, type RosterValue, type Slot, type Week } from "./model.js"; /** What a Find fix looks for: a lead, a trainer, or a holder of a skill. */ export type Need = ValueTypeOf; /** The fit's answer: a verdict for every person, by staff key. */ export type FitResult = ValueTypeOf; /** A find: a need on an issue's slot — the question the fit is asked. */ export interface RosterFind { need: Need; slot: Slot; } /** Whether two finds ask the same question. */ export declare const sameFind: (a: RosterFind, b: RosterFind) => boolean; /** The Roster's fit, for its one find. */ export interface RosterFit { /** Whether the app bound a fit: a Find fix is offered only then (R2). */ offered: boolean; /** The find's answer for the drafts as they are, which the People tab shows; none while it is on its way (F2) or failed. */ shown: FitResult | undefined; /** Whether the find is asked and its answer for the drafts as they are has not landed (R4: its fix reads `Finding…`). */ pending: boolean; /** Why the fit's last call failed (R4: a warning banner with Retry). */ error: string | undefined; /** Asks the failed question again. */ retry: () => void; } /** * The Roster's fit (see the module docs). * * @param value - The payload: the fit's name, `none` without one, and the duty kind's row type * @param start - The week's first day * @param week - The drafted week * @param context - The complete staff and configuration * @param coverage - The drafted week's coverage, its costs the pay's * @param find - The find the People tab shows, if any * @returns The fit, for that find */ export declare function useRosterFit(value: RosterValue, start: Date, week: Week, context: Context, coverage: SortedMap, find: RosterFind | undefined): RosterFit; //# sourceMappingURL=fit.d.ts.map