UNPKG

@firecms/core

Version:

Awesome Firebase/Firestore-based headless open-source CMS

33 lines (32 loc) 1.54 kB
import { EntityCollection, NavigationController, SideEntityController } from "../types"; export declare function removeInitialAndTrailingSlashes(s: string): string; export declare function removeInitialSlash(s: string): string; export declare function removeTrailingSlash(s: string): string; export declare function addInitialSlash(s: string): string; export declare function getLastSegment(path: string): string; export declare function resolveCollectionPathIds(path: string, allCollections: EntityCollection[]): string; /** * Find the corresponding view at any depth for a given path. * Note that path or segments of the paths can be collection aliases. * @param pathOrId * @param collections */ export declare function getCollectionByPathOrId(pathOrId: string, collections: EntityCollection[]): EntityCollection | undefined; /** * Get the subcollection combinations from a path: * "sites/es/locales" => ["sites/es/locales", "sites"] * @param subpaths */ export declare function getCollectionPathsCombinations(subpaths: string[]): string[]; export declare function navigateToEntity({ openEntityMode, collection, entityId, copy, path, fullIdPath, selectedTab, sideEntityController, onClose, navigation }: { openEntityMode: "side_panel" | "full_screen"; collection?: EntityCollection; entityId?: string; selectedTab?: string; copy?: boolean; path: string; fullIdPath?: string; sideEntityController: SideEntityController; onClose?: () => void; navigation: NavigationController; }): void;