UNPKG

@plurid/plurid-engine

Version:
45 lines (44 loc) 3.06 kB
import { /** interfaces */ PluridView, PluridApplicationView, PluridConfiguration, RegisteredPluridPlane, TreePlane, LinkCoordinates, PathParameters } from '@plurid/plurid-data'; /** * Given a view resolve it to an absolute view * and compute a TreePlane if there is a RegisteredPluridPlane * for that absolute view. * * @param view */ export declare const resolveViewItem: <C>(planes: Map<string, RegisteredPluridPlane<C>>, view: string | PluridView, configuration: PluridConfiguration, origin?: string, getCount?: () => number) => TreePlane | undefined; /** * Compute the space based on the layout. * If there is no configuration.space.layout, it uses the default '2 COLUMNS' layout. * * @param planes * @param configuration */ export declare const computeSpaceTree: <C>(planes: Map<string, RegisteredPluridPlane<C>>, view: PluridApplicationView, configuration: PluridConfiguration, layout: boolean | undefined, origin: string | undefined, getCount: () => number) => TreePlane[]; export declare const isParametric: (viewRoute: string, planeRoute: string) => boolean; export declare const matchForParameters: (viewRoute: string, planeRoute: string) => void; export declare const assignPagesFromView: (planes: TreePlane[], view?: PluridApplicationView) => TreePlane[]; export declare const updateTreePlane: (tree: TreePlane[], updatedPlane: TreePlane) => TreePlane[]; export interface UpdatedTreeWithNewPlane { pluridPlaneID: string; updatedTree: TreePlane[]; updatedTreePlane?: TreePlane; } export declare const updateTreeWithNewPlane: <C>(planeRoute: string, parentPlaneID: string, linkCoordinates: LinkCoordinates, tree: TreePlane[], planesRegistry: Map<string, RegisteredPluridPlane<C>>, configuration: PluridConfiguration, hostname?: string) => UpdatedTreeWithNewPlane; export declare const updatePlaneLocation: (tree: TreePlane[], parentPlaneID: string, planeID: string, linkCoordinates: LinkCoordinates) => TreePlane[]; export declare const updateTreeWithNewPage: (tree: TreePlane[], treePageParentPlaneID: string, pagePath: string, pageID: string, linkCoordinates: LinkCoordinates, parameters?: PathParameters) => UpdatedTreeWithNewPlane; export declare const removePageFromTree: (tree: TreePlane[], pluridPlaneID: string) => TreePlane[]; export declare const toggleChildren: (children: TreePlane[]) => TreePlane[]; export declare const toggleAllChildren: (tree: TreePlane[], show: boolean) => TreePlane[]; export interface TogglePlaneFromTree { updatedTree: TreePlane[]; updatedPlane: TreePlane | undefined; } export declare const togglePlaneFromTree: (tree: TreePlane[], pluridPlaneID: string, forceShow?: boolean) => TogglePlaneFromTree; export declare const getTreePlaneByID: (stateTree: TreePlane[], id: string | undefined) => TreePlane | undefined; export declare const removeRootFromTree: (tree: TreePlane[], pluridPlaneID: string) => { updatedTree: TreePlane[]; }; export declare const removePlaneFromTree: (tree: TreePlane[], pluridPlaneID: string) => TreePlane[];