export type RelationshipType = { id: string; type: string } export type DataType = { attributes: Record | unknown> id: string meta?: Record relationships?: { [key: string]: { data: RelationshipType[] | RelationshipType | null } } type: string } export type Config = Record<'keys', string[]> export type SerializerResponseApi = { data?: DataType | DataType[] | Record headers?: Record meta?: Record included?: DataType[] } export type ResponseFormatted = { included?: Record meta?: Record data: { [x: string]: unknown } | { [x: string]: unknown }[] headers: Record | undefined } export type HttpClient = { get: ( endpoint: string, options?: Record, ) => Promise post: ( endpoint: string, params: Record | BodyInit, options?: Record, ) => Promise put: ( endpoint: string, params: Record | BodyInit, options?: Record, ) => Promise delete: (endpoint: string) => Promise raw?: >( endpoint: string, options: Record & { responseType: 'blob' | 'arrayBuffer' | 'stream' }, ) => Promise<{ headers: Headers; _data: Response }> } export type Locale = 'fr' | 'en' export type WeekDays = | 'monday' | 'tuesday' | 'wednesday' | 'thursday' | 'friday' | 'saturday' | 'sunday' export type StorageClient = { getItem: (item: string) => string | Promise setItem: (item: string, payload: string) => void } export type Interceptors = { response?: Array<(r: ResT) => void> request?: Array<(r: ReqT) => void> }