route-interceptor
Version:
A front-end generic route interceptor
10 lines (9 loc) • 346 B
TypeScript
export declare type Way = "a" | "window.open" | "history" | "hash" | "location";
export declare type Intercept = (url: string) => string | false;
export declare type InterceptorInstance = {
start: () => void;
};
export declare function create({ way, intercept, }: {
way: Way[];
intercept: Intercept;
}): InterceptorInstance;