Files
med-notes/.pnpm-store/v10/files/32/94733bce75e6b3f35b1bb9c780898b77b75861ca30e9590c45fa35b37074b25a1bad3a683b359bc73291b1506bbc9961fb94e0985142508fb4b11f55d363c4
2025-05-09 05:30:08 +02:00

39 lines
1.9 KiB
Plaintext

import { MatchLocation } from './RouterProvider.js';
import { AnyPathParams } from './route.js';
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 {};