import { ColumnConfig } from '../FormGenerator'; import { EditFieldConfig } from '../Popup'; // Import React for component types import React from 'react'; // Re-export connection-related interfaces from hooks export type { Connection, CreateConnectionData } from '../../hooks/useConnections'; import type { Connection } from '../../hooks/useConnections'; // Component Props Interfaces export interface ConnectionsTableProps { connections: Connection[]; columns: ColumnConfig[]; actions: TableAction[]; isLoading?: boolean; isConnecting?: boolean; isDisconnecting?: boolean; onRowSelect?: (selectedRows: Connection[]) => void; onDelete?: (connection: Connection) => Promise; onDeleteMultiple?: (connections: Connection[]) => Promise; } export interface ConnectionEditModalProps { isOpen: boolean; connection: Connection | null; fields: EditFieldConfig[]; onSave: (updatedConnection: Connection) => Promise; onCancel: () => void; } export interface ConnectionsErrorDisplayProps { error?: string | null; connectError?: string | null; disconnectError?: string | null; } // Table Action Interface export interface TableAction { label: string; onClick: (connection: Connection) => Promise | void; icon: React.ReactNode | ((connection: Connection) => React.ReactNode); } // Connection Status Types export type ConnectionStatus = 'active' | 'pending' | 'expired' | 'revoked'; export type ConnectionAuthority = 'local' | 'google' | 'msft'; // Handler Function Types export interface ConnectionHandlers { handleCreateConnection: (type: 'msft' | 'google') => Promise; handleConnect: (connection: Connection) => Promise; handleDisconnect: (connection: Connection) => Promise; handleDelete: (connection: Connection) => Promise; handleDeleteMultiple: (connections: Connection[]) => Promise; handleConnectOrDisconnect: (connection: Connection) => Promise; handleEditConnection: (connection: Connection) => Promise; handleSaveConnection: (updatedConnection: Connection) => Promise; handleCancelEdit: () => void; } // Hook Return Types export interface ConnectionsLogicReturn extends ConnectionHandlers { connections: Connection[]; isLoading: boolean; isConnecting: boolean; isDisconnecting: boolean; error: string | null; connectError: string | null; disconnectError: string | null; editPopupOpen: boolean; editingConnection: Connection | null; connectionColumns: ColumnConfig[]; connectionEditFields: EditFieldConfig[]; tableActions: TableAction[]; }