import { CheckboxProps } from '../checkbox'; import { PaginationProps, PageInfo } from '../pagination'; import { InputProps } from '../input'; import { TreeProps } from '../tree'; import { TNode, KeysType } from '../common'; export interface TdTransferProps { checkboxProps?: CheckboxProps; checked?: Array; defaultChecked?: Array; data?: Array; direction?: 'left' | 'right' | 'both'; disabled?: boolean | Array; empty?: EmptyType | Array | TNode; footer?: Array | TNode<{ type: TransferListType; }>; keys?: KeysType; operation?: Array | TNode<{ direction: 'left' | 'right'; }>; pagination?: PaginationProps | Array; search?: SearchOption | Array; showCheckAll?: boolean | Array; targetDraggable?: boolean; targetSort?: 'original' | 'push' | 'unshift'; title?: Array | TNode<{ type: TransferListType; }>; transferItem?: TNode>; tree?: (tree: TreeProps) => TNode; value?: Array; defaultValue?: Array; modelValue?: Array; onChange?: (targetValue: Array, context: TargetParams) => void; onCheckedChange?: (options: CheckedOptions) => void; onPageChange?: (page: PageInfo, context: { type: TransferListType; }) => void; onScroll?: (options: { e: Event; bottomDistance: number; type: TransferListType; }) => void; onSearch?: (options: SearchContext) => void; } export type EmptyType = string | TNode; export type SearchOption = boolean | InputProps; export type TitleType = string | TNode; export type TransferListType = 'source' | 'target'; export interface TransferItem { data: T; index: number; type: TransferListType; } export interface TargetParams { type: TransferListType; movedValue: Array; } export interface CheckedOptions { checked: Array; sourceChecked: Array; targetChecked: Array; type: TransferListType; } export interface SearchContext { query: string; type: TransferListType; trigger: 'input' | 'enter'; e: InputEvent | KeyboardEvent; } export type DataOption = { label?: string; value?: TransferValue; disabled?: boolean; } & Record; export type TransferValue = string | number;