Restore UI functionalities and clean up dependencies

This commit is contained in:
streaper2
2026-05-08 08:32:58 +02:00
parent 8946955f76
commit 0895b7d5bc
26751 changed files with 4207476 additions and 158 deletions

View File

@@ -0,0 +1,33 @@
/**
* Takes a URL and does the following things.
* - Replaces `index.html` with `/`
* - Makes sure all URLs are have a trailing `/`
* - Removes query string
*/
export declare function normalizeURL(url: string): string;
/**
* Normalizes an app route so it represents the actual request path. Essentially
* performing the following transformations:
*
* - `/(dashboard)/user/[id]/page` to `/user/[id]`
* - `/(dashboard)/account/page` to `/account`
* - `/user/[id]/page` to `/user/[id]`
* - `/account/page` to `/account`
* - `/page` to `/`
* - `/(dashboard)/user/[id]/route` to `/user/[id]`
* - `/(dashboard)/account/route` to `/account`
* - `/user/[id]/route` to `/user/[id]`
* - `/account/route` to `/account`
* - `/route` to `/`
* - `/` to `/`
*
* @param route the app route to normalize
* @returns the normalized pathname
*/
export declare function normalizeAppPath(route: string): string;
/**
* Gets the possible URLs from a directory.
*/
export declare function getUrlFromPagesDirectories(urlPrefix: string, directories: string[]): RegExp[];
export declare function getUrlFromAppDirectory(urlPrefix: string, directories: string[]): RegExp[];
export declare function execOnce<TArgs extends any[], TResult>(fn: (...args: TArgs) => TResult): (...args: TArgs) => TResult;