import { AxiosRequestConfig } from 'axios'; import { Id, Shape, Count } from '../types'; export interface BaseModelInterface { basePath: string; request(config: AxiosRequestConfig): Promise; post(item: Omit): Promise; getAll(filter?: Shape): Promise>; getById(id: Id, filter?: Shape): Promise; count(where?: Shape): Promise; patchById(id: Id, item: Partial): Promise; patchAll(item: Partial, where?: Shape): Promise; putById(id: Id, item: T): Promise; deleteById(id: Id): Promise; } export interface HasOneInterface { get(parentId: Id): Promise; post(parentId: Id, item: Omit): Promise; } export interface HasManyInterface { getAll(parentId: Id, filter?: Shape): Promise>; post(parentId: Id, item: Omit): Promise; patchAll(parentId: Id, item: Partial, where?: Shape): Promise; delAll(parentId: Id, where?: Shape): Promise; } export interface BelongsToInterface { get(parentId: Id): Promise; }