UNPKG

file-routing-expressjs

Version:

A dependency-free, flexible, system-based file routing for Express.

22 lines (19 loc) 1.37 kB
import { RequestHandler } from 'express'; import { RouteErrorHandler, ExpressMethod } from '../types/routing.js'; declare const VALID_OUTPUT_TYPES: readonly ["tree", "table", "json"]; declare function isFunction(value: any): value is Function; declare function isRequestHandler(handler: any): handler is RequestHandler; declare function isErrorHandler(handler: any): handler is RouteErrorHandler; declare function filenameIsJSorTS(filename: string): boolean; declare function pathExistsAndIsFile(path: string): boolean; declare function fileExistsAndIsJSorTS(filePath: string): boolean; declare function methodIsExpressMethod(method: string): method is ExpressMethod; declare function isDefined<T>(value: T): value is NonNullable<T>; declare function isNotDefined<T>(value: T): value is Extract<T, null | undefined>; declare function isObject(value: unknown): value is object; declare function validateCLIList<T extends string = string>(value: string | undefined, allowed: T[] | Readonly<T[]>, name: string): T[]; declare function normalizeCLIOptions(options: Record<string, any>): { target: string; output: (typeof VALID_OUTPUT_TYPES)[number]; }; export { fileExistsAndIsJSorTS, filenameIsJSorTS, isDefined, isErrorHandler, isFunction, isNotDefined, isObject, isRequestHandler, methodIsExpressMethod, normalizeCLIOptions, pathExistsAndIsFile, validateCLIList };