import { AttributeType, WorkspaceRole } from './graphql-global-types'; export interface IReference { id: string; visibleName?: string | null; } export interface ICollaborator { id: string; nickName: string; image?: string | null; color: string; isRemoved?: boolean; role: WorkspaceRole; } export interface CollaboratorsById { [id: string]: ICollaborator; } export interface IDepartment { id: string; name: string; icon?: string | null; } export interface DepartmentsById { [id: string]: IDepartment; } export interface IAttachment { fileId: string; fileName: string; fileType: string; fileKey: string; fileSize: number; largeThumbUrl: string; mediumThumbUrl: string; smallThumbUrl: string; url: string; } export declare type OptionId = string; export declare type StatusId = string; export declare type UserId = string; export declare type DepartmentId = string; declare type CellValueWithoutLookup = { [AttributeType.TEXT]: string; [AttributeType.PHONE]: string; [AttributeType.EMAIL]: string; [AttributeType.DATETIME]: string; [AttributeType.LONG_TEXT]: string; [AttributeType.ROLLUP]: string; [AttributeType.FORMULA]: string; [AttributeType.UNIQUE_ID]: string; [AttributeType.ID]: string; [AttributeType.CREATED_AT]: string; [AttributeType.CREATED_BY]: string; [AttributeType.SELECT]: OptionId; [AttributeType.STATUS]: StatusId; [AttributeType.NUMBER]: number; [AttributeType.CURRENCY]: number; [AttributeType.RATING]: number; [AttributeType.AUTO_NUMBER]: number; [AttributeType.BOOLEAN]: boolean; [AttributeType.COLLABORATOR]: UserId; [AttributeType.DEPT]: DepartmentId[]; [AttributeType.MULTI_SELECT]: OptionId[]; [AttributeType.MULTI_ATTACHMENT]: IAttachment[]; [AttributeType.RECORD_REFERENCE]: IReference[]; [AttributeType.LOOKUP]: never; }[T]; /** * This is the type of the lookup cell value representation which we receive * from the backend and store in mobx. It looks like this: * * = string[] | number[] | ... * * unfortunately a union of array types isn't a valid target for array methods * in typescript so you can't do: * * (foo as LookupCellValueUnion).map(...); */ declare type LookupCellValueUnion = { [Property in T]: CellValueWithoutLookup extends any[] ? CellValueWithoutLookup : CellValueWithoutLookup[]; }[T]; /** * This is an alternative to the type of the lookup cell value representation which we receive * from the backend and store in mobx. It looks like this: * * = (string | number | ...)[] * * and therefore, is a valid target for array methods such as Array.prototype.map() */ declare type LookupCellValue = LookupCellValueUnion extends (infer U)[] ? U[] : never; export declare type CellValue = T extends AttributeType.LOOKUP ? LookupCellValue | null : CellValueWithoutLookup | null; export declare type RowId = string | number; export declare type RowRecord = Record & { id: RowId; }; export declare type FieldExtraData = { [AttributeType.TEXT]: undefined; [AttributeType.PHONE]: undefined; [AttributeType.EMAIL]: undefined; [AttributeType.ID]: undefined; [AttributeType.UNIQUE_ID]: undefined; [AttributeType.AUTO_NUMBER]: undefined; [AttributeType.CREATED_AT]: undefined; [AttributeType.CREATED_BY]: CollaboratorsById; [AttributeType.DATETIME]: undefined; [AttributeType.LONG_TEXT]: undefined; [AttributeType.ROLLUP]: undefined; [AttributeType.FORMULA]: undefined; [AttributeType.STATUS]: undefined; [AttributeType.SELECT]: undefined; [AttributeType.NUMBER]: undefined; [AttributeType.CURRENCY]: undefined; [AttributeType.RATING]: undefined; [AttributeType.BOOLEAN]: undefined; [AttributeType.COLLABORATOR]: CollaboratorsById; [AttributeType.MULTI_SELECT]: undefined; [AttributeType.MULTI_ATTACHMENT]: undefined; [AttributeType.RECORD_REFERENCE]: IReference[]; [AttributeType.LOOKUP]: never; [AttributeType.DEPT]: DepartmentsById; }[T]; export declare type CellExtraProps = { [AttributeType.TEXT]: never; [AttributeType.PHONE]: never; [AttributeType.EMAIL]: never; [AttributeType.ID]: never; [AttributeType.UNIQUE_ID]: never; [AttributeType.AUTO_NUMBER]: never; [AttributeType.CREATED_AT]: { minDate?: Date | null; maxDate?: Date | null; }; [AttributeType.CREATED_BY]: never; [AttributeType.DATETIME]: { minDate?: Date | null; maxDate?: Date | null; }; [AttributeType.LONG_TEXT]: never; [AttributeType.ROLLUP]: never; [AttributeType.FORMULA]: never; [AttributeType.STATUS]: never; [AttributeType.SELECT]: never; [AttributeType.NUMBER]: never; [AttributeType.CURRENCY]: never; [AttributeType.RATING]: never; [AttributeType.BOOLEAN]: never; [AttributeType.COLLABORATOR]: never; [AttributeType.MULTI_SELECT]: never; [AttributeType.MULTI_ATTACHMENT]: never; [AttributeType.RECORD_REFERENCE]: never; [AttributeType.LOOKUP]: never; [AttributeType.DEPT]: never; }[T]; export {};