@teambit/lanes
Version:
109 lines (108 loc) • 4.9 kB
TypeScript
import React from 'react';
import type { RouteProps } from 'react-router-dom';
import type { Harmony, SlotRegistry } from '@teambit/harmony';
import { type LaneCompareProps as DefaultLaneCompareProps } from '@teambit/lanes.ui.compare.lane-compare';
import type { UiUI } from '@teambit/ui';
import type { NavigationSlot, RouteSlot } from '@teambit/ui-foundation.ui.react-router.slot-router';
import type { ScopeUI } from '@teambit/scope';
import type { WorkspaceUI } from '@teambit/workspace';
import type { ComponentUI } from '@teambit/component';
import { ComponentID } from '@teambit/component';
import type { MenuWidget, MenuWidgetSlot } from '@teambit/ui-foundation.ui.menu';
import type { LaneOverviewLine, LaneOverviewLineSlot } from '@teambit/lanes.ui.lane-overview';
import type { LanesNavPlugin, LanesOrderedNavigationSlot } from '@teambit/lanes.ui.menus.lanes-overview-menu';
import { LanesModel } from '@teambit/lanes.ui.models.lanes-model';
import type { IgnoreDerivingFromUrl, UseLanes } from '@teambit/lanes.hooks.use-lanes';
import { LanesProvider } from '@teambit/lanes.hooks.use-lanes';
import type { ComponentCompareUI } from '@teambit/component-compare';
import type { CommandBarUI } from '@teambit/command-bar';
export type LaneCompareProps = Partial<DefaultLaneCompareProps>;
export type LaneProviderIgnoreSlot = SlotRegistry<IgnoreDerivingFromUrl>;
export declare function useComponentFilters(): {
loading: boolean;
log?: undefined;
} | {
loading: boolean;
log: {
head: string;
};
};
export declare function useLaneComponentIdFromUrl(): ComponentID | undefined | null;
export declare function useComponentId(): string | undefined;
export declare class LanesUI {
private componentUI;
private componentCompareUI;
private routeSlot;
private navSlot;
private menuWidgetSlot;
/**
* overview line slot to add new lines beneath the overview section
*/
private overviewSlot;
private laneProviderIgnoreSlot;
private workspace?;
private scope?;
static dependencies: import("@teambit/harmony").Aspect[];
static runtime: import("@teambit/harmony").RuntimeDefinition;
static slots: (((registerFn: () => string) => SlotRegistry<RouteProps>) | ((registerFn: () => string) => SlotRegistry<MenuWidgetSlot>) | ((registerFn: () => string) => SlotRegistry<NavigationSlot>) | ((registerFn: () => string) => SlotRegistry<LaneProviderIgnoreSlot>))[];
constructor(componentUI: ComponentUI, componentCompareUI: ComponentCompareUI, routeSlot: RouteSlot, navSlot: LanesOrderedNavigationSlot, menuWidgetSlot: MenuWidgetSlot,
/**
* overview line slot to add new lines beneath the overview section
*/
overviewSlot: LaneOverviewLineSlot, laneProviderIgnoreSlot: LaneProviderIgnoreSlot, workspace?: WorkspaceUI | undefined, scope?: ScopeUI | undefined);
private readonly lanesHost;
private readonly hostAspect?;
private readonly host;
private registerHostAspectRoutes;
getLaneRoutes(): {
path: string;
children: React.JSX.Element;
}[];
overrideComputeLaneUrl(fn: () => {
prefix: string;
path: string;
getLaneIdFromPathname: typeof LanesModel.getLaneIdFromPathname;
getLaneUrl: typeof LanesModel.getLaneUrl;
getLaneComponentUrl: typeof LanesModel.getLaneComponentUrl;
}): void;
getLaneComponent(): React.JSX.Element;
getLaneComponentMenu(): React.JSX.Element;
getLaneOverview(): React.JSX.Element;
getLanesComparePage(): React.JSX.Element;
getMenuRoutes(): {
path: string;
children: React.JSX.Element;
}[];
getLanesOverviewMenu(): React.JSX.Element;
registerMenuWidget(...menuItems: MenuWidget[]): this;
registerLaneProviderIgnoreSlot(ignoreFn: IgnoreDerivingFromUrl): this;
private registerLanesRoutes;
private registerRoutes;
getLanesSwitcher(): React.JSX.Element;
getLanesProvider(): typeof LanesProvider;
getUseLanes(): UseLanes;
private registerLanesDropdown;
private renderContext;
registerRoute(route: RouteProps): this;
/**
* register a new line beneath the lane overview section.
*/
registerOverviewLine(...lines: LaneOverviewLine[]): this;
registerNavigation(routes: LanesNavPlugin[]): void;
getLaneCompare: (props: LaneCompareProps) => React.JSX.Element | null;
static provider([uiUi, componentUI, workspaceUi, scopeUi, componentCompareUI, commandBarUI]: [
UiUI,
ComponentUI,
WorkspaceUI,
ScopeUI,
ComponentCompareUI,
CommandBarUI
], _: any, [routeSlot, overviewSlot, navSlot, menuWidgetSlot, laneProviderIgnoreSlot]: [
RouteSlot,
LaneOverviewLineSlot,
LanesOrderedNavigationSlot,
MenuWidgetSlot,
LaneProviderIgnoreSlot
], harmony: Harmony): Promise<LanesUI>;
}
export default LanesUI;