UNPKG

@scalar/api-reference

Version:

Generate beautiful API references from OpenAPI documents

28 lines 1.54 kB
export declare const sanitizeBasePath: (basePath: string) => string; /** Extracts an element id from the hash when using hash routing */ export declare const getIdFromHash: (location: string | URL, slugPrefix: string | undefined) => string; /** Extracts an element id from the path when using path routing */ export declare const getIdFromPath: (location: string | URL, basePath: string, slugPrefix: string | undefined) => string; /** * Extracts a navigation id from a URL based on the routing type * * @param url - The URL to extract the id from * @param basePath - The base path used in path routing * @param slugPrefix - If the document slug is not expected in the URL then we must prefix it */ export declare const getIdFromUrl: (url: string | URL, basePath: string | undefined, slugPrefix: string | undefined) => string; /** * Generate a new URL and applies the ID to the path or hash * depending on the type of routing used * * @param id - The id to apply to the URL * @param basePath - The base path used in path routing * @param isMultiDocument - Whether the document is multi-document or single-document. Single-document documents will strip the document slug from the id */ export declare const makeUrlFromId: (_id: string, basePath: string | undefined, isMultiDocument: boolean) => URL | undefined; /** Extracts the schema parameters from the id if they are present */ export declare const getSchemaParamsFromId: (id: string) => { rawId: string; params: string; }; //# sourceMappingURL=id-routing.d.ts.map