UNPKG

@blitzjs/file-pipeline

Version:

Display package for the Blitz CLI

30 lines (29 loc) 1.14 kB
import File from "vinyl"; import { RouteCacheEntry, RouteCacheInterface, RouteType, RouteVerb } from "../types"; export declare class RouteCache implements RouteCacheInterface { static singleton: RouteCache | null; routeCache: Record<string, RouteCacheEntry>; lengthOfHTTPErrorURI: number; normalizePath(input: string): string; getUrifromPath(path: string): string; getVerb(type: RouteType): RouteVerb; isErrorCode(uri: string): boolean; private getType; add(file: File): void; delete(file: File): void; filterByPath(filterFn: (givenPath: string) => boolean): RouteCacheEntry[]; filter(filterFn: (entry: RouteCacheEntry) => boolean): RouteCacheEntry[]; get(): Record<string, RouteCacheEntry>; get(key: string): RouteCacheEntry; get(file: File): RouteCacheEntry; set(key: string, value: RouteCacheEntry): void; toString(): string; toArray(): RouteCacheEntry[]; static create(): RouteCache; } /** * Provides a route cache of the files running through the stream */ export declare function createRouteCache(): { cache: RouteCache; };