UNPKG

@zeushq/nextjs-zapi

Version:

Next.js SDK for creating a Zeus API

53 lines (45 loc) 1.28 kB
import { HandleResource, HandleList, HandleShow, HandleCreate, HandleUpdate, HandleDestroy } from './handlers'; import { ConfigParameters } from './zapi'; /** * The SDK server instance. * * This is created for you when you use the named exports, or you can create your own using {@link InitZeusResourceAPI} * * See {@link Config} fro more info. * * @category Server */ export interface HandleZeusRestResource { // /** // * List handler which will render a JSON list of the model // */ handleList: HandleList; // /** // * Show handler which will render a JSON serialization of the model // */ handleShow: HandleShow; // /** // * Create handler which will create a model and return it's JSON representation // */ handleCreate: HandleCreate; // /** // * Update handler which will update the model // */ handleUpdate: HandleUpdate; // /** // * Destroy handler which will destroy the model // */ handleDestroy: HandleDestroy; // /** // * Destroy handler which will destroy the model // */ handleResource: HandleResource; } /** * Initialise your own instance of the SDK. * * See {@link Config} * * @category Server */ export type InitZeusRestResource = (config?: ConfigParameters) => HandleZeusRestResource;