import { IQueryResult } from "@leight-core/leight"; import { NextApiRequest, NextApiResponse } from "next"; export declare type IQueryParams = { [key: string]: string | string[]; } | void; export interface INextApiRequest extends Omit { query: TQuery; body: TRequest; } /** * Generic endpoint; SDK generates as POST by default. */ export declare type IEndpoint = (req: INextApiRequest, res: NextApiResponse) => void; /** * When fetching an individual item, done by GET. */ export declare type IFetchEndpoint = IEndpoint; /** * When fetching a list of items (arrayed by default), done by GET. */ export declare type IListEndpoint = IEndpoint; /** * Mutation endpoint is a general endpoint used to do some server-side effect (some updated data or so). * * Defaults to POST. */ export declare type IMutationEndpoint = IEndpoint; /** * Good old creation endpoint. * * Defaults by POST. */ export declare type ICreateEndpoint = IMutationEndpoint; /** * Endpoint used to partially update data * * Defaults to PATCH. */ export declare type IPatchEndpoint = IMutationEndpoint; /** * Endpoint used to query data on a server. * * Defaults to POST. */ export declare type IQueryEndpoint = IEndpoint, TQuery>; /** * Endpoint used to remove something. * * Defaults to DELETE. */ export declare type IDeleteEndpoint = IMutationEndpoint;