import "urlpattern-polyfill"; import * as http from "cloudly-http"; import * as cloudlyRouter from "cloudly-router"; export interface Endpoint { listen: { pattern: string | URLPattern; methods: http.Method | http.Method[]; }; authenticate?: (request: http.Request, context: E["context"]) => Promise; body?: (body: any) => boolean; context?: (keyof E["context"])[]; result: (request: { authentication: E["authentication"]; body: E["body"]; context?: E["context"]; }) => http.Response.Like | any; } export declare namespace Endpoint { type Type = { authentication: string | boolean | Record | undefined; body?: any | undefined; context: any | undefined; }; function toHandler(endpoint: Endpoint): [http.Method | http.Method[], string | URLPattern, cloudlyRouter.Handler]; }