@opengeoweb/taf 19.1.0 → 19.1.1

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 (77) hide show
  1. package/dist/README.md +35 -0
  2. package/dist/index.d.ts +1 -0
  3. package/dist/index.esm.js +9349 -0
  4. package/dist/src/index.d.ts +7 -0
  5. package/dist/src/lib/components/AutoTaf/AutoTaf.d.ts +9 -0
  6. package/dist/src/lib/components/AutoTaf/index.d.ts +1 -0
  7. package/dist/src/lib/components/ComponentsLookUp/ComponentsLookUp.d.ts +38 -0
  8. package/dist/src/lib/components/ComponentsLookUp/index.d.ts +1 -0
  9. package/dist/src/lib/components/IssuesPane/IssuesButton.d.ts +10 -0
  10. package/dist/src/lib/components/IssuesPane/IssuesPane.d.ts +14 -0
  11. package/dist/src/lib/components/IssuesPane/IssuesPaneWrapper.d.ts +4 -0
  12. package/dist/src/lib/components/IssuesPane/index.d.ts +2 -0
  13. package/dist/src/lib/components/IssuesPane/types.d.ts +17 -0
  14. package/dist/src/lib/components/IssuesPane/utils.d.ts +20 -0
  15. package/dist/src/lib/components/Providers/Providers.d.ts +22 -0
  16. package/dist/src/lib/components/Providers/index.d.ts +1 -0
  17. package/dist/src/lib/components/ResponsiveWrapper/ResponsiveWrapper.d.ts +4 -0
  18. package/dist/src/lib/components/Spinner/Spinner.d.ts +4 -0
  19. package/dist/src/lib/components/StatusIcon/StatusIcon.d.ts +8 -0
  20. package/dist/src/lib/components/TabPanel/TabPanel.d.ts +8 -0
  21. package/dist/src/lib/components/TabPanel/index.d.ts +1 -0
  22. package/dist/src/lib/components/TafAvatar/TafAvatar.d.ts +8 -0
  23. package/dist/src/lib/components/TafAvatar/index.d.ts +1 -0
  24. package/dist/src/lib/components/TafForm/TafForm.d.ts +16 -0
  25. package/dist/src/lib/components/TafForm/TafFormButtons/TafFormButtons.d.ts +12 -0
  26. package/dist/src/lib/components/TafForm/TafFormButtons/TafFormOptionsButton.d.ts +11 -0
  27. package/dist/src/lib/components/TafForm/TafFormRow/DragHandle.d.ts +8 -0
  28. package/dist/src/lib/components/TafForm/TafFormRow/TafFormRow.d.ts +4 -0
  29. package/dist/src/lib/components/TafForm/TafFormRow/TafFormTextField.d.ts +30 -0
  30. package/dist/src/lib/components/TafForm/TafFormRow/types.d.ts +31 -0
  31. package/dist/src/lib/components/TafForm/TafFormRow/validations/change.d.ts +4 -0
  32. package/dist/src/lib/components/TafForm/TafFormRow/validations/clouds.d.ts +34 -0
  33. package/dist/src/lib/components/TafForm/TafFormRow/validations/probability.d.ts +2 -0
  34. package/dist/src/lib/components/TafForm/TafFormRow/validations/utils.d.ts +2 -0
  35. package/dist/src/lib/components/TafForm/TafFormRow/validations/validField.d.ts +21 -0
  36. package/dist/src/lib/components/TafForm/TafFormRow/validations/visibility.d.ts +12 -0
  37. package/dist/src/lib/components/TafForm/TafFormRow/validations/weather.d.ts +15 -0
  38. package/dist/src/lib/components/TafForm/TafFormRow/validations/wind.d.ts +16 -0
  39. package/dist/src/lib/components/TafForm/index.d.ts +1 -0
  40. package/dist/src/lib/components/TafForm/utils.d.ts +76 -0
  41. package/dist/src/lib/components/TafHeader/TafHeader.d.ts +8 -0
  42. package/dist/src/lib/components/TafLayout/LocationTabs/LocationTabs.d.ts +10 -0
  43. package/dist/src/lib/components/TafLayout/LocationTabs/index.d.ts +1 -0
  44. package/dist/src/lib/components/TafLayout/TacOverview/AdverseWeatherTacMessage.d.ts +8 -0
  45. package/dist/src/lib/components/TafLayout/TacOverview/ExportButton.d.ts +7 -0
  46. package/dist/src/lib/components/TafLayout/TacOverview/TacContainer.d.ts +13 -0
  47. package/dist/src/lib/components/TafLayout/TacOverview/TacContainerLayout.d.ts +10 -0
  48. package/dist/src/lib/components/TafLayout/TacOverview/TacOverview.d.ts +12 -0
  49. package/dist/src/lib/components/TafLayout/TacOverview/TacOverviewMobile.d.ts +12 -0
  50. package/dist/src/lib/components/TafLayout/TacOverview/index.d.ts +2 -0
  51. package/dist/src/lib/components/TafLayout/TafLayout.d.ts +10 -0
  52. package/dist/src/lib/components/TafLayout/TafPanel/TafPanel.d.ts +23 -0
  53. package/dist/src/lib/components/TafLayout/TafPanel/index.d.ts +1 -0
  54. package/dist/src/lib/components/TafLayout/TopTabs/TopTabs.d.ts +9 -0
  55. package/dist/src/lib/components/TafLayout/TopTabs/index.d.ts +1 -0
  56. package/dist/src/lib/components/TafLayout/utils.d.ts +47 -0
  57. package/dist/src/lib/components/TafModule/TafModule.d.ts +9 -0
  58. package/dist/src/lib/components/TafModule/TafModuleProvider.d.ts +23 -0
  59. package/dist/src/lib/components/TafModule/index.d.ts +1 -0
  60. package/dist/src/lib/components/TafRemarkField/TafRemarkField.d.ts +7 -0
  61. package/dist/src/lib/components/TafRemarkField/index.d.ts +1 -0
  62. package/dist/src/lib/components/TafWrapper/TafConfigWrapper.d.ts +13 -0
  63. package/dist/src/lib/components/TafWrapper/TafWrapper.d.ts +3 -0
  64. package/dist/src/lib/components/TafWrapper/index.d.ts +1 -0
  65. package/dist/src/lib/types.d.ts +173 -0
  66. package/dist/src/lib/utils/dateFormats.d.ts +2 -0
  67. package/dist/src/lib/utils/i18n.d.ts +6 -0
  68. package/dist/src/lib/utils/mockdata/fakeTafConfig.d.ts +2 -0
  69. package/dist/src/lib/utils/mockdata/fakeTafList.d.ts +26 -0
  70. package/dist/src/lib/utils/mockdata/naf/fakeNafConfig.d.ts +2 -0
  71. package/dist/src/lib/utils/mockdata/naf/fakeNafList.d.ts +12 -0
  72. package/dist/src/lib/utils/taf-api/api.d.ts +7 -0
  73. package/dist/src/lib/utils/taf-api/fakeApi.d.ts +4 -0
  74. package/dist/src/lib/utils/taf-api/hooks.d.ts +25 -0
  75. package/dist/src/lib/utils/utils.d.ts +1 -0
  76. package/dist/src/lib/utils/weatherPhenomena.d.ts +422 -0
  77. package/package.json +2 -1
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import type { TafFromBackend } from '../../../types';
3
+ interface TacOverviewProps {
4
+ upcomingTafs: TafFromBackend[];
5
+ currentTafs: TafFromBackend[];
6
+ expiredTafs: TafFromBackend[];
7
+ hideTitle?: boolean;
8
+ activeTaf?: TafFromBackend;
9
+ isFormDisabled?: boolean;
10
+ }
11
+ declare const TacOverview: React.FC<TacOverviewProps>;
12
+ export default TacOverview;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ import type { TafFromBackend } from '../../../types';
3
+ interface TacOverviewMobileProps {
4
+ upcomingTafs: TafFromBackend[];
5
+ currentTafs: TafFromBackend[];
6
+ expiredTafs: TafFromBackend[];
7
+ autoTafs?: TafFromBackend[];
8
+ activeTaf?: TafFromBackend;
9
+ defaultOpen?: boolean;
10
+ }
11
+ declare const TacOverviewMobile: React.FC<TacOverviewMobileProps>;
12
+ export default TacOverviewMobile;
@@ -0,0 +1,2 @@
1
+ export { default as TacOverview } from './TacOverview';
2
+ export { default as TacOverviewMobile } from './TacOverviewMobile';
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { TafFromBackend } from '../../types';
3
+ interface TafLayoutProps {
4
+ tafList: TafFromBackend[];
5
+ onUpdateTaf: () => Promise<void>;
6
+ lastUpdateTime?: string;
7
+ isAutoTafEnabled?: boolean;
8
+ }
9
+ declare const TafLayout: React.FC<TafLayoutProps>;
10
+ export default TafLayout;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import type { TafFromBackend, Taf, TafActions, TafStatus, TafFromFrontEnd } from '../../../types';
3
+ import type { IssuesPanePosition } from '../../IssuesPane/types';
4
+ import type { TafError } from '../utils';
5
+ export declare const fromActionToStatus: (tafAction: TafActions) => TafStatus;
6
+ interface TafPanelProps {
7
+ tafFromBackend: TafFromBackend;
8
+ activeTafIndex: number;
9
+ index: number;
10
+ isLoading?: boolean;
11
+ postTaf?: (taf: TafFromFrontEnd) => Promise<void>;
12
+ patchTaf?: (taf: TafFromFrontEnd) => Promise<boolean>;
13
+ isIssuesPaneOpen?: boolean;
14
+ setIsIssuesPaneOpen?: (isOpen: boolean, position: IssuesPanePosition) => void;
15
+ isFormDisabled?: boolean;
16
+ setIsFormDisabled?: (isDisabled: boolean) => void;
17
+ error?: TafError | null;
18
+ previousTaf: Taf;
19
+ tafAction: TafActions;
20
+ shouldEnableRemark?: boolean;
21
+ }
22
+ declare const TafPanel: React.FC<TafPanelProps>;
23
+ export default TafPanel;
@@ -0,0 +1 @@
1
+ export { default as TafPanel } from './TafPanel';
@@ -0,0 +1,9 @@
1
+ import React from 'react';
2
+ import type { TafFromBackend, TimeSlot } from '../../../types';
3
+ interface TopTabsProps {
4
+ timeSlot: TimeSlot;
5
+ tafFromBackend?: TafFromBackend;
6
+ onChangeTimeSlot?: (timeSlot: TimeSlot, isFormDirty: boolean) => void;
7
+ }
8
+ declare const TopTabs: React.FC<TopTabsProps>;
9
+ export default TopTabs;
@@ -0,0 +1 @@
1
+ export { default as TopTabs } from './TopTabs';
@@ -0,0 +1,47 @@
1
+ import type { AxiosError } from 'axios';
2
+ import type { TFunction } from 'i18next';
3
+ import type { AutoTAFlocations, Taf, TafConfig, TafConfigLocation, TafConfigLocations, TafConfigLocationFixedPeriod, TafConfigLocationDynamicPeriod, TafFromBackend, TafFromFrontEnd, TafStatus, TimeSlot, ForecastType } from '../../types';
4
+ export declare const isTafConfigLocationFixedPeriod: (location: TafConfigLocation) => location is TafConfigLocationFixedPeriod;
5
+ export declare const isTafConfigLocationDynamicPeriod: (location: TafConfigLocation) => location is TafConfigLocationDynamicPeriod;
6
+ export declare const getLocationSetting: (location: string, locationSettings: TafConfigLocations) => TafConfigLocation;
7
+ export declare const sortTafsOnLocation: (tafList?: TafFromBackend[], locationOrder?: string[]) => TafFromBackend[];
8
+ export declare const sortTafsOnIssueDate: (tafList?: TafFromBackend[]) => TafFromBackend[];
9
+ export declare const getBaseTime: (baseTime: string, location: string, tafConfig: TafConfig) => {
10
+ currentBaseTime: Date;
11
+ nextBaseTime: Date;
12
+ };
13
+ /**
14
+ * If we don't have a taf to get the baseTime from, we calculate it based on the current time and the activity_period from the config.
15
+ * @param tafConfig
16
+ * @returns
17
+ */
18
+ export declare const calculateBaseTime: (tafConfig: TafConfig) => {
19
+ currentBaseTime: Date;
20
+ nextBaseTime: Date;
21
+ };
22
+ export declare const getTafTimeSlot: (baseTime: string, location: string, status: TafStatus, tafConfig: TafConfig) => TimeSlot;
23
+ interface TafTimeSlots {
24
+ current: TafFromBackend[];
25
+ upcoming: TafFromBackend[];
26
+ expired: TafFromBackend[];
27
+ }
28
+ export declare const sortTafTimeSlots: (tafList: TafFromBackend[], tafConfig: TafConfig) => TafTimeSlots;
29
+ export declare const muiTabA11yProps: (index: number) => {
30
+ id: string;
31
+ "aria-controls": string;
32
+ };
33
+ export declare const getNewTafLocationIndex: (tafLocations: TafFromBackend[], previousTafLocationUUID: string) => number;
34
+ export declare const getPreviousTaf: (tafList: TafFromBackend[], currentTaf: TafFromBackend) => Taf;
35
+ export declare const getAutoTafLocations: (autoTAFlocations: AutoTAFlocations | undefined) => AutoTAFlocations | null;
36
+ export declare const scrollToPosition: (scrollRef: React.RefObject<HTMLElement | null>, activeLocation: string) => void;
37
+ export declare const formatBaseTime: (time: Date) => string;
38
+ export declare const getSnackbarMessage: (tafFromFrontEnd: TafFromFrontEnd, isAutoSaved: boolean, t: TFunction, forecastType?: ForecastType) => string;
39
+ export interface TafError {
40
+ type: 'CANCELLED' | 'SERVER' | 'WARNING';
41
+ title: string;
42
+ message?: string;
43
+ testId?: string;
44
+ }
45
+ export declare const isWarning: (error: TafError) => boolean;
46
+ export declare const parseErrorMessage: (error: AxiosError | Error, params: TafFromFrontEnd, t: TFunction, forecastType?: ForecastType) => TafError;
47
+ export {};
@@ -0,0 +1,9 @@
1
+ import type { FC } from 'react';
2
+ import type { TafModuleProviderProps } from './TafModuleProvider';
3
+ import type { ForecastType } from '../../types';
4
+ export declare const getCurrentDate: () => string;
5
+ declare const Wrapper: FC<TafModuleProviderProps & {
6
+ isAutoTafEnabled?: boolean;
7
+ forecastType?: ForecastType;
8
+ }>;
9
+ export default Wrapper;
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import type { FieldValues, UseFieldArrayReturn } from 'react-hook-form';
3
+ import type { BaseTaf, TafActions } from '../../types';
4
+ type ValidateFormPromise = () => Promise<void | BaseTaf>;
5
+ interface TafModuleMethods {
6
+ onPreventCloseView?: (shouldPreventClose: boolean) => void;
7
+ }
8
+ interface TafModuleContextState {
9
+ onValidateForm: ValidateFormPromise;
10
+ registerValidateForm: (promiseToRegister: ValidateFormPromise) => void;
11
+ tafAction: TafActions;
12
+ setTafAction: (action: TafActions) => void;
13
+ onPreventCloseView: (shouldPreventClose: boolean) => void;
14
+ useFieldArrayMethods: UseFieldArrayReturn<FieldValues, string>;
15
+ }
16
+ declare const TafModuleContext: React.Context<TafModuleContextState>;
17
+ export declare const useTafModuleContext: () => Partial<TafModuleContextState>;
18
+ export declare const useTafModuleState: ({ onPreventCloseView, }: TafModuleMethods) => TafModuleContextState;
19
+ export interface TafModuleProviderProps extends TafModuleMethods {
20
+ children?: React.ReactNode;
21
+ }
22
+ export declare const TafModuleProvider: React.FC<TafModuleProviderProps>;
23
+ export default TafModuleContext;
@@ -0,0 +1 @@
1
+ export { default as TafModule } from './TafModule';
@@ -0,0 +1,7 @@
1
+ import type { FC } from 'react';
2
+ export interface TafRemarkFieldProps {
3
+ disabled?: boolean;
4
+ isEditor?: boolean;
5
+ }
6
+ declare const TafRemarkField: FC<TafRemarkFieldProps>;
7
+ export default TafRemarkField;
@@ -0,0 +1 @@
1
+ export { default as TafRemarkField } from './TafRemarkField';
@@ -0,0 +1,13 @@
1
+ import React from 'react';
2
+ import type { TafConfig, ForecastType } from '../../types';
3
+ interface TafConfigWrapperContext {
4
+ tafConfig?: TafConfig;
5
+ }
6
+ export declare const TafConfigContext: React.Context<TafConfigWrapperContext>;
7
+ export declare const useTafConfigContext: () => Partial<TafConfigWrapperContext>;
8
+ interface TafConfigWrapperProps {
9
+ children?: React.ReactNode;
10
+ forecastType?: ForecastType;
11
+ }
12
+ declare const TafConfigWrapper: React.FC<TafConfigWrapperProps>;
13
+ export default TafConfigWrapper;
@@ -0,0 +1,3 @@
1
+ import type { TafModuleProviderProps } from '../TafModule/TafModuleProvider';
2
+ declare const TafWrapper: React.FC<TafModuleProviderProps>;
3
+ export default TafWrapper;
@@ -0,0 +1 @@
1
+ export { default as TafWrapper } from './TafWrapper';
@@ -0,0 +1,173 @@
1
+ import type { WeatherPhenomena } from './utils/weatherPhenomena';
2
+ export interface Visibility {
3
+ range: number;
4
+ unit: string;
5
+ }
6
+ export interface Wind {
7
+ direction: number | string;
8
+ speed: number | string;
9
+ gust?: number | string;
10
+ unit: 'KT';
11
+ }
12
+ export type NSW = 'NSW';
13
+ export interface Weather {
14
+ weather1: WeatherPhenomena | NSW;
15
+ weather2?: WeatherPhenomena | NSW;
16
+ weather3?: WeatherPhenomena | NSW;
17
+ }
18
+ export type CloudCoverage = 'FEW' | 'SCT' | 'BKN' | 'OVC';
19
+ export type CloudType = 'CB' | 'TCU';
20
+ export interface Cloud {
21
+ coverage: CloudCoverage;
22
+ height: number | null;
23
+ type?: CloudType;
24
+ }
25
+ export type NSC = 'NSC';
26
+ export interface VerticalVisibility {
27
+ verticalVisibility: number;
28
+ }
29
+ export interface Clouds {
30
+ cloud1: Cloud | VerticalVisibility | NSC;
31
+ cloud2?: Cloud;
32
+ cloud3?: Cloud;
33
+ cloud4?: Cloud;
34
+ }
35
+ export type TafDate = string;
36
+ export interface Valid {
37
+ start: TafDate;
38
+ end?: TafDate;
39
+ }
40
+ export interface BaseForecast {
41
+ valid: Valid;
42
+ visibility?: Visibility;
43
+ wind?: Wind;
44
+ weather?: Weather;
45
+ cloud?: Clouds;
46
+ cavOK?: boolean;
47
+ }
48
+ export type Change = 'TEMPO' | 'BECMG' | 'FM';
49
+ export interface ChangeGroup extends BaseForecast {
50
+ change: Change;
51
+ probability?: 'PROB30' | 'PROB40';
52
+ }
53
+ export type MessageType = 'ORG' | 'AMD' | 'COR' | 'CNL';
54
+ export type NafLocation = 'EHAK' | 'EHFD' | 'EHDV' | 'EHHW' | 'EHKV' | 'EHMG' | 'EHMA' | 'EHQN' | 'EHPG';
55
+ export type Location = 'EHAM' | 'EHRD' | 'EHGG' | 'EHBK' | 'EHLE' | 'TNCB' | NafLocation;
56
+ export type ForecastType = 'TAF' | 'NAF';
57
+ export interface BaseTaf {
58
+ validDateStart: TafDate;
59
+ validDateEnd: TafDate;
60
+ baseTime: TafDate;
61
+ previousId?: string;
62
+ previousValidDateStart?: TafDate;
63
+ previousValidDateEnd?: TafDate;
64
+ location: Location;
65
+ baseForecast: BaseForecast;
66
+ changeGroups?: ChangeGroup[];
67
+ messageType: MessageType;
68
+ remark?: string;
69
+ uuid: string;
70
+ issueDate?: TafDate;
71
+ }
72
+ export type TafStatus = 'NEW' | 'DRAFT' | 'DRAFT_AMENDED' | 'DRAFT_CORRECTED' | 'PUBLISHED' | 'CORRECTED' | 'AMENDED' | 'CANCELLED' | 'EXPIRED' | 'AUTO';
73
+ export type TafActions = 'NEW' | 'DRAFT' | 'DRAFT_AMEND' | 'DRAFT_CORRECT' | 'PUBLISH' | 'CANCEL' | 'CORRECT' | 'AMEND' | 'CLOSE' | 'CLEAR';
74
+ export type TafCanbe = 'DRAFTED' | 'DISCARDED' | 'PUBLISHED' | 'CANCELLED' | 'AMENDED' | 'CORRECTED';
75
+ export interface Taf extends BaseTaf {
76
+ status: TafStatus;
77
+ }
78
+ export interface BaseForecastFormData {
79
+ valid: string;
80
+ visibility?: string;
81
+ wind?: string;
82
+ weather?: WeatherStrings;
83
+ cloud?: CloudStrings;
84
+ cavOK?: boolean;
85
+ }
86
+ export interface ChangeGroupFormData extends BaseForecastFormData {
87
+ probability?: string;
88
+ change: string;
89
+ }
90
+ export interface TafFormData {
91
+ IS_DRAFT?: boolean;
92
+ validDateStart: string;
93
+ validDateEnd: string;
94
+ baseTime: string;
95
+ previousId?: string;
96
+ previousValidDateStart?: string;
97
+ previousValidDateEnd?: string;
98
+ location: Location;
99
+ baseForecast: BaseForecastFormData;
100
+ changeGroups?: ChangeGroupFormData[];
101
+ messageType: MessageType;
102
+ uuid: string;
103
+ issueDate?: string;
104
+ status: TafStatus;
105
+ remark?: string;
106
+ }
107
+ /**
108
+ * Type with TAF info from the backend
109
+ */
110
+ export interface TafFromBackend {
111
+ taf: Taf;
112
+ creationDate: TafDate;
113
+ canbe: TafCanbe[];
114
+ editor: string;
115
+ forecastType: ForecastType;
116
+ }
117
+ /**
118
+ * Type with TAF info sent to the backend
119
+ */
120
+ export interface TafFromFrontEnd {
121
+ taf: Taf;
122
+ changeStatusTo?: TafStatus;
123
+ editor?: string;
124
+ }
125
+ /**
126
+ * TAF (json) settings (libs/taf/src/lib/utils/tafConfig.json)
127
+ */
128
+ export type TafConfigLocation = TafConfigLocationFixedPeriod | TafConfigLocationDynamicPeriod;
129
+ export interface TafConfigLocationFixedPeriod {
130
+ validity_duration: number;
131
+ activity_period: number;
132
+ label: string;
133
+ }
134
+ export interface TafConfigLocationDynamicPeriod {
135
+ valid_durations: number[];
136
+ valid_start_times: number[];
137
+ label: string;
138
+ }
139
+ export type TafConfigLocations = Record<string, TafConfigLocation>;
140
+ export type AutoTAFlocations = string[];
141
+ export interface TafConfig {
142
+ location_indicator_mwo: string;
143
+ locations: TafConfigLocations;
144
+ locationOrder: string[];
145
+ autoTAFlocations?: AutoTAFlocations;
146
+ shouldEnableRemark?: boolean;
147
+ forecastType: ForecastType;
148
+ }
149
+ export type TimeSlot = 'UPCOMING' | 'ACTIVE' | 'EXPIRED';
150
+ export interface AdverseWeatherTAC {
151
+ tac: {
152
+ text: string;
153
+ type?: string;
154
+ }[][];
155
+ }
156
+ export type TAC = string | AdverseWeatherTAC;
157
+ export interface CloudStrings {
158
+ cloud1: string;
159
+ cloud2?: string;
160
+ cloud3?: string;
161
+ cloud4?: string;
162
+ }
163
+ export interface WeatherStrings {
164
+ weather1: string;
165
+ weather2?: string;
166
+ weather3?: string;
167
+ }
168
+ export interface ConfigKey {
169
+ key: string;
170
+ size: number;
171
+ minSize?: number;
172
+ maxSize?: number;
173
+ }
@@ -0,0 +1,2 @@
1
+ export declare const DATE_FORMAT_ISSUE_TIME = "ddHHmm'Z";
2
+ export declare const DATE_FORMAT_BASE_TIME = "HH:mm dd MMM";
@@ -0,0 +1,6 @@
1
+ import i18n from 'i18next';
2
+ import type { UseTranslationResponse } from 'react-i18next';
3
+ export declare const TAF_NAMESPACE = "taf";
4
+ export declare const initTafI18n: () => void;
5
+ export declare const translateInTestsAndStories: (key: string, params?: Record<string, string | number> | undefined) => string;
6
+ export declare const useTafTranslation: () => UseTranslationResponse<typeof TAF_NAMESPACE, typeof i18n>;
@@ -0,0 +1,2 @@
1
+ import type { TafConfig } from '../../types';
2
+ export declare const fakeTafConfig: TafConfig;
@@ -0,0 +1,26 @@
1
+ import type { TafFromBackend } from '../../types';
2
+ export declare const MOCK_USERNAME = "user.name";
3
+ export declare const fakeTafList: TafFromBackend[];
4
+ export declare const fakeNewTaf: TafFromBackend;
5
+ export declare const fakeNewFixedTaf: TafFromBackend;
6
+ export declare const fakeExpiredTaf: TafFromBackend;
7
+ export declare const fakePublishedTaf: TafFromBackend;
8
+ export declare const fakePublishedFixedTaf: TafFromBackend;
9
+ export declare const fakePublishedTafWithoutChangeGroups: TafFromBackend;
10
+ export declare const fakeCancelledTaf: TafFromBackend;
11
+ export declare const fakeDraftTaf: TafFromBackend;
12
+ export declare const fakeDraftFixedTaf: TafFromBackend;
13
+ export declare const fakeDraftAmendmentTaf: TafFromBackend;
14
+ export declare const fakeDraftCorrectedTaf: TafFromBackend;
15
+ export declare const fakeDraftAmendmentFixedTaf: TafFromBackend;
16
+ export declare const previousTafForfakeDraftAmendmentFixedTaf: TafFromBackend;
17
+ export declare const fakeAmendmentTaf: TafFromBackend;
18
+ export declare const fakeCorrectedTaf: TafFromBackend;
19
+ export declare const fakeAmendmentFixedTaf: TafFromBackend;
20
+ export declare const fakeCancelledFixedTaf: TafFromBackend;
21
+ export declare const fakeFixedTafList: TafFromBackend[];
22
+ export declare const fakePublishedTafWithChangeGroups: TafFromBackend;
23
+ export declare const fakeDraftTafWithSameDates: TafFromBackend;
24
+ export declare const fakeDraftTafWithSameDatesFixed: TafFromBackend;
25
+ export declare const fakeDraftTafWithFM: TafFromBackend;
26
+ export declare const fakeCurrentTaf: TafFromBackend;
@@ -0,0 +1,2 @@
1
+ import type { TafConfig } from '../../../types';
2
+ export declare const fakeNafConfig: TafConfig;
@@ -0,0 +1,12 @@
1
+ import type { TafFromBackend } from '../../../types';
2
+ export declare const MOCK_USERNAME = "user.name";
3
+ export declare const fakeNafList: TafFromBackend[];
4
+ export declare const fakeFixedNaf: TafFromBackend;
5
+ export declare const fakeLastInDayNaf: TafFromBackend;
6
+ export declare const fakeNewFixedNaf: TafFromBackend;
7
+ export declare const fakeDraftFixedNaf: TafFromBackend;
8
+ export declare const fakePublishedFixedNaf: TafFromBackend;
9
+ export declare const fakeDraftAmendmentFixedNaf: TafFromBackend;
10
+ export declare const fakeAmendmentFixedNaf: TafFromBackend;
11
+ export declare const fakeCancelledFixedNaf: TafFromBackend;
12
+ export declare const fakeFixedNafList: TafFromBackend[];
@@ -0,0 +1,7 @@
1
+ import type { Credentials } from '@opengeoweb/authentication';
2
+ import type { TAC, Taf, TafConfig, TafFromBackend, TafFromFrontEnd, ForecastType } from '../../types';
3
+ export declare const getTafList: (auth: Credentials, forecastType?: ForecastType) => Promise<TafFromBackend[]>;
4
+ export declare const postTaf: (auth: Credentials, data: TafFromFrontEnd) => Promise<Response>;
5
+ export declare const patchTaf: (auth: Credentials, data: TafFromFrontEnd, force?: boolean) => Promise<Response>;
6
+ export declare const getTAC: (auth: Credentials, data: Taf, forecastType?: ForecastType) => Promise<TAC>;
7
+ export declare const getTafConfig: (auth: Credentials, forecastType?: ForecastType) => Promise<TafConfig>;
@@ -0,0 +1,4 @@
1
+ import type { AdverseWeatherTAC } from '../../types';
2
+ export declare const fakeTafTac = "TAF EHAM 0812/0918 20020G35KT 0500 SN BKN040 BECMG 0814/0816 0700 BKN001=";
3
+ export declare const fakeTafTacJson: AdverseWeatherTAC;
4
+ export declare const tafEndPoints: import("msw").HttpHandler[];
@@ -0,0 +1,25 @@
1
+ import type { UseMutationResult, UseQueryResult } from '@tanstack/react-query';
2
+ import type { TafError } from '../../components/TafLayout/utils';
3
+ import type { TAC, Taf, TafFromBackend, TafFromFrontEnd, TafConfig, ForecastType } from '../../types';
4
+ export declare const useTafList: (type?: ForecastType, disabled?: boolean) => UseQueryResult<TafFromBackend[]>;
5
+ export declare const useTafConfig: (type?: ForecastType, disabled?: boolean) => UseQueryResult<TafConfig>;
6
+ type PostReturnType<T> = UseMutationResult<Response | null, Error, T>;
7
+ interface PostTafProps {
8
+ tafData: TafFromFrontEnd;
9
+ isAutoSaved: boolean;
10
+ setError: React.Dispatch<React.SetStateAction<TafError | null>>;
11
+ }
12
+ export declare const usePostTaf: (forecastType?: ForecastType) => PostReturnType<PostTafProps>;
13
+ type PatchReturnType<T> = UseMutationResult<Response | null, Error, T>;
14
+ interface PatchTafProps {
15
+ tafData: TafFromFrontEnd;
16
+ setError: React.Dispatch<React.SetStateAction<TafError | null>>;
17
+ force?: boolean;
18
+ }
19
+ export declare const usePatchTaf: (forecastType?: ForecastType) => PatchReturnType<PatchTafProps>;
20
+ type GetTACReturnType<T> = UseMutationResult<TAC, Error, T>;
21
+ interface GetTACProps {
22
+ tafData: Taf;
23
+ }
24
+ export declare const useGetTAC: (forecastType?: ForecastType) => GetTACReturnType<GetTACProps>;
25
+ export {};
@@ -0,0 +1 @@
1
+ export declare const getCurrentUrlLocation: (url: string, appUrl: string) => string;