/* * MyTh Ahmed Faiz Copyright © 2016-2024 All rights reserved. * Email: mythpe@gmail.com * Mobile: +966590470092 * Website: https://www.4myth.com * Github: https://github.com/mythpe */ import { AxiosRequestConfig } from 'axios' import { ApiServiceParams } from '../components' import { ApiInterface, Generic } from '../types/m-helpers' export type UrlType = string | number | any; export type ParamsType = Record | FormData | object export type ConfigType = AxiosRequestConfig & Partial<{ params: Partial & Generic }> export type HelpersStubSchema = { index (config?: ConfigType): Promise; staticIndex (config?: ConfigType): Promise; export (data?: ParamsType, config?: AxiosRequestConfig): Promise; store (data?: ParamsType, config?: AxiosRequestConfig): Promise; show (id: UrlType, config?: AxiosRequestConfig): Promise; staticShow (id: UrlType, config?: AxiosRequestConfig): Promise; update (id: UrlType, data?: ParamsType, config?: AxiosRequestConfig): Promise; destroy (id: UrlType, config?: AxiosRequestConfig): Promise; destroyAll (ids?: UrlType[], config?: AxiosRequestConfig): Promise; getUploadAttachmentsUrl (id: UrlType): string; uploadAttachments (id: UrlType, data: Generic, config?: AxiosRequestConfig): Promise; deleteAttachment (id: UrlType, fileId: string | number, config?: AxiosRequestConfig): Promise; updateAttachment (id: UrlType, fileId: string | number, data: Record, config?: AxiosRequestConfig): Promise; }; export type StubSchemaContext = HelpersStubSchema & Record Promise)> & Record Promise)>> & Record Promise)>>> export type StubSchema = StubSchemaContext & ((...args: any) => Promise) & string & Record export type MythApiServicesSchema = { [key: string | symbol | number]: StubSchema }