import { Component } from 'react'; import { GridRange, type ModelSizeMap, type MoveOperation } from '@deephaven/grid'; import { type CancelablePromise } from '@deephaven/utils'; import './IrisGridCopyHandler.scss'; import type IrisGridModel from './IrisGridModel'; type Values = T[keyof T]; type ButtonStateType = Values; type CommonCopyOperation = { movedColumns: readonly MoveOperation[]; error?: string; }; export type CopyRangesOperation = CommonCopyOperation & { ranges: readonly GridRange[]; includeHeaders: boolean; formatValues?: boolean; userColumnWidths: ModelSizeMap; }; export type CopyHeaderOperation = CommonCopyOperation & { columnIndex: number; columnDepth: number; }; export type CopyOperation = CopyRangesOperation | CopyHeaderOperation; interface IrisGridCopyHandlerProps { model: IrisGridModel; copyOperation: CopyOperation; onEntering: () => void; onEntered: () => void; onExiting: () => void; onExited: () => void; } interface IrisGridCopyHandlerState { error?: string; copyState: string; buttonState: string; isShown: boolean; rowCount: number; } /** * Component for handling copying of data from the Iris Grid. * - Prompts if necessary (large amount of rows copied) * - Tries to async copy, falls back to showing a "Click to Copy" button if that fails */ declare class IrisGridCopyHandler extends Component { static NO_PROMPT_THRESHOLD: number; static HIDE_TIMEOUT: number; /** * Different states for the current copy operation */ static COPY_STATES: { IDLE: string; CONFIRMATION_REQUIRED: string; FETCH_RANGES_IN_PROGRESS: string; FETCH_HEADER_IN_PROGRESS: string; FETCH_ERROR: string; CLICK_REQUIRED: string; DONE: string; }; static BUTTON_STATES: { COPY: string; FETCH_IN_PROGRESS: string; CLICK_TO_COPY: string; RETRY: string; }; static defaultProps: { copyOperation: null; onEntering: () => void; onEntered: () => void; onExiting: () => void; onExited: () => void; }; static getStatusMessageText(copyState: string, rowCount: number): string; static getCopyButtonText(buttonState: ButtonStateType): string; constructor(props: IrisGridCopyHandlerProps); componentDidMount(): void; componentDidUpdate(prevProps: IrisGridCopyHandlerProps): void; componentWillUnmount(): void; textData?: string; hideTimer?: ReturnType; fetchPromise?: CancelablePromise; startCopy(): void; stopCopy(): void; handleBackgroundClick(): void; handleCancelClick(): void; handleCopyClick(): Promise; handleHideTimeout(): void; copyText(text: string): Promise; showCopyDone(): void; startFetch(): Promise; stopFetch(): void; startHideTimer(): void; stopHideTimer(): void; render(): JSX.Element; } export default IrisGridCopyHandler; //# sourceMappingURL=IrisGridCopyHandler.d.ts.map