/** @packageDocumentation * @module State */ import { XAndY } from "@bentley/geometry-core"; import { UserInfo } from "@bentley/itwin-client"; import { MenuItemProps } from "../shared/MenuItem"; import { ActionsUnion, DeepReadonly } from "./redux-ts"; /** PresentationSelectionScope holds the id and the localized label for a selection scope supported for a specific iModel. * Added to avoid an api-extract error caused by using SelectionScope. * @public */ export interface PresentationSelectionScope { id: string; label: string; } /** Definition of data added to Redux store to define cursor menu. If menuItems are empty the menu control is not displayed. * To close the menu clear the menuItems or pass in undefined as the CursorData. * @public */ export interface CursorMenuData { items: MenuItemProps[]; position: XAndY; childWindowId?: string; } /** Action Ids used by Redux and to send sync UI components. Typically used to refresh visibility or enable state of control. * Since these are also used as sync ids they should be in lowercase. * @public */ export declare enum SessionStateActionId { SetNumItemsSelected = "sessionstate:set-num-items-selected", SetAvailableSelectionScopes = "sessionstate:set-available-selection-scopes", SetSelectionScope = "sessionstate:set-selection-scope", SetActiveIModelId = "sessionstate:set-active-imodelid", SetIModelConnection = "sessionstate:set-imodel-connection", SetUserInfo = "sessionstate:set-user-info", SetDefaultIModelViewportControlId = "sessionstate:set-default-viewportid", SetDefaultViewId = "sessionstate:set-default-viewid", SetDefaultViewState = "sessionstate:set-default-view-state", UpdateCursorMenu = "sessionstate:update-cursor-menu" } /** The portion of state managed by the SessionStateReducer. * @public */ export interface SessionState { numItemsSelected: number; availableSelectionScopes: PresentationSelectionScope[]; activeSelectionScope: string; iModelId: string; defaultIModelViewportControlId: string | undefined; defaultViewId: string | undefined; defaultViewState: any | undefined; iModelConnection: any | undefined; userInfo: UserInfo | undefined; cursorMenuData: CursorMenuData | undefined; } /** An interface that allows redux connected object to dispatch changes to the SessionState reducer. * @beta */ export interface SessionStateActionsProps { setActiveIModelId: (typeof SessionStateActions.setActiveIModelId); setAvailableSelectionScopes: (typeof SessionStateActions.setAvailableSelectionScopes); setDefaultIModelViewportControlId: (typeof SessionStateActions.setDefaultIModelViewportControlId); setDefaultViewId: (typeof SessionStateActions.setDefaultViewId); setDefaultViewState: (typeof SessionStateActions.setDefaultViewState); setIModelConnection: (typeof SessionStateActions.setIModelConnection); setNumItemsSelected: (typeof SessionStateActions.setNumItemsSelected); setSelectionScope: (typeof SessionStateActions.setSelectionScope); setUserInfo: (typeof SessionStateActions.setUserInfo); updateCursorMenu: (typeof SessionStateActions.updateCursorMenu); } /** An object with a function that creates each SessionStateReducer that can be handled by our reducer. * @public */ export declare const SessionStateActions: { setUserInfo: (userInfo: UserInfo) => import("./redux-ts").ActionWithPayload>; setActiveIModelId: (iModelId: string) => import("./redux-ts").ActionWithPayload; setAvailableSelectionScopes: (availableSelectionScopes: PresentationSelectionScope[]) => import("./redux-ts").ActionWithPayload>; setDefaultIModelViewportControlId: (iModelViewportControlId: string) => import("./redux-ts").ActionWithPayload; setDefaultViewId: (viewId: string) => import("./redux-ts").ActionWithPayload; setDefaultViewState: (viewState: any) => import("./redux-ts").ActionWithPayload; setNumItemsSelected: (numSelected: number) => import("./redux-ts").ActionWithPayload; setIModelConnection: (iModelConnection: any) => import("./redux-ts").ActionWithPayload; setSelectionScope: (activeSelectionScope: string) => import("./redux-ts").ActionWithPayload; updateCursorMenu: (cursorMenuData: CursorMenuData) => import("./redux-ts").ActionWithPayload>; }; /** Object that contains available actions that modify SessionState. Parent control's props should * extend from SessionStateActionsProps before using this in Redux 'connect' function. * @beta */ export declare const sessionStateMapDispatchToProps: { setUserInfo: (userInfo: UserInfo) => import("./redux-ts").ActionWithPayload>; setActiveIModelId: (iModelId: string) => import("./redux-ts").ActionWithPayload; setAvailableSelectionScopes: (availableSelectionScopes: PresentationSelectionScope[]) => import("./redux-ts").ActionWithPayload>; setDefaultIModelViewportControlId: (iModelViewportControlId: string) => import("./redux-ts").ActionWithPayload; setDefaultViewId: (viewId: string) => import("./redux-ts").ActionWithPayload; setDefaultViewState: (viewState: any) => import("./redux-ts").ActionWithPayload; setNumItemsSelected: (numSelected: number) => import("./redux-ts").ActionWithPayload; setIModelConnection: (iModelConnection: any) => import("./redux-ts").ActionWithPayload; setSelectionScope: (activeSelectionScope: string) => import("./redux-ts").ActionWithPayload; updateCursorMenu: (cursorMenuData: CursorMenuData) => import("./redux-ts").ActionWithPayload>; }; /** Union of SessionState Redux actions * @public */ export declare type SessionStateActionsUnion = ActionsUnion; /** Handles actions to update SessionState. * @public */ export declare function SessionStateReducer(state: SessionState | undefined, action: SessionStateActionsUnion): DeepReadonly; //# sourceMappingURL=SessionState.d.ts.map