@firecms/core
Version:
Awesome Firebase/Firestore-based headless open-source CMS
30 lines (29 loc) • 1.1 kB
TypeScript
import { EntityCollection, EntityCustomView } from "../types";
export type NavigationViewInternal<M extends Record<string, any> = any> = NavigationViewEntityInternal<M> | NavigationViewCollectionInternal<M> | NavigationViewEntityCustomInternal<M>;
export interface NavigationViewEntityInternal<M extends Record<string, any>> {
type: "entity";
entityId: string;
path: string;
fullPath: string;
parentCollection: EntityCollection<M>;
}
export interface NavigationViewCollectionInternal<M extends Record<string, any>> {
type: "collection";
id: string;
path: string;
fullPath: string;
collection: EntityCollection<M>;
}
export interface NavigationViewEntityCustomInternal<M extends Record<string, any>> {
type: "custom_view";
path: string;
fullPath: string;
entityId: string;
view: EntityCustomView<M>;
}
export declare function getNavigationEntriesFromPath(props: {
path: string;
collections: EntityCollection[] | undefined;
currentFullPath?: string;
contextEntityViews?: EntityCustomView<any>[];
}): NavigationViewInternal[];