studiocms
Version:
Astro Native CMS for AstroDB. Built from the ground up by the Astro community.
66 lines (65 loc) • 2.51 kB
TypeScript
import type { InjectedRoute } from 'astro';
import { Context, Effect, Layer } from '../effect.js';
import type { InjectedRoutesWithMiddleware, ProcessedRouteConfig, RouteConfig } from './types.js';
declare const StudioCMSRouteConfig_base: Context.TagClass<StudioCMSRouteConfig, "StudioCMSRouteConfig", RouteConfig>;
/**
* Effect Layer providing the StudioCMS route configuration.
*/
export declare class StudioCMSRouteConfig extends StudioCMSRouteConfig_base {
static Live: (config: RouteConfig) => Layer.Layer<StudioCMSRouteConfig, never, never>;
}
/**
* Process and derive route settings from the main configuration.
*/
export declare const processedConfig: (args_0: RouteConfig) => Effect.Effect<ProcessedRouteConfig, never, never>;
/**
* Sets the `prerender` property to `false` for the given routes.
*
* @param items - An array of `InjectedRoute` objects.
* @returns An array of `InjectedRoute` objects with `prerender` set to `false`.
*/
export declare const setPrerenderFalse: (items: InjectedRoute[] | InjectedRoute) => {
prerender: boolean;
pattern: string;
entrypoint: string | URL;
}[];
/**
* Map processed configuration to route groups.
*/
export declare const mapProcessedConfig: (args_0: ProcessedRouteConfig & {
dashboardRoute: (path: string) => string;
}) => Effect.Effect<{
enabled: boolean;
routes: {
prerender: boolean;
pattern: string;
entrypoint: string | URL;
}[];
}[], never, never>;
/**
* Flat map processed configuration to route groups.
*/
export declare const flatMapProcessedConfig: (config: Pick<RouteConfig, "dashboardRoute">) => (processed: ProcessedRouteConfig) => Effect.Effect<{
enabled: boolean;
routes: {
prerender: boolean;
pattern: string;
entrypoint: string | URL;
}[];
}[], never, never>;
/**
* Map route groups to a flat array of routes.
*/
export declare const mapRouteGroups: (routeGroups: {
enabled: boolean;
routes: InjectedRoute[];
}[]) => Effect.Effect<InjectedRoute[], never, never>;
/**
* Inject extra routes from the configuration.
*/
export declare const injectExtraRoutes: (config: Pick<RouteConfig, "extraRoutes">) => (routes: InjectedRoute[]) => Effect.Effect<InjectedRoute[], never, never>;
/**
* Inject middleware based on the configuration.
*/
export declare const injectMiddleware: ({ dbStartPage }: Pick<RouteConfig, "dbStartPage">) => (routes: InjectedRoute[]) => Effect.Effect<InjectedRoutesWithMiddleware, never, never>;
export {};