Fix routes

This commit is contained in:
Christian Capeans 2023-09-13 18:34:29 +02:00
parent 082cde5874
commit 361b318f91

View File

@ -1,8 +1,15 @@
import type { Common } from '../../..';
// import { Router } from '../../../../core-api';
export interface Routes {
// TODO: Make RouteInput a generic that enforces the route type (either undefined or matching the RouteType key here)
'content-api'?: Common.RouteInput[] | (() => Common.RouteInput[]); // TODO: Should this be Router.Router & { type: 'content-api' }; ?
admin?: Common.RouteInput[] | (() => Common.RouteInput[]); // TODO: Should this be Router.Router & { type: 'admin' }; ?
export type ArrayNotation = Common.RouteInput[];
export interface ObjectNotation {
routes: Common.RouteInput[];
type?: Common.RouterType;
}
export interface NamedRoutes {
[key: string]: ObjectNotation;
}
export type Routes = ArrayNotation | NamedRoutes;