import { IdMapperClient } from './id-mapper-client'; import { Query as DirectusQuery, RestCommand } from '@directus/sdk'; import { CollectionHooks } from '../../config'; import { DirectusUnknownType } from '../../interfaces'; export type DirectusId = number | string; export interface DirectusRequestError { errors: { message: string; extensions: { collection?: string; field?: string; code: string; }; }[]; response: unknown; } export interface DirectusError { message: string; collection?: string; field?: string; code: string; } export interface DirectusBaseType { id: DirectusId; } export type WithSyncId = T & { _syncId: string; }; export type WithoutId = Omit; export type WithoutSyncId = Omit; export type WithoutIdAndSyncId = Omit; export type WithSyncIdAndWithoutId = WithSyncId>; export interface UpdateItem { sourceItem: WithSyncIdAndWithoutId; targetItem: WithSyncId; diffItem: Partial>; } export type StrictField = keyof WithSyncIdAndWithoutId; export type Field = keyof WithSyncIdAndWithoutId | Virtual; export type IdMappers = { [key in keyof T]?: IdMapperClient | IdMappers; } & Partial>; export type BaseSchema = any; export type Query = DirectusQuery; export type Command = RestCommand; export type SingleRestCommand = Command | Promise>; export type MultipleRestCommand = Command | [...Command[], Command] | Promise | [...Command[], Command]>; export interface DirectusCollectionExtraConfig { hooks: CollectionHooks; preserveIds?: boolean; }