import { RowData } from "@tanstack/react-table"; import { BaseEvent } from "@trackunit/iris-app-runtime-core-api"; import { DateTimeFormatType, Maybe } from "@trackunit/shared-utils"; import type { DocumentNode } from "graphql"; export { createColumnHelper, type ColumnDef, type VisibilityState } from "@tanstack/react-table"; type ValuePathType = { [key: string]: string; }; export interface BaseExportable { accessor: string | Array; transformer?: { type: "customFields"; id: string; } | { type: "date"; format: DateTimeFormatType; } | { type: "math"; operation: "add" | "subtract" | "multiply" | "divide" | "modulo" | "power"; decimalPlaces?: number; /** * Optional constant value to use as the second operand in the math operation. * Use this when the second value is a client-side constant not available in the GraphQL response. * If not provided, accessor must be an array with 2 elements to access both operands from data. * Example: To calculate price (quantity × unitPrice) where unitPrice is client-side: * { accessor: "quantity", transformer: { type: "math", operation: "multiply", constantValue: 3.50 } } */ constantValue?: number; }; prefix?: string; postfix?: string; translationMap?: Maybe; } export interface BaseExportableArray extends BaseExportable { header: string; id: string; } declare module "@tanstack/react-table" { interface ColumnMeta { alignment?: Alignment; exportable?: boolean; export?: BaseExportable | Array; fragment?: DocumentNode | Array; subHeader?: string; hiddenByDefault?: boolean; isCustomField?: { definitionId: string; }; tootipLabel?: string; /** * Allowing the column to grow, expanding to fill the remaining space. If all columns have shouldGrow set to true, the columns will share the remaining space equally. * If shouldGrow is set to true the column cannot be resized. Other columns with shouldGrow set to false can still be resized. * Resizing columns with shouldGrow set to false will shring the columns with shouldGrow set to true. */ shouldGrow?: boolean; /** * Allows to overwrite the Column Filter label. * Used for dynamic headers like the selection column that uses a checkbox header in the table but should have a different column name in the Column Filter. */ columnFilterLabel?: string; /** * Allows to overwrite the Column Filter label. * Used for dynamic headers like the selection column that uses a checkbox header in the table but should have a different column name in the Column Filter. */ filterName?: string | Array; /** * Specifies whether the column should be pinned (fixed) to the left or right side of the table. * The value "left" pins the column to the left, and "right" pins it to the right. * * Pinned columns remain visible and stationary during horizontal scrolling of the table. */ pinned?: "left" | "right"; /** * Indicates that sorting is applied for example based on 'userId', while the column displays 'userDisplayName'. */ sortByKey?: string; } } export type Alignment = "left" | "center" | "right"; interface TableEvent extends BaseEvent { tableName: string; type: string; } /** * Events — each with a name, and eventType. * Adding a Description is encouraged. * Each entry must be made with createEvent to get typed events * * Pass an event type to createEvent to specify the interface e.g. specify * which properties are required/recommended when using logEvent() on said event */ export declare const TableEvents: { Table: import("@trackunit/iris-app-runtime-core-api").Event; };