import { type ReactNode } from "react"; import { type Arranged, type MeasureFigure, type ShapeBaseProps, type ShapeFrameProps, type ShapeGroup, type ShapeTabs, type TextSlot } from "./shape_frame"; /** * THE WORKSHEET — priced lines the reader edits in place, grouped into the parts * of the job, each part footed and the sheet closing on the figure it is read * for. *"What does this come to, and what do we make on it?"* * * IT IS THE WRITE SIDE OF A PRICE — the figures are still being decided, so the * cell IS the editor. * * TWO BASES AND WHAT IS BETWEEN THEM. The MARGIN is arithmetic over the pair, * derived here because a stored third figure is one fact in two places, and a * derived column is never typed. * * THE RUNS ARE THE PARTS OF THE ANSWER, which is why this shape foots each of * them ({@link ShapeFrameProps.subtotals}) rather than assuming it of a * grouping. * * AND THE COST BASE IS NOT THE CUSTOMER'S: one control drops the cost and the * margin TOGETHER, because either alone gives the other away against the sell. */ export interface WorksheetProps extends ShapeBaseProps, Pick, "totals"> { /** The `identity` role — what the line is FOR. */ identity: TextSlot; /** The supporting line under it — the code, the basis the line is priced on. */ caption?: (row: T) => string; /** The `category` role — the phase or the leg each line falls under, and the * run its own footer closes. Absent, the sheet is one flat list closing on * one foot. */ group?: ShapeGroup; /** The `measure` role — HOW MANY the line is for. Not summed at either foot: * two lines counted in different units have no sum. */ quantity?: WorksheetFigure; /** WHAT THE LINE COSTS — the base the margin is taken against, and the one the * customer's view drops. */ cost?: WorksheetFigure; /** WHAT IT SELLS FOR — the figure the sheet is read for, so it is the column * that rides the line's own name where the width cannot seat it. */ sell?: WorksheetFigure; /** WHICH SHEET IS ON SCREEN — the whole of it, or what the customer is shown. * Held by the app where the pick should survive a reload. A reading of the * sheet rather than a narrowing: no row leaves, two columns do. */ preview?: Arranged; /** The versions, or the jobs — none where only one sheet is ever open. */ tabs?: ShapeTabs; } /** ONE FIGURE A LINE CARRIES, and the control that STATES it where the screen * offers one. A line the caller answers with nothing keeps its reading, so a * sheet can be priced on the lines a person may still touch. */ export type WorksheetFigure = MeasureFigure & { edit?: (row: T) => ReactNode; }; export declare function Worksheet(props: WorksheetProps): import("react").JSX.Element;