UNPKG

studiocms

Version:

Astro Native CMS for AstroDB. Built from the ground up by the Astro community.

46 lines (45 loc) 1.41 kB
import type { CurrentRESTAPIVersions } from '../../consts.js'; /** * Creates a function that generates API route strings. * * @param path - The base path for the API route. * @returns A function that takes a route string and returns the full API route. * * @example * ```typescript * const apiRoute = makeAPIRoute('users'); * const fullRoute = apiRoute('profile'); // Returns '/studiocms_api/users/profile' * ``` */ export declare function makeAPIRoute(path: string): (route: string) => string; /** * Resolves the API route for the SDK. * * This function uses the `makeAPIRoute` utility to generate the API route * specifically for the SDK. * * @constant */ export declare const sdkRouteResolver: (route: string) => string; /** * Creates an API route for the 'renderer' service. * * This function utilizes the `makeAPIRoute` utility to generate * a route specifically for the 'renderer' service. * * @constant */ export declare const apiRoute: (route: string) => string; /** * Generates a REST API route string for the specified version. * * @param version - The version of the REST API. * @returns The complete API route string for the given version. */ export declare const restRoute: (version: CurrentRESTAPIVersions) => (route: string) => string; /** * Creates a REST API route for version 1. * * @constant */ export declare const v1RestRoute: (route: string) => string;