import { IDStr } from "polar-shared/src/util/Strings"; import { URLPathStr, URLRegularExpressionStr } from "polar-shared/src/url/PathToRegexps"; export declare class Rewrites { static matchesRegex(regex: URLRegularExpressionStr, path: URLPathStr): boolean; static toSources(rewrite: BaseRewrite): ReadonlyArray; } export declare type ContentGenerator = (url: string) => Promise; export interface BaseRewrite { readonly source: URLPathStr | ReadonlyArray; readonly destination: string | ContentGenerator; } export interface IDRewrite { readonly id: IDStr; } export interface DestinationRewrite extends BaseRewrite { } export interface DirectRewrite { readonly id: string; readonly source: URLPathStr; readonly destination: string | ContentGenerator; } export declare type Rewrite = DestinationRewrite; export declare type Predicate = (value: V) => R; export declare type RewritePredicate = Predicate;