import type Shelf from '../shelf/Shelf' ; import { ServiceURL } from './urls' ; export type ErrorType = 'server' | 'client' ; export type ErrorCode = 'NO_ROUTE' | 'OPEN_FAIL' | 'MOVE_FAIL' | 'TAG_READ_FAIL' | 'TAG_LIST_FAIL' | 'TAG_WRITE_FAIL' ; export interface ServiceContext { shelf : Shelf ; params : unknown ; body : unknown ; cacheable ( this , maxAge ) : Promise < void > ; success ( this , data ? ) : Promise < void > ; error ( this , type , code , message , error ? ) : Promise < void > ; } export type RouteExecute = ( context : ServiceContext ) => Promise < void > ; export interface RouteRegistry { get ( this , path , execute ) : void ; post ( this , path , execute ) : void ; }