diff --git a/packages/frontend-core/src/api/routes.js b/packages/frontend-core/src/api/routes.ts similarity index 52% rename from packages/frontend-core/src/api/routes.js rename to packages/frontend-core/src/api/routes.ts index 28e206debc..7d2df98b57 100644 --- a/packages/frontend-core/src/api/routes.js +++ b/packages/frontend-core/src/api/routes.ts @@ -1,4 +1,12 @@ -export const buildRouteEndpoints = API => ({ +import { BaseAPIClient } from "./types" + +export interface RouteEndpoints { + // Missing request or response types + fetchClientAppRoutes: () => Promise<{ routes: any }> + fetchAppRoutes: () => Promise<{ routes: any }> +} + +export const buildRouteEndpoints = (API: BaseAPIClient): RouteEndpoints => ({ /** * Fetches available routes for the client app. */ diff --git a/packages/frontend-core/src/api/types.ts b/packages/frontend-core/src/api/types.ts index 176e7f6a32..f3cf6b034f 100644 --- a/packages/frontend-core/src/api/types.ts +++ b/packages/frontend-core/src/api/types.ts @@ -22,6 +22,7 @@ import { PluginEndpoins } from "./plugins" import { QueryEndpoints } from "./queries" import { RelationshipEndpoints } from "./relationships" import { RoleEndpoints } from "./roles" +import { RouteEndpoints } from "./routes" export enum HTTPMethod { POST = "POST", @@ -115,4 +116,5 @@ export type APIClient = BaseAPIClient & PluginEndpoins & QueryEndpoints & RelationshipEndpoints & - RoleEndpoints & { [key: string]: any } + RoleEndpoints & + RouteEndpoints & { [key: string]: any }