Skip to main content
Module

x/dinar/lib/@types/types.ts

deno web framewrok maybe :<
Latest
File
import { Cookies, ServerRequest, Key } from "../deps.ts";import { RouteMethod } from "../constant/RouteMethods.ts";import { ArgumentsTypes } from "../constant/ArgumentsTypes.ts";import { IMiddleware, IPipe, IGuard, IInterceptor, IStatic, IFilter, ILogger } from "../interface/mod.ts";
export type Constructor<T = object> = new (...args: any[]) => T;
export type MiddlewareConstructor = Constructor<IMiddleware>;export type PipeConstructor = Constructor<IPipe>;export type GuardConstructor = Constructor<IGuard>;export type InterceptorConstructor = Constructor<IInterceptor>;export type StaticConstructor = Constructor<IStatic>;export type FilterConstructor = Constructor<IFilter>;export type LoggerConstructor = Constructor<ILogger>;
export type RouterCallback = (req: ServerRequest) => any;
export type InjectorDescriptor = { target: string; proto: Constructor; priority: number; args: string[]; type: InjectorType; middlewareTypes?: MiddlewareTypes;};
export type ControllerDescriptor = { target: string; proto: Constructor; prefix: string; args: any[]; stateful: boolean;};
export type ActionDescriptor = { suffix: string; target: string; type: RouteMethod; callback: RouterCallback; key: string; hostName: string; argsType: Constructor[];};
export type ServiceInstantiation = { target: string; instance: object;};
export type ArgumentsDescriptor = { type: ArgumentsTypes; field: string; target: string; key: string; position: number;};
export type EntityDescriptor = { // target: typeof Model; name: string; target: string;};
export type RouterDescriptor = { actionDescriptor: ActionDescriptor; prefix: string; args: ArgumentsDescriptor[]; host: object; stateful: boolean;};
export type RouterHandle = (...args: any[]) => any;
export type RouterParams = { name: string; delimiter: string; optional: boolean; repeat: boolean };
export type Path = string;
export type Record = { [key: string]: any;};
export enum InjectorType { Service = "service", Middleware = "middleware",}
export enum MiddlewareTypes { Middleware = "middleware", StaticServer = "static-server", Guard = "guard", Pipe = "pipe", Interceptor = "interceptor", Filter = "filter", Logger = "logger",}