import React, { type ChangeEvent, type KeyboardEvent, PureComponent } from 'react'; import { type CancelablePromise, ValidationError } from '@deephaven/utils'; import { type FileStorageItem, type FileType } from './FileStorage'; import type FileStorage from './FileStorage'; import './NewItemModal.scss'; export type NewItemModalProps = typeof NewItemModal.defaultProps & { isOpen: boolean; title: string; defaultValue: string; type: FileType; onSubmit: (name: string, isOverwrite?: boolean) => void; onCancel: () => void; placeholder: string; storage: FileStorage; notifyOnExtensionChange?: boolean; }; export type NewItemModalState = { path: string; isSubmitting: boolean; showExtensionChangeModal: boolean; showOverwriteModal: boolean; validationError?: ValidationError; value: string; prevExtension?: string; newExtension?: string; }; declare class NewItemModal extends PureComponent { static defaultProps: { isOpen: boolean; defaultValue: string; notifyOnExtensionChange: boolean; placeholder: string; onSubmit: (name: string, isOverwrite?: boolean) => void; onCancel: () => void; }; static getValidationMessage(err: Error): string; static handleError(err: Error): void; constructor(props: NewItemModalProps); componentDidUpdate(prevProps: NewItemModalProps, prevState: NewItemModalState): void; componentWillUnmount(): void; private inputRef; private cancelableValidatePromise?; private cancelableExistingItemPromise?; private pending; private pathMap; private isInitialLoad; resetValue(): void; getValidationPromise(path: string, name: string, checkExisting?: boolean): CancelablePromise; validateName(path: string, name: string, checkExisting: boolean): Promise; updateValidationStatus(path: string, newName: string): void; handleModalOpened(): void; handleModalSubmit(): void; handleChange(event: ChangeEvent): void; handleSelect(item: FileStorageItem): void; handleKeyDown(e: KeyboardEvent): void; handleValidationError(err: Error): void; handleOverwriteCancel(): void; handleOverwriteConfirm(): void; handleExtensionChangeCancel(): void; handleExtensionChangeConfirm(): void; /** * Focus rename input and select name part for files, select all text for folders */ focusRenameInput(): void; submitModal(skipExtensionCheck?: boolean): void; handleBreadcrumbSelect(directoryPath: string): void; renderPathButtons(path: string): React.ReactNode; render(): React.ReactNode; } export default NewItemModal; //# sourceMappingURL=NewItemModal.d.ts.map