@opengeoweb/cap 9.6.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.
- package/README.md +10 -0
- package/index.esm.d.ts +1 -0
- package/index.esm.js +990 -0
- package/package.json +37 -0
- package/src/index.d.ts +1 -0
- package/src/lib/CapDemo.stories.d.ts +7 -0
- package/src/lib/components/CapMapAndList.integration.spec.d.ts +1 -0
- package/src/lib/components/ComponentsLookUp/componentsLookUp.d.ts +34 -0
- package/src/lib/components/ComponentsLookUp/componentsLookUp.spec.d.ts +1 -0
- package/src/lib/components/ComponentsLookUp/index.d.ts +1 -0
- package/src/lib/components/GanttChart/Gantt.d.ts +40 -0
- package/src/lib/components/GanttChart/GanttModule.d.ts +7 -0
- package/src/lib/components/GanttChart/GanttModule.spec.d.ts +1 -0
- package/src/lib/components/GanttChart/GanttModule.stories.d.ts +6 -0
- package/src/lib/components/GanttChart/GanttReactWrapper.d.ts +37 -0
- package/src/lib/components/GanttChart/GanttWrapper.d.ts +9 -0
- package/src/lib/components/GanttChart/GanttWrapper.spec.d.ts +1 -0
- package/src/lib/components/GanttChart/GanttWrapper.stories.d.ts +8 -0
- package/src/lib/components/GanttChart/Task.d.ts +29 -0
- package/src/lib/components/GanttChart/ViewMode.d.ts +9 -0
- package/src/lib/components/GanttChart/mockTasks.d.ts +2 -0
- package/src/lib/components/GanttChart/utils.d.ts +5 -0
- package/src/lib/components/GanttChart/utils.spec.d.ts +1 -0
- package/src/lib/components/MapViewCap/MapViewCapConnect.d.ts +18 -0
- package/src/lib/components/MapViewCap/MapViewCapConnect.spec.d.ts +1 -0
- package/src/lib/components/MapViewCap/MapViewCapConnect.stories.d.ts +6 -0
- package/src/lib/components/MapViewCap/MapViewCapConnectWrapper.d.ts +17 -0
- package/src/lib/components/MapViewCap/MapViewCapConnectWrapper.spec.d.ts +1 -0
- package/src/lib/components/MapViewCap/index.d.ts +1 -0
- package/src/lib/components/Providers/Providers.d.ts +30 -0
- package/src/lib/components/Providers/index.d.ts +1 -0
- package/src/lib/components/WarningListCap/WarningListCap.d.ts +8 -0
- package/src/lib/components/WarningListCap/WarningListCap.spec.d.ts +1 -0
- package/src/lib/components/WarningListCap/WarningListCap.stories.d.ts +6 -0
- package/src/lib/components/WarningListCap/WarningListCapConnect.d.ts +7 -0
- package/src/lib/components/WarningListCap/WarningListCapConnectWrapper.d.ts +6 -0
- package/src/lib/components/WarningListCap/WarningListCapConnectWrapper.spec.d.ts +1 -0
- package/src/lib/components/WarningListCap/WarningListRowCap/WarningListRowCap.d.ts +7 -0
- package/src/lib/components/WarningListCap/WarningListRowCap/WarningListRowCap.spec.d.ts +1 -0
- package/src/lib/components/WarningListCap/WarningListRowCap/WarningListRowCap.stories.d.ts +6 -0
- package/src/lib/components/WarningListCap/WarningListRowCap/WarningListRowCapConnect.d.ts +8 -0
- package/src/lib/components/WarningListCap/WarningListRowCap/WarningListRowCapConnect.spec.d.ts +1 -0
- package/src/lib/components/WarningListCap/index.d.ts +1 -0
- package/src/lib/components/WarningListCap/types.d.ts +47 -0
- package/src/lib/components/types.d.ts +73 -0
- package/src/lib/index.d.ts +4 -0
- package/src/lib/store/config.d.ts +6 -0
- package/src/lib/store/index.d.ts +3 -0
- package/src/lib/store/mockStore.d.ts +21 -0
- package/src/lib/store/reducer.d.ts +13 -0
- package/src/lib/store/reducer.spec.d.ts +1 -0
- package/src/lib/store/selector.spec.d.ts +1 -0
- package/src/lib/store/selectors.d.ts +15 -0
- package/src/lib/store/types.d.ts +42 -0
- package/src/lib/store.d.ts +4 -0
- package/src/lib/utils/addColors.d.ts +2 -0
- package/src/lib/utils/addColors.spec.d.ts +1 -0
- package/src/lib/utils/addFeedAddressToCustomGeoJsonFeature.d.ts +2 -0
- package/src/lib/utils/addFeedAddressToCustomGeoJsonFeature.spec.d.ts +1 -0
- package/src/lib/utils/api.d.ts +20 -0
- package/src/lib/utils/api.spec.d.ts +1 -0
- package/src/lib/utils/fakeApi.d.ts +2 -0
- package/src/lib/utils/fakeApi.spec.d.ts +1 -0
- package/src/lib/utils/feedLanguageUtils.d.ts +1 -0
- package/src/lib/utils/feedLanguageUtils.spec.d.ts +1 -0
- package/src/lib/utils/findEventIndexInLanguage.d.ts +10 -0
- package/src/lib/utils/findEventIndexInLanguage.spec.d.ts +1 -0
- package/src/lib/utils/highlightGeoJson.d.ts +3 -0
- package/src/lib/utils/highlightGeoJson.spec.d.ts +1 -0
- package/src/lib/utils/i18n.d.ts +2 -0
- package/src/lib/utils/mockAlert.d.ts +19 -0
- package/src/lib/utils/mockCapData.d.ts +6 -0
- package/src/lib/utils/mockGeoJson.d.ts +4 -0
- package/src/lib/utils/mockGeoJsonMultipleFeatures.d.ts +3 -0
- package/src/lib/utils/store.d.ts +2 -0
package/package.json
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@opengeoweb/cap",
|
|
3
|
+
"version": "9.6.0",
|
|
4
|
+
"description": "GeoWeb Common Alerting Protocol (CAP) library for the opengeoweb project",
|
|
5
|
+
"license": "Apache-2.0",
|
|
6
|
+
"repository": {
|
|
7
|
+
"type": "git",
|
|
8
|
+
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"@redux-eggs/redux-toolkit": "^2.2.0",
|
|
12
|
+
"@redux-eggs/saga-extension": "^2.2.0",
|
|
13
|
+
"@opengeoweb/api": "*",
|
|
14
|
+
"@opengeoweb/core": "*",
|
|
15
|
+
"frappe-gantt": "^0.6.1",
|
|
16
|
+
"@mui/material": "5.12.0",
|
|
17
|
+
"@opengeoweb/shared": "*",
|
|
18
|
+
"@opengeoweb/store": "*",
|
|
19
|
+
"react-redux": "^8.1.3",
|
|
20
|
+
"@opengeoweb/webmap": "*",
|
|
21
|
+
"@opengeoweb/webmap-react": "*",
|
|
22
|
+
"date-fns": "^3.3.0",
|
|
23
|
+
"@mui/system": "^5.15.1",
|
|
24
|
+
"react-i18next": "^13.5.0",
|
|
25
|
+
"@reduxjs/toolkit": "^1.9.7",
|
|
26
|
+
"@opengeoweb/theme": "*",
|
|
27
|
+
"i18next": "^23.7.11",
|
|
28
|
+
"@redux-eggs/core": "^2.2.0",
|
|
29
|
+
"axios": "1.5.0"
|
|
30
|
+
},
|
|
31
|
+
"peerDependencies": {
|
|
32
|
+
"react": "18"
|
|
33
|
+
},
|
|
34
|
+
"module": "./index.esm.js",
|
|
35
|
+
"type": "module",
|
|
36
|
+
"main": "./index.esm.js"
|
|
37
|
+
}
|
package/src/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './lib';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { ApiUrls } from '@opengeoweb/api';
|
|
3
|
+
import { InitialMapProps } from '@opengeoweb/core';
|
|
4
|
+
import { CapFeatures } from '../types';
|
|
5
|
+
export type SupportedComponentTypes = 'CapWarningList' | 'CapWarningMap';
|
|
6
|
+
interface InitialProps {
|
|
7
|
+
mapPreset: {
|
|
8
|
+
layers?: InitialMapProps['mapPreset']['layers'];
|
|
9
|
+
proj: {
|
|
10
|
+
bbox: {
|
|
11
|
+
left: number;
|
|
12
|
+
bottom: number;
|
|
13
|
+
right: number;
|
|
14
|
+
top: number;
|
|
15
|
+
};
|
|
16
|
+
srs: string;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
geoJson: CapFeatures;
|
|
20
|
+
}
|
|
21
|
+
export interface ComponentsLookUpPayload {
|
|
22
|
+
productConfigKey: string;
|
|
23
|
+
componentType: SupportedComponentTypes;
|
|
24
|
+
id: string;
|
|
25
|
+
initialProps: InitialProps;
|
|
26
|
+
config: ApiUrls;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* The lookup table is for registering your own components with the workspace.
|
|
30
|
+
* @param payload
|
|
31
|
+
* @returns
|
|
32
|
+
*/
|
|
33
|
+
export declare const ComponentsLookUp: ({ componentType, initialProps, productConfigKey, config, id, }: ComponentsLookUpPayload) => React.ReactElement;
|
|
34
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './componentsLookUp';
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import Gantt from 'frappe-gantt';
|
|
2
|
+
import { Task } from './Task';
|
|
3
|
+
import { ViewMode } from './ViewMode';
|
|
4
|
+
type Options = {
|
|
5
|
+
view_mode?: ViewMode;
|
|
6
|
+
header_height?: number;
|
|
7
|
+
column_width?: number;
|
|
8
|
+
bar_height?: number;
|
|
9
|
+
language?: string;
|
|
10
|
+
step?: number;
|
|
11
|
+
date_format?: string;
|
|
12
|
+
bar_corner_radius?: number;
|
|
13
|
+
arrow_curve?: number;
|
|
14
|
+
padding?: number;
|
|
15
|
+
popup_trigger?: string;
|
|
16
|
+
custom_popup_html?: (task: Task) => string;
|
|
17
|
+
on_click?: (task: Task) => void;
|
|
18
|
+
on_view_change?: (mode: ViewMode) => void;
|
|
19
|
+
on_progress_change?: (task: Task, progress: number) => void;
|
|
20
|
+
on_date_change?: (task: Task, start: Date, end: Date) => void;
|
|
21
|
+
view_modes?: string[];
|
|
22
|
+
};
|
|
23
|
+
export default class CustomGantt extends Gantt {
|
|
24
|
+
private options;
|
|
25
|
+
private gantt_start;
|
|
26
|
+
private gantt_end;
|
|
27
|
+
private tasks;
|
|
28
|
+
constructor(wrapper: SVGSVGElement, tasks: Task[], options: Options);
|
|
29
|
+
update_view_scale(view_mode: ViewMode): void;
|
|
30
|
+
setup_gantt_dates(): void;
|
|
31
|
+
get_date_info(date: Date, newLastDate: Date, i: number): {
|
|
32
|
+
upper_text: string;
|
|
33
|
+
lower_text: string;
|
|
34
|
+
upper_x: number;
|
|
35
|
+
upper_y: number;
|
|
36
|
+
lower_x: number;
|
|
37
|
+
lower_y: number;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Task } from './Task';
|
|
3
|
+
import { ViewMode } from './ViewMode';
|
|
4
|
+
export declare const renderDate: (date: Date) => string;
|
|
5
|
+
export declare const renderTime: (date: Date) => string;
|
|
6
|
+
type GanttReactWrapperProps = {
|
|
7
|
+
tasks: Task[];
|
|
8
|
+
viewMode?: ViewMode;
|
|
9
|
+
onTasksChange?: (tasks: Task[]) => void;
|
|
10
|
+
onClick?: (task: Task) => void;
|
|
11
|
+
onDateChange?: (task: Task, start: Date, end: Date) => void;
|
|
12
|
+
onProgressChange?: (task: Task, progress: number) => void;
|
|
13
|
+
onViewChange?: (mode: ViewMode) => void;
|
|
14
|
+
};
|
|
15
|
+
type FrappeGanttState = {
|
|
16
|
+
viewMode: ViewMode;
|
|
17
|
+
tasks: Task[];
|
|
18
|
+
};
|
|
19
|
+
export declare class GanttReactWrapper extends React.Component<GanttReactWrapperProps, FrappeGanttState> {
|
|
20
|
+
private _target;
|
|
21
|
+
private _svg;
|
|
22
|
+
private _gantt;
|
|
23
|
+
static defaultProps: {
|
|
24
|
+
viewMode: ViewMode;
|
|
25
|
+
onTasksChange: () => void;
|
|
26
|
+
onClick: () => void;
|
|
27
|
+
onDateChange: () => void;
|
|
28
|
+
onProgressChange: () => void;
|
|
29
|
+
onViewChange: () => void;
|
|
30
|
+
};
|
|
31
|
+
constructor(props: GanttReactWrapperProps);
|
|
32
|
+
static getDerivedStateFromProps(nextProps: GanttReactWrapperProps): FrappeGanttState;
|
|
33
|
+
componentDidMount(): void;
|
|
34
|
+
componentDidUpdate(): void;
|
|
35
|
+
render(): React.ReactElement;
|
|
36
|
+
}
|
|
37
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Task } from './Task';
|
|
3
|
+
import { ViewMode } from './ViewMode';
|
|
4
|
+
interface GantWrapperProps {
|
|
5
|
+
tasks: Task[];
|
|
6
|
+
defaultViewMode?: ViewMode;
|
|
7
|
+
}
|
|
8
|
+
declare const GantWrapper: React.FC<GantWrapperProps>;
|
|
9
|
+
export default GantWrapper;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
declare const _default: {
|
|
3
|
+
title: string;
|
|
4
|
+
};
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare const GanttDemo: () => React.ReactElement;
|
|
7
|
+
export declare const GanttDemoDark: () => React.ReactElement;
|
|
8
|
+
export declare const GanttDemoEmptyList: () => React.ReactElement;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
export declare class Task {
|
|
2
|
+
private _dependencies;
|
|
3
|
+
id: string;
|
|
4
|
+
name: string;
|
|
5
|
+
start: string;
|
|
6
|
+
end: string;
|
|
7
|
+
_end: Date;
|
|
8
|
+
_start: Date;
|
|
9
|
+
severity: 'Minor' | 'Moderate' | 'Severe' | 'Extreme';
|
|
10
|
+
title: string;
|
|
11
|
+
description: string;
|
|
12
|
+
author: string;
|
|
13
|
+
area: string;
|
|
14
|
+
phenomenon: string;
|
|
15
|
+
constructor(options?: Partial<Task>);
|
|
16
|
+
/**
|
|
17
|
+
* Progress in percentage
|
|
18
|
+
*/
|
|
19
|
+
private _progress;
|
|
20
|
+
get progress(): number;
|
|
21
|
+
set progress(value: number);
|
|
22
|
+
/**
|
|
23
|
+
* A css custom class for the task chart bar
|
|
24
|
+
*/
|
|
25
|
+
custom_class?: string;
|
|
26
|
+
setDependencies(value: string | string[]): void;
|
|
27
|
+
set dependencies(value: string[] | string);
|
|
28
|
+
get dependencies(): string[] | string;
|
|
29
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CustomFeature } from '../types';
|
|
2
|
+
import { Task } from './Task';
|
|
3
|
+
export declare const convertSeverityToColorClass: (severity: Task['severity']) => string;
|
|
4
|
+
export declare const getEndDateFromHeadline: (headline: string) => Date;
|
|
5
|
+
export declare const convertFeaturesToTasks: (features: CustomFeature[]) => Task[];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InitialMapProps } from '@opengeoweb/core';
|
|
3
|
+
import { CapPresets } from '../types';
|
|
4
|
+
interface MapViewCapConnectProps {
|
|
5
|
+
id?: string;
|
|
6
|
+
title?: string;
|
|
7
|
+
bbox?: {
|
|
8
|
+
left: number;
|
|
9
|
+
bottom: number;
|
|
10
|
+
right: number;
|
|
11
|
+
top: number;
|
|
12
|
+
};
|
|
13
|
+
srs?: string;
|
|
14
|
+
capWarningPresets?: CapPresets;
|
|
15
|
+
layers?: InitialMapProps['mapPreset']['layers'];
|
|
16
|
+
}
|
|
17
|
+
export declare const MapViewCapConnect: React.FC<MapViewCapConnectProps>;
|
|
18
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InitialMapProps } from '@opengeoweb/core';
|
|
3
|
+
interface MapViewCapConnectWrapperProps {
|
|
4
|
+
id?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
bbox?: {
|
|
7
|
+
left: number;
|
|
8
|
+
bottom: number;
|
|
9
|
+
right: number;
|
|
10
|
+
top: number;
|
|
11
|
+
};
|
|
12
|
+
srs?: string;
|
|
13
|
+
productConfigKey?: string;
|
|
14
|
+
layers?: InitialMapProps['mapPreset']['layers'];
|
|
15
|
+
}
|
|
16
|
+
export declare const MapViewCapConnectWrapper: React.FC<MapViewCapConnectWrapperProps>;
|
|
17
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './MapViewCapConnect';
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Store } from '@reduxjs/toolkit';
|
|
3
|
+
import { ThemeProviderProps } from '@opengeoweb/theme';
|
|
4
|
+
import { Theme } from '@mui/material';
|
|
5
|
+
export declare const CapThemeWrapper: React.FC<ThemeProviderProps>;
|
|
6
|
+
interface CapApiProviderProps {
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
createApi?: () => void;
|
|
9
|
+
}
|
|
10
|
+
interface CapThemeStoreProviderProps {
|
|
11
|
+
children?: React.ReactNode;
|
|
12
|
+
theme?: Theme;
|
|
13
|
+
store: Store;
|
|
14
|
+
}
|
|
15
|
+
interface CapTranslationsWrapperProps {
|
|
16
|
+
children?: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* A Provider component which returns the Api Provider for the Cap library
|
|
20
|
+
* @param children
|
|
21
|
+
* @returns
|
|
22
|
+
*/
|
|
23
|
+
export declare const CapApiProvider: React.FC<CapApiProviderProps>;
|
|
24
|
+
export interface CapStoreProviderProps extends ThemeProviderProps {
|
|
25
|
+
store: Store;
|
|
26
|
+
}
|
|
27
|
+
export declare const CapThemeStoreProvider: React.FC<CapThemeStoreProviderProps>;
|
|
28
|
+
export declare const CapTranslationsWrapper: React.FC<CapTranslationsWrapperProps>;
|
|
29
|
+
export declare const CapI18nProvider: React.FC<CapTranslationsWrapperProps>;
|
|
30
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Providers';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CapPresets } from '../../types';
|
|
3
|
+
interface WarningListRowCapConnectProps {
|
|
4
|
+
alertId: string;
|
|
5
|
+
capWarningPresets: CapPresets;
|
|
6
|
+
}
|
|
7
|
+
export declare const WarningListRowCapConnect: React.FC<WarningListRowCapConnectProps>;
|
|
8
|
+
export {};
|
package/src/lib/components/WarningListCap/WarningListRowCap/WarningListRowCapConnect.spec.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './WarningListCap';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export interface CapData {
|
|
2
|
+
alert: {
|
|
3
|
+
identifier: string;
|
|
4
|
+
feedAddress: string;
|
|
5
|
+
sent: string;
|
|
6
|
+
status: string;
|
|
7
|
+
msgType: string;
|
|
8
|
+
scope: string;
|
|
9
|
+
code: string[];
|
|
10
|
+
references: string;
|
|
11
|
+
info: Info[];
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
interface Info {
|
|
15
|
+
language: string;
|
|
16
|
+
category: string;
|
|
17
|
+
event: string;
|
|
18
|
+
urgency: string;
|
|
19
|
+
severity: string;
|
|
20
|
+
certainty: string;
|
|
21
|
+
eventCode: {
|
|
22
|
+
valueName: string;
|
|
23
|
+
value: string;
|
|
24
|
+
};
|
|
25
|
+
onset: string;
|
|
26
|
+
expires: string;
|
|
27
|
+
senderName: string;
|
|
28
|
+
headline: string;
|
|
29
|
+
description: string;
|
|
30
|
+
web: string;
|
|
31
|
+
contact: string;
|
|
32
|
+
parameter: Parameter[];
|
|
33
|
+
area: Area | Area[];
|
|
34
|
+
}
|
|
35
|
+
interface Parameter {
|
|
36
|
+
valueName: string;
|
|
37
|
+
value: number | string;
|
|
38
|
+
}
|
|
39
|
+
interface Area {
|
|
40
|
+
areaDesc: string;
|
|
41
|
+
polygon: string | string[];
|
|
42
|
+
geocode: {
|
|
43
|
+
valueName: string;
|
|
44
|
+
value: string | number;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
export interface CapPresets {
|
|
2
|
+
pollInterval: number;
|
|
3
|
+
feeds: Feed[];
|
|
4
|
+
}
|
|
5
|
+
interface Feed {
|
|
6
|
+
feedAddress: string;
|
|
7
|
+
feedType: string;
|
|
8
|
+
languagePriority: string;
|
|
9
|
+
}
|
|
10
|
+
export interface FeedLastUpdated {
|
|
11
|
+
lastUpdated: number;
|
|
12
|
+
}
|
|
13
|
+
export interface CapWarnings {
|
|
14
|
+
alert: CapAlert;
|
|
15
|
+
features: CapFeatures;
|
|
16
|
+
}
|
|
17
|
+
export interface CapAlert {
|
|
18
|
+
feedAddress: string;
|
|
19
|
+
identifier: string;
|
|
20
|
+
severity: string;
|
|
21
|
+
certainty: string;
|
|
22
|
+
onset: string;
|
|
23
|
+
expires: string;
|
|
24
|
+
languages: Language[];
|
|
25
|
+
}
|
|
26
|
+
export interface CapFeatures extends GeoJSON.FeatureCollection {
|
|
27
|
+
type: 'FeatureCollection';
|
|
28
|
+
features: Array<CustomFeature>;
|
|
29
|
+
}
|
|
30
|
+
export interface CustomFeature {
|
|
31
|
+
type: 'Feature';
|
|
32
|
+
geometry: GeoJSON.Geometry;
|
|
33
|
+
id?: string | number;
|
|
34
|
+
properties: CustomProperties;
|
|
35
|
+
}
|
|
36
|
+
interface CustomProperties {
|
|
37
|
+
fill?: string;
|
|
38
|
+
stroke?: string;
|
|
39
|
+
'stroke-width'?: number;
|
|
40
|
+
'stroke-opacity'?: number;
|
|
41
|
+
details: CustomDetails;
|
|
42
|
+
}
|
|
43
|
+
export interface CustomDetails {
|
|
44
|
+
feedAddress: string;
|
|
45
|
+
identifier: string;
|
|
46
|
+
senderName?: string;
|
|
47
|
+
severity: string;
|
|
48
|
+
certainty: string;
|
|
49
|
+
onset: string;
|
|
50
|
+
expires: string;
|
|
51
|
+
languages: Language[];
|
|
52
|
+
}
|
|
53
|
+
export interface Language {
|
|
54
|
+
areaDesc: string;
|
|
55
|
+
language: string;
|
|
56
|
+
event: string;
|
|
57
|
+
senderName: string;
|
|
58
|
+
headline: string;
|
|
59
|
+
description: string;
|
|
60
|
+
}
|
|
61
|
+
interface SeverityStyle {
|
|
62
|
+
border?: string;
|
|
63
|
+
background?: string;
|
|
64
|
+
fill?: string;
|
|
65
|
+
stroke?: string;
|
|
66
|
+
}
|
|
67
|
+
export interface SeverityStyles {
|
|
68
|
+
Extreme: SeverityStyle;
|
|
69
|
+
Severe: SeverityStyle;
|
|
70
|
+
Moderate: SeverityStyle;
|
|
71
|
+
Minor: SeverityStyle;
|
|
72
|
+
}
|
|
73
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CapStore } from './types';
|
|
2
|
+
export declare const mockCapStateWithAlerts: CapStore;
|
|
3
|
+
export declare const mockCapStateWithFeeds: {
|
|
4
|
+
alerts: {
|
|
5
|
+
ids: never[];
|
|
6
|
+
entities: {};
|
|
7
|
+
};
|
|
8
|
+
feeds: {
|
|
9
|
+
ids: string[];
|
|
10
|
+
entities: {
|
|
11
|
+
'https://alerts.fmi.fi/cap/feed/rss_en-GB.rss': {
|
|
12
|
+
id: string;
|
|
13
|
+
lastUpdated: number;
|
|
14
|
+
};
|
|
15
|
+
'https://api.met.no/weatherapi/metalerts/1.1': {
|
|
16
|
+
id: string;
|
|
17
|
+
lastUpdated: number;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Draft, PayloadAction } from '@reduxjs/toolkit';
|
|
2
|
+
import { CapFeed, CapFeedState, CapAlert, CapAlertState, AddManyAlertsToFeedPayload, FeedLastUpdatedPayload, CapStore } from './types';
|
|
3
|
+
export declare const feedAdapter: import("@reduxjs/toolkit").EntityAdapter<CapFeed>;
|
|
4
|
+
export declare const feedInitialState: CapFeedState;
|
|
5
|
+
export declare const alertAdapter: import("@reduxjs/toolkit").EntityAdapter<CapAlert>;
|
|
6
|
+
export declare const alertInitialState: CapAlertState;
|
|
7
|
+
export declare const initialState: CapStore;
|
|
8
|
+
export declare const reducer: import("redux").Reducer<CapStore, import("redux").AnyAction>;
|
|
9
|
+
export declare const capActions: import("@reduxjs/toolkit").CaseReducerActions<{
|
|
10
|
+
addManyAlerts: (draft: Draft<CapStore>, action: PayloadAction<CapAlert[]>) => void;
|
|
11
|
+
addManyAlertsToFeed: (draft: Draft<CapStore>, action: PayloadAction<AddManyAlertsToFeedPayload>) => void;
|
|
12
|
+
setFeedLastUpdatedTimes: (draft: Draft<CapStore>, action: PayloadAction<FeedLastUpdatedPayload[]>) => void;
|
|
13
|
+
}, "capReducer">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { CoreAppStore } from '@opengeoweb/store';
|
|
2
|
+
import { CapAlert, CapModule, CapStore, CapFeed } from './types';
|
|
3
|
+
export declare const getCapStore: (store: CapModule) => CapStore;
|
|
4
|
+
export declare const getCapFeedById: (state: CapModule, id: import("@reduxjs/toolkit").EntityId) => CapFeed | undefined, getCapFeeds: (state: CapModule) => CapFeed[];
|
|
5
|
+
export declare const getAlertById: (state: CapModule, id: import("@reduxjs/toolkit").EntityId) => CapAlert | undefined, getAlerts: (state: CapModule) => CapAlert[], getAlertIds: (state: CapModule) => import("@reduxjs/toolkit").EntityId[];
|
|
6
|
+
export declare const getAlertsInEffect: ((state: CapModule & CoreAppStore, selectedTime: string) => CapAlert[]) & import("reselect").OutputSelectorFields<(args_0: CapAlert[], args_1: string) => CapAlert[], {
|
|
7
|
+
clearCache: () => void;
|
|
8
|
+
}> & {
|
|
9
|
+
clearCache: () => void;
|
|
10
|
+
};
|
|
11
|
+
export declare const getLastUpdatedTimes: ((state: CapModule) => number[]) & import("reselect").OutputSelectorFields<(args_0: CapFeed[]) => number[], {
|
|
12
|
+
clearCache: () => void;
|
|
13
|
+
}> & {
|
|
14
|
+
clearCache: () => void;
|
|
15
|
+
};
|