@equinor/echo-framework 0.20.21 → 0.20.23-beta-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/index.cjs.js +1 -1
  2. package/package.json +1 -1
  3. package/src/index.d.ts +10 -6
  4. package/src/lib/feature/globalSelection/components/SelectionActionBar.d.ts +7 -0
  5. package/src/lib/feature/globalSelection/globalSelection.api.d.ts +82 -97
  6. package/src/lib/feature/globalSelection/globalSelectionStore/globalSelectionStore.utils.d.ts +1 -1
  7. package/src/lib/feature/globalSelection/hooks/useIsInGlobalSelection.d.ts +8 -0
  8. package/src/lib/feature/globalSelection/hooks/useSelectionCategoriesByGroupId.d.ts +11 -0
  9. package/src/lib/feature/globalSelection/index.d.ts +4 -1
  10. package/src/lib/feature/globalSelection/selectionMenu/hooks/{useAllItemsHiddenByUser.d.ts → useIsAllIGlobalSelectionItemsHidden.d.ts} +9 -2
  11. package/src/lib/feature/globalSelection/selectionMenu/hooks/useSelectionMenuGroups.d.ts +7 -0
  12. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.d.ts +37 -0
  13. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.types.d.ts +84 -0
  14. package/src/lib/feature/globalSelection/selectionMenu/selectionTreeStore/selectionTree.store.utils.d.ts +53 -0
  15. package/src/lib/feature/legacyLegend/legend.d.ts +1 -1
  16. package/src/lib/feature/legend/components/BasicLegendRenderer.d.ts +6 -0
  17. package/src/lib/feature/legend/components/LegendList.d.ts +5 -0
  18. package/src/lib/feature/legend/components/basicLegendRenderer.logic.d.ts +5 -0
  19. package/src/lib/feature/legend/components/pdfMarkers/PositionalItem.d.ts +8 -0
  20. package/src/lib/feature/legend/components/pdfMarkers/PositionalLegendMarkers.d.ts +24 -0
  21. package/src/lib/feature/legend/components/pdfMarkers/subComponents/LegendColoredMarkerIcon.d.ts +11 -0
  22. package/src/lib/feature/legend/components/pdfMarkers/subComponents/LegendMarkersRendererWithPopover.d.ts +13 -0
  23. package/src/lib/feature/legend/components/pdfMarkers/subComponents/MultipleMarkersByLegends.d.ts +21 -0
  24. package/src/lib/feature/legend/components/pdfMarkers/subComponents/iconPositionTransform.d.ts +18 -0
  25. package/src/lib/feature/legend/hooks/useLegendMarkers.d.ts +19 -0
  26. package/src/lib/feature/legend/index.d.ts +7 -0
  27. package/src/lib/feature/legend/legendFacade.d.ts +29 -0
  28. package/src/lib/feature/legend/legendStore.d.ts +43 -0
  29. package/src/lib/feature/legend/legendStrategies/legendCollections.d.ts +4 -0
  30. package/src/lib/feature/legend/legendStrategies/workOrderStrategy/WorkOrderLegend.d.ts +1 -0
  31. package/src/lib/feature/legend/legendUpdater.d.ts +2 -0
  32. package/src/lib/feature/legend/legendVisibleDataStore.d.ts +61 -0
  33. package/src/lib/feature/legend/types/legendMarkerBadge.type.d.ts +11 -0
  34. package/src/lib/feature/legend/types/legendStrategy.type.d.ts +11 -0
  35. package/src/lib/feature/legend/types/legendType.d.ts +15 -0
  36. package/src/lib/feature/globalSelection/selectionMenu/hooks/useSelectionMenuLists.d.ts +0 -7
  37. package/src/lib/feature/globalSelection/selectionMenu/selectionMenuStore/selectionMenu.store.d.ts +0 -43
  38. package/src/lib/feature/globalSelection/selectionMenu/selectionMenuStore/selectionMenu.store.types.d.ts +0 -52
  39. package/src/lib/feature/globalSelection/selectionMenu/selectionMenuStore/selectionMenu.store.utils.d.ts +0 -56
@@ -0,0 +1,21 @@
1
+ import React from 'react';
2
+ import { LegendDataId } from '../../../types/legendType';
3
+ interface MultipleMarkersByLegendsProps {
4
+ itemId: LegendDataId;
5
+ hasPointer: boolean;
6
+ popoverOffset: string;
7
+ setOpenItem: (value: PopoverContent | undefined) => void;
8
+ activeItem: ActiveItem | undefined;
9
+ }
10
+ export interface PopoverContent {
11
+ elements: JSX.Element[];
12
+ popoverOffset: string;
13
+ activeItem: ActiveItem;
14
+ }
15
+ interface ActiveItem {
16
+ itemId: LegendDataId;
17
+ legendId: string;
18
+ }
19
+ export declare const MultipleMarkersByLegendsComponent: React.FC<MultipleMarkersByLegendsProps>;
20
+ export declare const MultipleMarkersByLegends: React.NamedExoticComponent<MultipleMarkersByLegendsProps>;
21
+ export {};
@@ -0,0 +1,18 @@
1
+ import { Point } from '@equinor/echo-utils';
2
+ export declare const calculateIconScale: (currentPageScale: number) => number;
3
+ export declare function calculatePopoverStyling(args: {
4
+ pdfZoom: number;
5
+ hasPointer: boolean;
6
+ position: Point;
7
+ pdfRotation: number;
8
+ currentPageScale: number;
9
+ markerHeight: number;
10
+ }): string;
11
+ export declare function iconPositionTransform(args: {
12
+ position: Point;
13
+ pdfRotation: number;
14
+ currentPageScale: number;
15
+ isMobileDevice: boolean;
16
+ pdfZoom: number;
17
+ hasPointer: boolean;
18
+ }): string;
@@ -0,0 +1,19 @@
1
+ import { Badge, Marker } from '../types/legendMarkerBadge.type';
2
+ import { LegendDataId } from '../types/legendType';
3
+ /**
4
+ * Returns the markers for the given legendId and itemId.
5
+ */
6
+ export declare function useLegendMarker(args: {
7
+ legendId: string;
8
+ itemId: LegendDataId;
9
+ }): Marker[];
10
+ /**
11
+ * Returns all unique markers for the given legendId, determined by unique markerKey (title + color).
12
+ */
13
+ export declare function useLegendUniqueMarkers(args: {
14
+ legendId: string;
15
+ }): Marker[];
16
+ /**
17
+ * Returns all unique badges for the given legendId, determined by unique title + color.
18
+ */
19
+ export declare function useLegendUniqueBadges(legendId: string): Badge[];
@@ -0,0 +1,7 @@
1
+ import './legendStrategies/workOrderStrategy/WorkOrderLegend';
2
+ export { LegendList as LegendsRenderer } from './components/LegendList';
3
+ export { PositionalItem } from './components/pdfMarkers/PositionalItem';
4
+ export { PositionalLegendMarkers } from './components/pdfMarkers/PositionalLegendMarkers';
5
+ export { legendFacade } from './legendFacade';
6
+ export type { Badge, Marker } from './types/legendMarkerBadge.type';
7
+ export type { LegendStrategy } from './types/legendStrategy.type';
@@ -0,0 +1,29 @@
1
+ import { legendSnapShot, useAllLegends, useLegendById } from './legendStore';
2
+ import { getLegendStrategy, injectLegendStrategy } from './legendStrategies/legendCollections';
3
+ import { legendVisibleDataSnapshot, useAddVisibleItems } from './legendVisibleDataStore';
4
+ export declare const legendFacade: Readonly<{
5
+ injectLegendStrategy: typeof injectLegendStrategy;
6
+ useVisibleDataStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<import("./legendVisibleDataStore").LegendVisibleData & import("./legendVisibleDataStore").LegendVisibleDataStoreActions>, "setState"> & {
7
+ setState<A extends string | {
8
+ type: string;
9
+ }>(partial: (import("./legendVisibleDataStore").LegendVisibleData & import("./legendVisibleDataStore").LegendVisibleDataStoreActions) | Partial<import("./legendVisibleDataStore").LegendVisibleData & import("./legendVisibleDataStore").LegendVisibleDataStoreActions> | ((state: import("./legendVisibleDataStore").LegendVisibleData & import("./legendVisibleDataStore").LegendVisibleDataStoreActions) => (import("./legendVisibleDataStore").LegendVisibleData & import("./legendVisibleDataStore").LegendVisibleDataStoreActions) | Partial<import("./legendVisibleDataStore").LegendVisibleData & import("./legendVisibleDataStore").LegendVisibleDataStoreActions>), replace?: boolean | undefined, action?: A | undefined): void;
10
+ }, "subscribe"> & {
11
+ subscribe: {
12
+ (listener: (selectedState: import("./legendVisibleDataStore").LegendVisibleData & import("./legendVisibleDataStore").LegendVisibleDataStoreActions, previousSelectedState: import("./legendVisibleDataStore").LegendVisibleData & import("./legendVisibleDataStore").LegendVisibleDataStoreActions) => void): () => void;
13
+ <U>(selector: (state: import("./legendVisibleDataStore").LegendVisibleData & import("./legendVisibleDataStore").LegendVisibleDataStoreActions) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
14
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
15
+ fireImmediately?: boolean;
16
+ } | undefined): () => void;
17
+ };
18
+ }, "setState"> & {
19
+ setState(nextStateOrUpdater: (import("./legendVisibleDataStore").LegendVisibleData & import("./legendVisibleDataStore").LegendVisibleDataStoreActions) | Partial<import("./legendVisibleDataStore").LegendVisibleData & import("./legendVisibleDataStore").LegendVisibleDataStoreActions> | ((state: import("immer").WritableDraft<import("./legendVisibleDataStore").LegendVisibleData & import("./legendVisibleDataStore").LegendVisibleDataStoreActions>) => void), shouldReplace?: boolean | undefined, action?: string | {
20
+ type: string;
21
+ } | undefined): void;
22
+ }>;
23
+ visibleDataSnapshot: typeof legendVisibleDataSnapshot;
24
+ storeSnapshot: typeof legendSnapShot;
25
+ getStrategy: typeof getLegendStrategy;
26
+ useLegendById: typeof useLegendById;
27
+ useAllLegends: typeof useAllLegends;
28
+ useAddVisibleItems: typeof useAddVisibleItems;
29
+ }>;
@@ -0,0 +1,43 @@
1
+ import { PersistOptions } from 'zustand/middleware';
2
+ import { LegendState } from './types/legendType';
3
+ interface LegendStoreData {
4
+ legends: Record<string, LegendState>;
5
+ }
6
+ interface LegendStoreActions {
7
+ updateLegend: (legendId: string, updates: Partial<LegendState>) => void;
8
+ setHiddenMarker: (legendId: string, marker: string, isHidden: boolean) => void;
9
+ setHiddenBadge: (legendId: string, badge: string, isHidden: boolean) => void;
10
+ getLegendById: (legendId: string) => LegendState | undefined;
11
+ }
12
+ type LegendStore = LegendStoreData & LegendStoreActions;
13
+ export declare const useLegendStore: import("zustand").UseBoundStore<Omit<Omit<Omit<Omit<import("zustand").StoreApi<LegendStore>, "setState"> & {
14
+ setState<A extends string | {
15
+ type: string;
16
+ }>(partial: LegendStore | Partial<LegendStore> | ((state: LegendStore) => LegendStore | Partial<LegendStore>), replace?: boolean | undefined, action?: A | undefined): void;
17
+ }, "subscribe"> & {
18
+ subscribe: {
19
+ (listener: (selectedState: LegendStore, previousSelectedState: LegendStore) => void): () => void;
20
+ <U>(selector: (state: LegendStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
21
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
22
+ fireImmediately?: boolean;
23
+ } | undefined): () => void;
24
+ };
25
+ }, "persist"> & {
26
+ persist: {
27
+ setOptions: (options: Partial<PersistOptions<LegendStore, LegendStore>>) => void;
28
+ clearStorage: () => void;
29
+ rehydrate: () => Promise<void> | void;
30
+ hasHydrated: () => boolean;
31
+ onHydrate: (fn: (state: LegendStore) => void) => () => void;
32
+ onFinishHydration: (fn: (state: LegendStore) => void) => () => void;
33
+ getOptions: () => Partial<PersistOptions<LegendStore, LegendStore>>;
34
+ };
35
+ }, "setState"> & {
36
+ setState(nextStateOrUpdater: LegendStore | Partial<LegendStore> | ((state: import("immer").WritableDraft<LegendStore>) => void), shouldReplace?: boolean | undefined, action?: string | {
37
+ type: string;
38
+ } | undefined): void;
39
+ }>;
40
+ export declare function useLegendById(legendId: string): LegendState;
41
+ export declare function useAllLegends(): LegendState[];
42
+ export declare function legendSnapShot(): LegendStore;
43
+ export {};
@@ -0,0 +1,4 @@
1
+ import { LegendStrategy } from '../types/legendStrategy.type';
2
+ import { LegendState } from '../types/legendType';
3
+ export declare function injectLegendStrategy(strategy: LegendStrategy, properties: Partial<LegendState>): void;
4
+ export declare function getLegendStrategy(strategyTypeName: string): LegendStrategy;
@@ -0,0 +1,2 @@
1
+ export declare function subscribeToLegendDataChanged(): void;
2
+ export declare const sleep: (ms: number) => Promise<unknown>;
@@ -0,0 +1,61 @@
1
+ import { LegendDataId, LegendEquipmentId, LegendTagId } from './types/legendType';
2
+ /**
3
+ * Maps (string) keyword to the data type.
4
+ * We don't have any other sources so far, pdf has TagNo and EquipmentId (ecm)
5
+ */
6
+ type KnownDataTypes = {
7
+ Tag: LegendTagId;
8
+ Equipment: LegendEquipmentId;
9
+ };
10
+ type KnownDataTypeKeys = keyof KnownDataTypes;
11
+ type ResolvedDataType<T extends KnownDataTypeKeys> = KnownDataTypes[T];
12
+ /**
13
+ * Data structure:
14
+ * Data
15
+ * - Tag
16
+ * - key1: [data1, data2, ...]
17
+ * - key2: [data1, data2, ...]
18
+ * - Equipment
19
+ * - key1: [data1, data2, ...]
20
+ * ...
21
+ */
22
+ export interface LegendVisibleData {
23
+ data: LegendVisibleDataState;
24
+ }
25
+ type LegendVisibleDataState = {
26
+ [K in KnownDataTypeKeys]: {
27
+ [key: string]: ResolvedDataType<K>[];
28
+ };
29
+ };
30
+ export interface LegendVisibleDataStoreActions {
31
+ addData: <T extends KnownDataTypeKeys>(type: T, key: string, value: ResolvedDataType<T>[]) => void;
32
+ removeData: (key: string) => void;
33
+ getData: <T extends KnownDataTypeKeys>(type: T) => ResolvedDataType<T>[];
34
+ useDataByType: <T extends KnownDataTypeKeys>(type: T) => ResolvedDataType<T>[];
35
+ getAll(): LegendDataId[];
36
+ }
37
+ type LegendVisibleDataStore = LegendVisibleData & LegendVisibleDataStoreActions;
38
+ export declare const useLegendVisibleDataStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<LegendVisibleDataStore>, "setState"> & {
39
+ setState<A extends string | {
40
+ type: string;
41
+ }>(partial: LegendVisibleDataStore | Partial<LegendVisibleDataStore> | ((state: LegendVisibleDataStore) => LegendVisibleDataStore | Partial<LegendVisibleDataStore>), replace?: boolean | undefined, action?: A | undefined): void;
42
+ }, "subscribe"> & {
43
+ subscribe: {
44
+ (listener: (selectedState: LegendVisibleDataStore, previousSelectedState: LegendVisibleDataStore) => void): () => void;
45
+ <U>(selector: (state: LegendVisibleDataStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
46
+ equalityFn?: ((a: U, b: U) => boolean) | undefined;
47
+ fireImmediately?: boolean;
48
+ } | undefined): () => void;
49
+ };
50
+ }, "setState"> & {
51
+ setState(nextStateOrUpdater: LegendVisibleDataStore | Partial<LegendVisibleDataStore> | ((state: import("immer").WritableDraft<LegendVisibleDataStore>) => void), shouldReplace?: boolean | undefined, action?: string | {
52
+ type: string;
53
+ } | undefined): void;
54
+ }>;
55
+ export declare function legendVisibleDataSnapshot(): LegendVisibleDataStore;
56
+ /**
57
+ * Visible items are all items on screen that should be affected by the legend.
58
+ * @returns A function for adding visible items by type and key, which is automatically removed when the component unmounts.
59
+ */
60
+ export declare function useAddVisibleItems(): <T extends KnownDataTypeKeys>(type: T, key: string, value: ResolvedDataType<T>[]) => void;
61
+ export {};
@@ -0,0 +1,11 @@
1
+ export interface Marker {
2
+ getTitle: () => string;
3
+ getColor: () => string;
4
+ getIcon: () => string;
5
+ badges: Badge[];
6
+ }
7
+ export declare function markerKey(marker: Marker): string;
8
+ export interface Badge {
9
+ getColor: () => string;
10
+ getTitle: () => string;
11
+ }
@@ -0,0 +1,11 @@
1
+ import { Marker } from './legendMarkerBadge.type';
2
+ import { LegendDataId } from './legendType';
3
+ export interface LegendStrategy {
4
+ legendId: string;
5
+ useMarkers: (itemIds: ReadonlyArray<LegendDataId>) => Marker[];
6
+ popoverContent: (itemId: LegendDataId) => React.JSX.Element[];
7
+ fetchData?: (visibleItemIds: ReadonlyArray<LegendDataId>) => Promise<void>;
8
+ markerOptions?: string[];
9
+ badgeOptions?: string[];
10
+ customLegendUi?: () => React.JSX.Element;
11
+ }
@@ -0,0 +1,15 @@
1
+ import { GlobalSelectionTypes } from '../../globalSelection';
2
+ export interface LegendState {
3
+ legendId: string;
4
+ isEnabled: boolean;
5
+ isLoading: boolean;
6
+ hiddenMarkers: string[];
7
+ hiddenBadges: string[];
8
+ selectedMarkerOption: string;
9
+ selectedBadgeOption: string;
10
+ isExpanded: boolean;
11
+ }
12
+ export type LegendTagId = GlobalSelectionTypes.TagId;
13
+ export type LegendEquipmentId = GlobalSelectionTypes.EquipmentId;
14
+ export type LegendWorkOrderId = GlobalSelectionTypes.WorkOrderId;
15
+ export type LegendDataId = LegendTagId | LegendEquipmentId | LegendWorkOrderId;
@@ -1,7 +0,0 @@
1
- import { SelectionMenuList } from '../selectionMenuStore/selectionMenu.store.types';
2
- /**
3
- * Custom hook to get the selection menu lists from the selection menu store, displayed in the left selection panel.
4
- *
5
- * @returns {SelectionMenuList[]} - An array of selection menu lists.
6
- */
7
- export declare function useSelectionMenuLists(): SelectionMenuList[];
@@ -1,43 +0,0 @@
1
- import { SelectionMenuStore } from './selectionMenu.store.types';
2
- export declare enum SelectionMenuDefaultListIds {
3
- TagList = "DEFAULT_TAG_LIST_ID",
4
- WorkOrderList = "DEFAULT_WORK_ORDER_LIST_ID"
5
- }
6
- /**
7
- * Store for the selection menu, in a left panel.
8
- *
9
- * Stores the hierachry, tree structure of the items in Global Selection.
10
- * With this, it is in charge of:
11
- * - tracking which item belongs to which list
12
- * - adding items to global selection
13
- * - remove items from global selection
14
- * - update items (visibility, removal etc.) via list ids
15
- * - maintaining the global selection store based on the changes in the items, in the selection menu panel
16
- *
17
- * You shouldn't use this store directly in any code, unless you have very special reason to do so.
18
- *
19
- * For accessing and using global selection features, use the globalSelectionApi from echo-framework.
20
- */
21
- export declare const useSelectionMenuStore: import("zustand").UseBoundStore<Omit<Omit<Omit<import("zustand").StoreApi<SelectionMenuStore>, "setState"> & {
22
- setState<A extends string | {
23
- type: string;
24
- }>(partial: SelectionMenuStore | Partial<SelectionMenuStore> | ((state: SelectionMenuStore) => SelectionMenuStore | Partial<SelectionMenuStore>), replace?: boolean | undefined, action?: A | undefined): void;
25
- }, "subscribe"> & {
26
- subscribe: {
27
- (listener: (selectedState: SelectionMenuStore, previousSelectedState: SelectionMenuStore) => void): () => void;
28
- <U>(selector: (state: SelectionMenuStore) => U, listener: (selectedState: U, previousSelectedState: U) => void, options?: {
29
- equalityFn?: ((a: U, b: U) => boolean) | undefined;
30
- fireImmediately?: boolean;
31
- } | undefined): () => void;
32
- };
33
- }, "setState"> & {
34
- setState(nextStateOrUpdater: SelectionMenuStore | Partial<SelectionMenuStore> | ((state: import("immer").WritableDraft<SelectionMenuStore>) => void), shouldReplace?: boolean | undefined, action?: string | {
35
- type: string;
36
- } | undefined): void;
37
- }>;
38
- /**
39
- * Get a snapshot of the current selection menu store state.
40
- *
41
- * Selection menu: left panel, which holds items from global selection.
42
- */
43
- export declare function getSelectionMenuStoreSnapshot(): SelectionMenuStore;
@@ -1,52 +0,0 @@
1
- import { ResultArray, TagSummaryDto } from '@equinor/echo-search';
2
- import { Guid } from '@equinor/echo-utils';
3
- import { GlobalSelectionItemType, GlobalSelectionTypes, OptimizedWorkOrderDto } from '../../globalSelectionStore/globalSelectionStore.types';
4
- import { SelectionMenuDefaultListIds } from './selectionMenu.store';
5
- export type SelectionMenuItem = SelectionMenuTag | SelectionMenuWorkOrder | SelectionMenuEquipment;
6
- export interface SelectionMenuTag {
7
- id: GlobalSelectionTypes.TagId;
8
- type: GlobalSelectionItemType.Tag;
9
- }
10
- export interface SelectionMenuWorkOrder {
11
- id: GlobalSelectionTypes.WorkOrderId;
12
- type: GlobalSelectionItemType.WorkOrder;
13
- }
14
- export interface SelectionMenuEquipment {
15
- id: GlobalSelectionTypes.EquipmentId;
16
- type: GlobalSelectionItemType.Equipment;
17
- }
18
- export type SelectionMenuList = SelectionMenuWithItems | SelectionMenuWithSubLists;
19
- interface SelectionMenuBase {
20
- id: Guid | SelectionMenuDefaultListIds;
21
- label: string;
22
- }
23
- interface SelectionMenuWithItems extends SelectionMenuBase {
24
- items: SelectionMenuItem[];
25
- subLists?: never;
26
- }
27
- interface SelectionMenuWithSubLists extends SelectionMenuBase {
28
- subLists: SelectionMenuWithItems[];
29
- items?: never;
30
- }
31
- export interface SelectionMenuStore {
32
- lists: SelectionMenuList[];
33
- addTags: (args: {
34
- listId?: string;
35
- itemIds: Readonly<GlobalSelectionTypes.TagId[]>;
36
- }) => Promise<ResultArray<TagSummaryDto>[]>;
37
- addWorkOrders: (args: {
38
- listId?: string;
39
- items: Readonly<Readonly<OptimizedWorkOrderDto>[]>;
40
- }) => void;
41
- addList: (args: SelectionMenuList) => void;
42
- removeItemsByListId: (args: {
43
- listId: string;
44
- itemIds: GlobalSelectionTypes.ItemId[];
45
- }) => void;
46
- setVisibilityByListId: (args: {
47
- listId: string;
48
- isVisible: boolean;
49
- }) => void;
50
- resetState: () => void;
51
- }
52
- export {};
@@ -1,56 +0,0 @@
1
- import { GlobalSelectionTypes } from '../../globalSelectionStore/globalSelectionStore.types';
2
- import { SelectionMenuList } from './selectionMenu.store.types';
3
- /**
4
- * Finds a selection list by its ID from a given list of selection menu lists.
5
- * If the list is not found at the top level, it searches within the sublists of each top-level list.
6
- *
7
- * @param args - The arguments object.
8
- * @param {string} args.listId - The ID of the selection list to find.
9
- * @param {SelectionMenuList[]} args.lists - An optional array of selection menu lists to search within.
10
- * If not provided, the function will use the lists from the selection menu store state.
11
- * If you want to alter the store state, you should provide the lists as an argument.
12
- * @returns {SelectionMenuList | undefined} The selection menu list with the specified ID, or `undefined` if not found.
13
- */
14
- export declare function findSelectionListById(args: {
15
- listId: string;
16
- lists: SelectionMenuList[];
17
- }): SelectionMenuList | undefined;
18
- /**
19
- * Checks if a given item ID is present in a specified list.
20
- *
21
- * @param args - An object containing the item ID and the list ID.
22
- * @param {GlobalSelectionTypes.ItemId} args.itemId - The ID of the item to check for.
23
- * @param {string} args.listId - The ID of the list to search within.
24
- * @param {SelectionMenuList[]} args.lists - The selection menu lists where you would like to search for the given item.
25
- * @returns {boolean} A boolean indicating whether the item ID is found in the list.
26
- */
27
- export declare function isItemIdInList(args: {
28
- itemId: GlobalSelectionTypes.ItemId;
29
- listId: string;
30
- lists: SelectionMenuList[];
31
- }): boolean;
32
- /**
33
- * Checks if a given item ID is present in the selection lists.
34
- *
35
- * @param args - An object containing the item ID to check.
36
- * @param {GlobalSelectionTypes.ItemId} args.itemId - The item ID to check for presence in the selection lists.
37
- * @param {SelectionMenuList[]} args.lists - The selection menu lists where you would like to search for the given item.
38
- * @returns {boolean} A boolean indicating whether the item ID is present in the selection lists.
39
- */
40
- export declare function isItemIdInTheSelection(args: {
41
- itemId?: GlobalSelectionTypes.ItemId;
42
- lists: SelectionMenuList[];
43
- }): boolean;
44
- /**
45
- * Retrieves an array of itemIds that were not found in the selection menu.
46
- *
47
- * @param {Object} args - The arguments containing the list and itemIds to check.
48
- * @param {SelectionMenuList[]} args.list - The list of SelectionMenuList objects to search through.
49
- * @param {GlobalSelectionTypes.ItemId[]} args.itemIds - An array of ItemId objects to check for presence in the list.
50
- * @returns {string[]} An array of itemId strings that correspond to counts of 0 in the selection menu.
51
- * itemIds object values are concatenated via '-' char
52
- */
53
- export declare function itemsNotFoundInSelectionMenu(args: {
54
- lists: SelectionMenuList[];
55
- itemIds: GlobalSelectionTypes.ItemId[];
56
- }): string[];