@trackunit/react-core-contexts-api 1.8.74 → 1.8.79

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/README.md +3 -6
  2. package/index.cjs.js +136 -147
  3. package/index.esm.js +102 -138
  4. package/package.json +4 -6
  5. package/src/analytics/AnalyticsContext.d.ts +3 -0
  6. package/src/assetSorting/AssetSortingContext.d.ts +7 -0
  7. package/src/confirmationDialog/ConfirmationDialogContext.d.ts +12 -0
  8. package/src/environment/EnvironmentContext.d.ts +12 -0
  9. package/src/errorHandling/ErrorHandlingContext.d.ts +3 -0
  10. package/src/exportData/ExportDataContext.d.ts +3 -0
  11. package/src/featureFlags/FeatureFlagContext.d.ts +13 -0
  12. package/src/filterBar/FilterBarContext.d.ts +12 -0
  13. package/src/index.d.ts +18 -16
  14. package/src/modalDialog/ModalDialogContext.d.ts +12 -0
  15. package/src/navigation/NavigationContext.d.ts +12 -0
  16. package/src/oemBranding/OemBrandingContext.d.ts +12 -0
  17. package/src/subscription/UserSubscriptionContext.d.ts +12 -0
  18. package/src/timeRange/TimeRangeContext.d.ts +12 -0
  19. package/src/toast/ToastContext.d.ts +12 -0
  20. package/src/token/TokenContext.d.ts +12 -0
  21. package/src/user/CurrentUserContext.d.ts +12 -0
  22. package/src/user/CurrentUserPreferenceContext.d.ts +12 -0
  23. package/src/widgetConfig/WidgetConfigContext.d.ts +12 -0
  24. package/src/IUserPreferencesContext.d.ts +0 -24
  25. package/src/analyticsContext.d.ts +0 -79
  26. package/src/assetSortingContext.d.ts +0 -52
  27. package/src/confirmationDialogContext.d.ts +0 -32
  28. package/src/currentUserContext.d.ts +0 -62
  29. package/src/environmentContext.d.ts +0 -33
  30. package/src/errorHandlingContext.d.ts +0 -26
  31. package/src/filterBarContext.d.ts +0 -37
  32. package/src/modalDialogContext.d.ts +0 -13
  33. package/src/navigationContext.d.ts +0 -81
  34. package/src/oemBrandingContext.d.ts +0 -36
  35. package/src/timeRangeContext.d.ts +0 -34
  36. package/src/toastContext.d.ts +0 -53
  37. package/src/tokenContext.d.ts +0 -6
  38. package/src/userSubscriptionContext.d.ts +0 -51
  39. package/src/widgetConfigContext.d.ts +0 -61
@@ -0,0 +1,13 @@
1
+ import { FeatureFlagState } from "@trackunit/iris-app-runtime-core-api";
2
+ import { ReactNode } from "react";
3
+ declare const FeatureFlagContext: import("react").Context<FeatureFlagState | null>;
4
+ export interface FeatureFlagContextProviderProps {
5
+ children?: ReactNode;
6
+ /** Override the value of the FeatureFlag context. Useful for testing purposes. */
7
+ value: FeatureFlagState;
8
+ }
9
+ /**
10
+ * This is a provider for the FeatureFlagContext.
11
+ */
12
+ export declare const FeatureFlagContextProvider: (props: FeatureFlagContextProviderProps) => import("react/jsx-runtime").JSX.Element;
13
+ export { FeatureFlagContext };
@@ -0,0 +1,12 @@
1
+ import { FilterBarContext as FilterBarContextType } from "@trackunit/iris-app-runtime-core-api";
2
+ import { ReactNode } from "react";
3
+ declare const FilterBarContext: import("react").Context<FilterBarContextType | null>;
4
+ interface FilterBarContextProps {
5
+ value: FilterBarContextType;
6
+ children?: ReactNode;
7
+ }
8
+ /**
9
+ * This is a provider for the FilterBarContext.
10
+ */
11
+ export declare const FilterBarProvider: (props: FilterBarContextProps) => import("react/jsx-runtime").JSX.Element;
12
+ export { FilterBarContext };
package/src/index.d.ts CHANGED
@@ -1,16 +1,18 @@
1
- export * from "./analyticsContext";
2
- export * from "./assetSortingContext";
3
- export * from "./confirmationDialogContext";
4
- export * from "./currentUserContext";
5
- export * from "./environmentContext";
6
- export * from "./errorHandlingContext";
7
- export * from "./filterBarContext";
8
- export * from "./IUserPreferencesContext";
9
- export * from "./modalDialogContext";
10
- export * from "./navigationContext";
11
- export * from "./oemBrandingContext";
12
- export * from "./timeRangeContext";
13
- export * from "./toastContext";
14
- export * from "./tokenContext";
15
- export * from "./userSubscriptionContext";
16
- export * from "./widgetConfigContext";
1
+ export * from "./analytics/AnalyticsContext";
2
+ export * from "./assetSorting/AssetSortingContext";
3
+ export * from "./confirmationDialog/ConfirmationDialogContext";
4
+ export * from "./environment/EnvironmentContext";
5
+ export * from "./errorHandling/ErrorHandlingContext";
6
+ export * from "./exportData/ExportDataContext";
7
+ export * from "./featureFlags/FeatureFlagContext";
8
+ export * from "./filterBar/FilterBarContext";
9
+ export * from "./modalDialog/ModalDialogContext";
10
+ export * from "./navigation/NavigationContext";
11
+ export * from "./oemBranding/OemBrandingContext";
12
+ export * from "./subscription/UserSubscriptionContext";
13
+ export * from "./timeRange/TimeRangeContext";
14
+ export * from "./toast/ToastContext";
15
+ export * from "./token/TokenContext";
16
+ export * from "./user/CurrentUserContext";
17
+ export * from "./user/CurrentUserPreferenceContext";
18
+ export * from "./widgetConfig/WidgetConfigContext";
@@ -0,0 +1,12 @@
1
+ import { ModalDialogRuntimeApi } from "@trackunit/iris-app-runtime-core-api";
2
+ import { ReactNode } from "react";
3
+ declare const ModalDialogContext: import("react").Context<ModalDialogRuntimeApi | null>;
4
+ export interface ModalDialogProviderProps {
5
+ value: ModalDialogRuntimeApi;
6
+ children: ReactNode;
7
+ }
8
+ /**
9
+ * This is a provider for the ModalDialogContext.
10
+ */
11
+ export declare const ModalDialogContextProvider: (props: ModalDialogProviderProps) => import("react/jsx-runtime").JSX.Element;
12
+ export { ModalDialogContext };
@@ -0,0 +1,12 @@
1
+ import { NavigationRuntimeApi } from "@trackunit/iris-app-runtime-core-api";
2
+ import { ReactNode } from "react";
3
+ declare const NavigationContext: import("react").Context<NavigationRuntimeApi | null>;
4
+ interface NavigationContextProviderProps {
5
+ value: NavigationRuntimeApi;
6
+ children?: ReactNode;
7
+ }
8
+ /**
9
+ * This is a provider for the NavigationContext.
10
+ */
11
+ export declare const NavigationContextProvider: (props: NavigationContextProviderProps) => import("react/jsx-runtime").JSX.Element;
12
+ export { NavigationContext };
@@ -0,0 +1,12 @@
1
+ import { OemBrandingRuntimeApi } from "@trackunit/iris-app-runtime-core-api";
2
+ import { ReactNode } from "react";
3
+ declare const OEMBrandingService: import("react").Context<OemBrandingRuntimeApi | null>;
4
+ interface OemBrandingContextProviderProps {
5
+ value: OemBrandingRuntimeApi;
6
+ children?: ReactNode;
7
+ }
8
+ /**
9
+ * This is a provider for the OemBrandingContext.
10
+ */
11
+ export declare const OemBrandingContextProvider: (props: OemBrandingContextProviderProps) => import("react/jsx-runtime").JSX.Element;
12
+ export { OEMBrandingService as OemBrandingContext };
@@ -0,0 +1,12 @@
1
+ import { UserSubscription } from "@trackunit/iris-app-runtime-core-api";
2
+ import { ReactNode } from "react";
3
+ declare const UserSubscriptionContext: import("react").Context<UserSubscription | null>;
4
+ interface UserSubscriptionProviderProps {
5
+ value: UserSubscription;
6
+ children?: ReactNode;
7
+ }
8
+ /**
9
+ * This is a provider for the UserSubscriptionContext.
10
+ */
11
+ export declare const UserSubscriptionProvider: (props: UserSubscriptionProviderProps) => import("react/jsx-runtime").JSX.Element;
12
+ export { UserSubscriptionContext };
@@ -0,0 +1,12 @@
1
+ import { TimeRangeContext as TimeRangeContextType } from "@trackunit/iris-app-runtime-core-api";
2
+ import { ReactNode } from "react";
3
+ declare const TimeRangeContext: import("react").Context<TimeRangeContextType | null>;
4
+ interface TimeRangeContextProps {
5
+ value: TimeRangeContextType;
6
+ children?: ReactNode;
7
+ }
8
+ /**
9
+ * This is a provider for the TimeRangeContext.
10
+ */
11
+ export declare const TimeRangeProvider: (props: TimeRangeContextProps) => import("react/jsx-runtime").JSX.Element;
12
+ export { TimeRangeContext };
@@ -0,0 +1,12 @@
1
+ import { IToastContext } from "@trackunit/iris-app-runtime-core-api";
2
+ import { ReactNode } from "react";
3
+ declare const ToastContext: import("react").Context<IToastContext | null>;
4
+ export interface ToastContextProviderProps {
5
+ value: IToastContext;
6
+ children: ReactNode;
7
+ }
8
+ /**
9
+ * This is a provider for the ToastContext.
10
+ */
11
+ export declare const ToastProvider: (props: ToastContextProviderProps) => import("react/jsx-runtime").JSX.Element;
12
+ export { ToastContext };
@@ -0,0 +1,12 @@
1
+ import { ITokenContext } from "@trackunit/iris-app-runtime-core-api";
2
+ import { ReactNode } from "react";
3
+ declare const TokenContext: import("react").Context<ITokenContext | null>;
4
+ interface TokenProviderProps {
5
+ value: ITokenContext;
6
+ children?: ReactNode;
7
+ }
8
+ /**
9
+ * This is a provider for the TokenContext.
10
+ */
11
+ export declare const TokenProvider: (props: TokenProviderProps) => import("react/jsx-runtime").JSX.Element;
12
+ export { TokenContext };
@@ -0,0 +1,12 @@
1
+ import { CurrentUserState } from "@trackunit/iris-app-runtime-core-api";
2
+ import { ReactNode } from "react";
3
+ declare const CurrentUserContext: import("react").Context<CurrentUserState | null>;
4
+ interface Props {
5
+ value: CurrentUserState;
6
+ children?: ReactNode;
7
+ }
8
+ /**
9
+ * This is a provider for the CurrentUserContext.
10
+ */
11
+ export declare const CurrentUserProvider: (props: Props) => import("react/jsx-runtime").JSX.Element;
12
+ export { CurrentUserContext };
@@ -0,0 +1,12 @@
1
+ import { CurrentUserPreferenceState } from "@trackunit/iris-app-runtime-core-api";
2
+ import { ReactNode } from "react";
3
+ declare const CurrentUserPreferenceContext: import("react").Context<CurrentUserPreferenceState | null>;
4
+ interface Props {
5
+ value: CurrentUserPreferenceState;
6
+ children?: ReactNode;
7
+ }
8
+ /**
9
+ *
10
+ */
11
+ export declare const CurrentUserPreferenceProvider: (props: Props) => import("react/jsx-runtime").JSX.Element;
12
+ export { CurrentUserPreferenceContext };
@@ -0,0 +1,12 @@
1
+ import { WidgetConfigContext as WidgetConfigContextType } from "@trackunit/iris-app-runtime-core-api";
2
+ import { ReactNode } from "react";
3
+ export declare const WidgetConfigContext: import("react").Context<WidgetConfigContextType | null>;
4
+ interface WidgetConfigContextProps {
5
+ value: WidgetConfigContextType;
6
+ children?: ReactNode;
7
+ }
8
+ /**
9
+ * This is a provider for the WidgetConfigContext.
10
+ */
11
+ export declare const WidgetConfigProvider: (props: WidgetConfigContextProps) => import("react/jsx-runtime").JSX.Element;
12
+ export {};
@@ -1,24 +0,0 @@
1
- export declare const SystemOfMeasurement: {
2
- readonly Si: "SI";
3
- readonly UsCustomary: "US_CUSTOMARY";
4
- };
5
- export declare const TimeZonePreference: {
6
- readonly CustomTimeZone: "CUSTOM_TIME_ZONE";
7
- readonly LocalTimeZone: "LOCAL_TIME_ZONE";
8
- readonly MachineTimeZone: "MACHINE_TIME_ZONE";
9
- };
10
- export type SystemOfMeasurementType = (typeof SystemOfMeasurement)[keyof typeof SystemOfMeasurement];
11
- export type TimeZonePreferenceType = (typeof TimeZonePreference)[keyof typeof TimeZonePreference];
12
- export interface IUserPreferencesContext {
13
- language?: string;
14
- setLanguage?: (language: string) => void;
15
- timeZonePreference?: TimeZonePreferenceType;
16
- setTimeZonePreference?: (timeZonePreference: TimeZonePreferenceType) => void;
17
- systemOfMeasurement?: SystemOfMeasurementType;
18
- setSystemOfMeasurement?: (systemOfMeasurement: SystemOfMeasurementType) => void;
19
- }
20
- export interface ICurrentUserPreferenceContext {
21
- getCurrentUserLanguage: () => Promise<string>;
22
- getCurrentUserTimeZonePreference: () => Promise<TimeZonePreferenceType>;
23
- getCurrentUserSystemOfMeasurement: () => Promise<SystemOfMeasurementType>;
24
- }
@@ -1,79 +0,0 @@
1
- export type AdditionalProperties = Record<string, string | number | boolean | null | undefined | Array<string | number>>;
2
- /**
3
- * @deprecated Specify an event type by extending BaseEvent
4
- */
5
- export type UnspecifiedEvent = AdditionalProperties;
6
- export interface BaseEvent {
7
- additionalProperties?: AdditionalProperties;
8
- }
9
- export type Event<T> = {
10
- /**
11
- * Explain what this event means
12
- */
13
- description?: string;
14
- /**
15
- * The properties to log. Pick an existing type or make a custom one.
16
- * Be specific.
17
- */
18
- properties: T;
19
- };
20
- export type EventDictionary = Record<string, Event<BaseEvent | UnspecifiedEvent>>;
21
- /**
22
- * Takes an event type and a description and returns an event
23
- *
24
- * @template T The event type.
25
- * Use existing from EventTypes.ts or make custom inline for one offs.
26
- * Defaults to BaseEvent
27
- * @param {{ description: string }} event with the interface of the event type to be filled later
28
- * @returns {*} {Event<T>}
29
- */
30
- export declare const createEvent: <T extends object = BaseEvent>(event?: {
31
- description?: string;
32
- }) => Event<T>;
33
- export interface IAnalyticsContext<Events extends EventDictionary> {
34
- /**
35
- * @template EventName
36
- * @param {EventName} eventName Name of the event. Used to look up event interface in EventName.ts
37
- * @param details Event parameters. Must match event interface.
38
- * @param description Description of the event.
39
- * @param {{prefix: string, postfix: string}} nameSupplement Generally not reccommended.
40
- *
41
- * **Prefix**: Add a prefix to begging event name when logging.
42
- *
43
- * **Postfix**: Add string to end of event name when logging.
44
- * Makes unique events possible, while sharing the same EventName + type.
45
- * Only here because the analytics team wants each report to log a unique event
46
- * for easier comparison in Databricks.
47
- */
48
- logEvent<T extends keyof Events>(eventName: T, details: Events[T]["properties"], nameSupplement?: {
49
- prefix?: string;
50
- postfix?: string;
51
- }): void;
52
- /**
53
- *
54
- * @param details
55
- */
56
- logPageView(details: {
57
- pageName: string;
58
- } & BaseEvent): void;
59
- /**
60
- * Log an error event.
61
- *
62
- * @param details The error event to log.
63
- */
64
- logError(details: UnspecifiedEvent): void;
65
- /**
66
- * Track this user property for each event.
67
- *
68
- * @param name key of property to set
69
- * @param data value of property to set
70
- */
71
- setUserProperty(name: string, data: string | number): void;
72
- }
73
- type PromisifyMethod<T> = T extends (...args: infer U) => infer V ? (...args: U) => Promise<V> : T;
74
- type PromisifyObject<T> = {
75
- [K in keyof T]: PromisifyMethod<T[K]>;
76
- };
77
- export interface IAnalyticsContextAsync<T extends EventDictionary> extends PromisifyObject<IAnalyticsContext<T>> {
78
- }
79
- export {};
@@ -1,52 +0,0 @@
1
- export interface AssetSortingContextValue {
2
- sortingState: SortingState;
3
- setSortBy: (sortBy: AssetSortByProperty, order?: SortOrder, customFieldDefinitionId?: string) => void;
4
- }
5
- export interface SortingState {
6
- /** Custom field definitionId if AssetSortByProperty is a CustomField */
7
- customFieldDefinitionId?: string;
8
- /** The property to sort by. */
9
- sortBy: AssetSortByProperty;
10
- /** The property to sort by. */
11
- order: SortOrder;
12
- }
13
- export declare enum AssetSortByProperty {
14
- Activity = "ACTIVITY",
15
- Brand = "BRAND",
16
- Category = "CATEGORY",
17
- Criticality = "CRITICALITY",
18
- CustomField = "CUSTOM_FIELD",
19
- CustomerName = "CUSTOMER_NAME",
20
- AccessManagement = "ACCESS_MANAGEMENT",
21
- ExternalReference = "EXTERNAL_REFERENCE",
22
- Location = "LOCATION",
23
- LocationUpdatedAt = "LOCATION_UPDATED_AT",
24
- Model = "MODEL",
25
- Name = "NAME",
26
- OwnerAccountName = "OWNER_ACCOUNT_NAME",
27
- ProductionYear = "PRODUCTION_YEAR",
28
- SerialNumber = "SERIAL_NUMBER",
29
- ServicePlanAssignmentStatus = "SERVICE_PLAN_ASSIGNMENT_STATUS",
30
- ServicePlanOverdueness = "SERVICE_PLAN_OVERDUENESS",
31
- ServicePlanStatus = "SERVICE_PLAN_STATUS",
32
- TelematicsDeviceSerialNumber = "TELEMATICS_DEVICE_SERIAL_NUMBER",
33
- Type = "TYPE",
34
- PlannedServiceBooked = "PLANNED_SERVICE_BOOKED",
35
- PlannedServiceBookingDate = "PLANNED_SERVICE_BOOKING_DATE",
36
- ServicePlanPrediction = "SERVICE_PLAN_PREDICTION",
37
- IssueCreatedAt = "ISSUE_CREATED_AT"
38
- }
39
- /**
40
- * Ensures that a string is a valid AssetSortByProperty enum value
41
- *
42
- * @param input A string to test against AssetSortByProperty
43
- * @returns {AssetSortByProperty} The AssetSortByProperty enum value or the default value (AssetSortByProperty.Activity)
44
- */
45
- export declare const validateStringAsAssetSortByProperty: (input?: string) => {
46
- sortBy: AssetSortByProperty;
47
- customFieldDefinitionId?: string;
48
- };
49
- export declare enum SortOrder {
50
- Asc = "ASC",
51
- Desc = "DESC"
52
- }
@@ -1,32 +0,0 @@
1
- export type UserInteractionType = "PRIMARY" | "SECONDARY" | "CLOSE";
2
- export interface ConfirmationDialogProps {
3
- /**
4
- * The heading of the modal.
5
- */
6
- title: string;
7
- /**
8
- * The content to show in the modal.
9
- */
10
- message: string | React.ReactNode;
11
- /**
12
- * The type of the primary action button.
13
- * For actions like delete, the primary action button should be primary-danger.
14
- */
15
- primaryActionType: "primary" | "primary-danger";
16
- /**
17
- * The label of the primary action button.
18
- * For example, "Delete user".
19
- */
20
- primaryActionLabel: string;
21
- /**
22
- * The label of the secondary action button.
23
- * For example, "Cancel".
24
- */
25
- secondaryActionLabel?: string;
26
- }
27
- export interface ConfirmationDialogContextValue {
28
- /**
29
- * confirm shows a confirmation dialog and returns a promise that resolves to the user interaction type.
30
- */
31
- confirm: (props: ConfirmationDialogProps) => Promise<UserInteractionType>;
32
- }
@@ -1,62 +0,0 @@
1
- export interface CurrentUserContextInterface {
2
- /**
3
- * User id used when logging in. Undefined if not authenticated, will change if user is impersonating or not.
4
- */
5
- clientSideUserId: string | undefined;
6
- /**
7
- * tasUserId used when logging in. Undefined if not authenticated
8
- */
9
- tasUserId: string | undefined;
10
- /**
11
- * userName used when logging in. Undefined if not authenticated
12
- */
13
- userName: string | undefined;
14
- /**
15
- * user role of current user. Undefined if not authenticated
16
- */
17
- userRole: string | undefined;
18
- /**
19
- * Legacy user id. Undefined if not authenticated
20
- */
21
- userId: number | undefined;
22
- /**
23
- * Legacy customer id. Undefined if not authenticated
24
- */
25
- customerId: number | undefined;
26
- /**
27
- * Account ID. undefined if not authenticated
28
- */
29
- accountId: string | undefined;
30
- /**
31
- * If currently assuming a different user, this contains the information of that user. Null if not assuming
32
- */
33
- assumedUser: {
34
- userId: number;
35
- customerId: number;
36
- accountId: string;
37
- tasUserId: string | undefined;
38
- } | null;
39
- email: string | undefined;
40
- name: string | undefined;
41
- jobTitle: string | undefined;
42
- /**
43
- * Is the user currently assuming a different user
44
- */
45
- isAssuming: boolean;
46
- /**
47
- * Is the user a Trackunit user
48
- */
49
- isTrackunitUser: boolean;
50
- /**
51
- * Is there an authenticated user or not
52
- */
53
- isAuthenticated: boolean;
54
- /**
55
- * Is user verified in Okta
56
- */
57
- isVerified: boolean | undefined;
58
- /**
59
- * Is user is account owner
60
- */
61
- isAccountOwner: boolean | undefined;
62
- }
@@ -1,33 +0,0 @@
1
- export interface ITracingHeaders {
2
- "X-TrackunitAppVersion": string;
3
- "session-id": string;
4
- "commit-number": number;
5
- }
6
- export interface IEnvironmentContext {
7
- auth: {
8
- url: string;
9
- clientId: string;
10
- issuer: string;
11
- };
12
- tracingHeaders: ITracingHeaders;
13
- managerClassicUrl: string;
14
- googleMapsApiKey: string;
15
- amplitudeApiKey: string;
16
- amplitudeApiEndpoint: string;
17
- graphqlPublicUrl: string;
18
- graphqlInternalUrl: string;
19
- graphqlReportUrl: string;
20
- buildVersion: string;
21
- commitNumber: number;
22
- publicUrl: string;
23
- irisAppSdkServerUrl: string;
24
- isFeatureBranch: boolean;
25
- environment: "dev" | "stage" | "prod";
26
- sentryDsn: string;
27
- sessionId: string;
28
- uptimeId: string;
29
- trackunitRestApiUrl: string;
30
- hubspotRequestAppAccessFormId: string;
31
- reportAccessCallback: string;
32
- reportAccessClientId: string;
33
- }
@@ -1,26 +0,0 @@
1
- export type Severity = "fatal" | "error" | "warning" | "log" | "info" | "debug";
2
- export interface Breadcrumb {
3
- type?: string;
4
- level?: Severity;
5
- event_id?: string;
6
- category?: string;
7
- message?: string;
8
- data?: {
9
- [key: string]: any;
10
- };
11
- timestamp?: number;
12
- }
13
- export interface CaptureExceptionsOptions {
14
- fingerprint?: Array<string>;
15
- level: Severity;
16
- }
17
- export interface ErrorHandlingContextValue {
18
- /**
19
- * Captures an error event.
20
- *
21
- * @param details The error event to capture.
22
- */
23
- captureException(details: unknown, options?: CaptureExceptionsOptions): void;
24
- addBreadcrumb(breadcrumb: Breadcrumb): void;
25
- setTag(key: string, value?: string | number | bigint | symbol | boolean | null): void;
26
- }
@@ -1,37 +0,0 @@
1
- import { GeoJsonMultiPolygon, GeoJsonPolygon } from "@trackunit/geo-json-utils";
2
- export type ValueName = {
3
- value: string;
4
- name: string;
5
- };
6
- export type BooleanValue = {
7
- booleanValue?: boolean;
8
- };
9
- export type MinMaxFilterValue = {
10
- min?: number;
11
- max?: number;
12
- };
13
- export type DateRangeFilterValue = {
14
- from?: string;
15
- to?: string;
16
- };
17
- export type AreaFilterGeoJsonGeometryType = GeoJsonPolygon | GeoJsonMultiPolygon;
18
- export type FilterValueType = Array<string> | Array<ValueName> | ValueName | AreaFilterGeoJsonGeometryType | MinMaxFilterValue | DateRangeFilterValue | string | number | BooleanValue | undefined;
19
- export type FilterBarValues = Record<string, FilterValueType>;
20
- export interface FilterBarContext {
21
- /**
22
- * The filter bar values for assets, keyed by filter key.
23
- */
24
- assetsFilterBarValues: FilterBarValues | null;
25
- /**
26
- * The filter bar values for customers, keyed by filter key.
27
- */
28
- customersFilterBarValues: FilterBarValues | null;
29
- /**
30
- * The filter bar values for sites, keyed by filter key.
31
- */
32
- sitesFilterBarValues: FilterBarValues | null;
33
- /**
34
- * Whether the filter bar values are loading, true if any of the filter bar values are not loaded yet.
35
- */
36
- isLoading: boolean;
37
- }
@@ -1,13 +0,0 @@
1
- export interface ModalDialogContextValue {
2
- /**
3
- * Informs the host that a modal will be shown, this will resize the iris app to allow a full screen modal.
4
- */
5
- openModal: ({ scrollX, scrollY }?: {
6
- scrollX: number;
7
- scrollY: number;
8
- }) => Promise<void>;
9
- /**
10
- * Informs the host that a modal will be closed this will resize the iris app back to the size before the modal was shown.
11
- */
12
- closeModal: () => Promise<void>;
13
- }
@@ -1,81 +0,0 @@
1
- /**
2
- * Page would often go in the sidebar. In asset home "status", "telematics" etc are pages
3
- */
4
- type Page<TPage extends string> = {
5
- page: TPage;
6
- } & SubPage & FragmentIdentifier & Search;
7
- /**
8
- * SubPage allows for extra deep navigation inside of the app.
9
- */
10
- type SubPage = {
11
- subPage?: string;
12
- };
13
- type Search = {
14
- search?: Record<string, any>;
15
- };
16
- type FragmentIdentifier = {
17
- hash?: string;
18
- };
19
- type NeverPage = {
20
- page?: never;
21
- };
22
- type NeverIrisApp = {
23
- irisAppId?: never;
24
- extensionId?: never;
25
- };
26
- export type IrisAppOptions = {
27
- irisAppId: string;
28
- extensionId: string;
29
- } & SubPage & Search & FragmentIdentifier & NeverPage;
30
- declare const mainApps: readonly ["reports", "sites", "map", "assets"];
31
- export type MainFleetApp = (typeof mainApps)[number];
32
- export type FleetAppStandardOptions = Page<MainFleetApp> & NeverIrisApp;
33
- export type MapAppStandardOptions = Page<"map"> & NeverIrisApp;
34
- export type MarketplaceOptions = {
35
- irisAppId: string;
36
- };
37
- export declare const assetHomePageIds: readonly ["status", "movement", "events", "insights", "specification", "telematics", "contracts"];
38
- export type AssetHomePageId = (typeof assetHomePageIds)[number];
39
- export type AssetHomeStandardOptions = Page<AssetHomePageId> & NeverIrisApp;
40
- export declare const siteHomePageIds: readonly ["overview", "assets", "asset-visibility"];
41
- export type SiteHomePageId = (typeof siteHomePageIds)[number];
42
- export type SiteHomeStandardOptions = Page<SiteHomePageId> & NeverIrisApp;
43
- export declare const groupHomePageIds: readonly ["assets", "users", "details"];
44
- export type GroupHomePageId = (typeof groupHomePageIds)[number];
45
- export type GroupHomeStandardOptions = Page<GroupHomePageId> & NeverIrisApp;
46
- export declare const customerHomePageIds: readonly ["info", "assets", "contact-list"];
47
- export type CustomerHomePageId = (typeof customerHomePageIds)[number];
48
- export type CustomerHomeStandardOptions = Page<CustomerHomePageId> & NeverIrisApp;
49
- export type HasAccessToOptions = (IrisAppOptions | AssetHomeStandardOptions | SiteHomeStandardOptions | FleetAppStandardOptions) & {
50
- assetId?: string;
51
- siteId?: string;
52
- };
53
- /**
54
- * type guard for IrisAppOptions
55
- */
56
- export declare const isIrisOptions: (options: IrisAppOptions | unknown) => options is IrisAppOptions;
57
- export interface INavigationContext {
58
- hasAccessTo: (options: HasAccessToOptions) => Promise<boolean>;
59
- gotoAssetHome: (assetId: string, options?: IrisAppOptions | AssetHomeStandardOptions) => Promise<boolean>;
60
- gotoSiteHome: (siteId: string, options?: IrisAppOptions | SiteHomeStandardOptions) => Promise<boolean>;
61
- gotoCustomerHome: (customerId?: string, options?: IrisAppOptions | CustomerHomeStandardOptions) => Promise<boolean>;
62
- gotoGroupHome: (groupId: string, options?: GroupHomeStandardOptions) => Promise<boolean>;
63
- gotoAppLibrary: (irisAppId?: string) => Promise<boolean>;
64
- gotoFleetApp: (options: IrisAppOptions | FleetAppStandardOptions) => Promise<boolean>;
65
- gotoAdmin: (url?: string) => Promise<boolean>;
66
- gotoAlerts: (url?: string) => Promise<boolean>;
67
- gotoMarketplace: (options?: MarketplaceOptions) => Promise<boolean>;
68
- reloadManager: (options?: {
69
- renewToken?: boolean;
70
- }) => Promise<boolean>;
71
- getAssetHomeUrl: (assetId: string, options?: IrisAppOptions | AssetHomeStandardOptions) => Promise<string | null>;
72
- getSiteHomeUrl: (siteId: string, options?: IrisAppOptions | SiteHomeStandardOptions) => Promise<string | null>;
73
- getCustomerHomeUrl: (customerId?: string, options?: IrisAppOptions | CustomerHomeStandardOptions) => Promise<string | null>;
74
- getGroupHomeUrl: (groupId: string, options?: GroupHomeStandardOptions) => Promise<string | null>;
75
- getAppLibraryUrl: (irisAppId?: string) => Promise<string | null>;
76
- getFleetAppUrl: (options: IrisAppOptions | FleetAppStandardOptions) => Promise<string | null>;
77
- getAdminUrl: (url?: string) => Promise<string>;
78
- getAlertsUrl: (url?: string) => Promise<string>;
79
- getMarketplaceUrl: (options?: MarketplaceOptions) => Promise<string>;
80
- }
81
- export {};