import { ReactNode } from 'react'; import { RecordTypeEnum, FileTypeEnum, RecordActionEnum } from './enum'; export declare type DisplayTimeFn = (time: number, now?: number) => ReactNode; export interface RecordProps { className?: string; quickStatic?: boolean; readonly?: boolean; nav?: Array; data: Array; footStyle?: React.CSSProperties; height?: string | number; showHead?: boolean; showFoot?: boolean; title: string; isSort: boolean; refFn: Function; onAction?: (obj: RecordActionType) => any; /** * 标题右侧额外内容 */ extra?: ReactNode; /** * 自定义时间展示方法,不传则使用内部 displayTime */ displayTime?: DisplayTimeFn; } export interface CommentType { type: RecordTypeEnum.comment; id: string; username: string; content: string; avatar: string; date: string; replyId: string; deleted: boolean; deleteDate: string; isSelf: boolean; } export declare type CommentReplyType = CommentType & { reply?: string; replyContent?: string; replyDeleted?: boolean; }; export interface FileType { type: RecordTypeEnum.file; id: string; username: string; fileType: FileTypeEnum; filesize: string; fileUrl: string; date: string; oprType: 'add' | 'remove'; } export interface LinkType { type: RecordTypeEnum.link; id: string; username: string; linkType: string; linkName: string; linkId: string; date: string; deleted: false; deleteDate: string; } export interface RecordType { type: RecordTypeEnum.record; id: string; username: string; desc: string; date: string; compare: boolean; } export interface RecordNavType { name: string; type: RecordTypeEnum; } export declare type DataItemType = CommentType | FileType | LinkType | RecordType; export declare type RecordComponentItemType = CommentReplyType | FileType | LinkType | RecordType; export interface HandleDataType { data: Array; nav: Array; } export interface CommentTypeMap { [id: string]: CommentType; } export interface RecordActionType { type: RecordActionEnum; id?: string | null; content?: string; }