Files
med-notes/.pnpm-store/v10/files/ca/3c503582e82dcfa62e85cba379777b4b671e97f7c0deaff3bc510d78492ef9605ad60763b38ded96e5ed7614e5b08db8fbb51a998214e8f4b5d7ac5590f355
2025-05-09 05:30:08 +02:00

39 lines
1.9 KiB
Plaintext

import { MatchLocation } from './RouterProvider.cjs';
import { AnyPathParams } from './route.cjs';
export interface Segment {
type: 'pathname' | 'param' | 'wildcard';
value: string;
}
export declare function joinPaths(paths: Array<string | undefined>): string;
export declare function cleanPath(path: string): string;
export declare function trimPathLeft(path: string): string;
export declare function trimPathRight(path: string): string;
export declare function trimPath(path: string): string;
export declare function removeTrailingSlash(value: string, basepath: string): string;
export declare function exactPathTest(pathName1: string, pathName2: string, basepath: string): boolean;
interface ResolvePathOptions {
basepath: string;
base: string;
to: string;
trailingSlash?: 'always' | 'never' | 'preserve';
caseSensitive?: boolean;
}
export declare function resolvePath({ basepath, base, to, trailingSlash, caseSensitive, }: ResolvePathOptions): string;
export declare function parsePathname(pathname?: string): Array<Segment>;
interface InterpolatePathOptions {
path?: string;
params: Record<string, unknown>;
leaveWildcards?: boolean;
leaveParams?: boolean;
decodeCharMap?: Map<string, string>;
}
type InterPolatePathResult = {
interpolatedPath: string;
usedParams: Record<string, unknown>;
};
export declare function interpolatePath({ path, params, leaveWildcards, leaveParams, decodeCharMap, }: InterpolatePathOptions): InterPolatePathResult;
export declare function matchPathname(basepath: string, currentPathname: string, matchLocation: Pick<MatchLocation, 'to' | 'fuzzy' | 'caseSensitive'>): AnyPathParams | undefined;
export declare function removeBasepath(basepath: string, pathname: string, caseSensitive?: boolean): string;
export declare function matchByPath(basepath: string, from: string, matchLocation: Pick<MatchLocation, 'to' | 'caseSensitive' | 'fuzzy'>): Record<string, string> | undefined;
export {};