@forgebuild/sidon-booking-widget 4.0.4 → 4.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.
@@ -1,124 +1,127 @@
1
- // Hand-written typings for <sidon-booking-widget> and <sidon-berth-map>.
2
- // The entry modules only register the elements (side-effect imports), so
3
- // generated declarations come out as an empty `export {}`. The build copies
4
- // this file verbatim to dist/elements.d.ts and both entry .d.ts files
5
- // re-export it (scripts/write-element-types.mjs), which is why it imports
6
- // nothing: a relative import would dangle in dist/.
7
- //
8
- // Keep it in step with the `props` blocks in BookingWidget.svelte and
9
- // BerthMap.svelte and the events they emit. `npm run check` skips .d.ts
10
- // files (skipLibCheck), so check an edit with:
11
- // npx tsc --ignoreConfig --noEmit --skipLibCheck false --lib es2023,dom src/elements.d.ts
12
-
13
- /** Peer-marina logo pin. Mirrors OtherMarina in lib/types.ts. */
14
- export interface OtherMarina {
15
- name: string;
16
- lat: number;
17
- lng: number;
18
- logoMark: string | null;
19
- /** Always host-supplied: the package owns no site's routing. */
20
- href: string | null;
21
- }
22
-
23
- /** OTA booking status. An expired booking reports `cancelled`. */
24
- export type SidonBookingStatus = 'hold' | 'pending' | 'confirmed' | 'declined' | 'cancelled';
25
-
26
- /** 1 Documents, 2 Details, 3 Payment, 4 Booking. */
27
- export interface SidonStepChangeDetail { step: 1 | 2 | 3 | 4 }
28
- /** The booking widget fires this from the wizard only, never in booking-page mode. */
29
- export interface SidonLoaChangeDetail { loa: number }
30
- /** `bookingId` is OTA's booking UUID, `marina` the marina slug. */
31
- export interface SidonBookedDetail { bookingId: string; marina: string }
32
- export interface SidonBookingStatusDetail { bookingId: string; status: SidonBookingStatus }
33
- /** A berth label, or null when deselected. */
34
- export interface SidonBerthSelectedDetail { berthId: string | null }
35
- /** Dates are `YYYY-MM-DD`; `berth` is a berth label. */
36
- export interface SidonQuickbookSubmitDetail { from: string | null; to: string | null; length: number; berth: string | null }
37
-
38
- // Element properties mirror the attributes, camelCased; optional like them.
39
- export interface SidonBookingWidgetElement extends HTMLElement {
40
- /** OTA marina slug. */
41
- marina?: string;
42
- /** '' (default) = this page's origin, where the forwarder route lives. */
43
- apiOrigin?: string;
44
- from?: string;
45
- to?: string;
46
- length?: number;
47
- berth?: string;
48
- /** en/it/fr/es (first two letters). Unset: the wizard is English and the
49
- booking page follows the booking's own locale. */
50
- locale?: string;
51
- currencySymbol?: string;
52
- variant?: 'navy' | 'dark';
53
- /** Present (even empty) = booking-page mode; a value overrides `?booking=`. */
54
- bookingId?: string | null;
55
- mapsApiKey?: string;
56
- mapStyle?: 'chart' | 'coastal';
57
- mapHeight?: string;
58
- mapWidth?: string;
59
- mapGap?: string;
60
- width?: string;
61
- layout?: 'stacked' | 'overlay';
62
- logoMark?: string | null;
63
- marinaName?: string;
64
- otherMarinas?: OtherMarina[];
65
- /** Sidon's origin for the Documents step's sign-in popup; defaults to https://sidonmarine.uk. */
66
- sidonOrigin?: string;
67
- /** Origin serving OTA's /api/sailor/documents; '' (default) = this page's origin. */
68
- sailorApiOrigin?: string;
69
- }
70
-
71
- export interface SidonBerthMapElement extends HTMLElement {
72
- /** OTA marina slug. */
73
- marina?: string;
74
- mapsApiKey?: string;
75
- /** '' (default) = this page's origin, where the forwarder route lives. */
76
- apiOrigin?: string;
77
- mapStyle?: 'chart' | 'coastal';
78
- locale?: string;
79
- currencySymbol?: string;
80
- from?: string;
81
- to?: string;
82
- length?: number;
83
- berth?: string;
84
- /** 'staff' (the OTA dashboard): every listed berth is clickable and fires
85
- sidon-berth-selected, occupied berths are painted for [from, to), and
86
- from/to follow their attributes. No card, availability or boat-length
87
- checks. Default 'guest'. */
88
- mode?: 'guest' | 'staff';
89
- /** Re-reads the map payload. Undefined until the element has mounted
90
- (a microtask after it is connected), so call `el.refresh?.()`. */
91
- readonly refresh?: () => void;
92
- bookPath?: string;
93
- logoMark?: string | null;
94
- marinaName?: string;
95
- otherMarinas?: OtherMarina[];
96
- mapHeight?: string;
97
- showWeather?: boolean;
98
- eyebrow?: string;
99
- cardTitle?: string;
100
- intro?: string;
101
- rangeLabel?: string;
102
- rangePlaceholder?: string;
103
- lengthLabel?: string;
104
- selectedLabel?: string;
105
- selectedPlaceholder?: string;
106
- ctaLabel?: string;
107
- }
108
-
109
- declare global {
110
- interface HTMLElementTagNameMap {
111
- 'sidon-booking-widget': SidonBookingWidgetElement;
112
- 'sidon-berth-map': SidonBerthMapElement;
113
- }
114
- // Dispatched with bubbles + composed, so listeners on any ancestor
115
- // element get the typed detail too.
116
- interface HTMLElementEventMap {
117
- 'sidon-step-change': CustomEvent<SidonStepChangeDetail>;
118
- 'sidon-loa-change': CustomEvent<SidonLoaChangeDetail>;
119
- 'sidon-booked': CustomEvent<SidonBookedDetail>;
120
- 'sidon-booking-status': CustomEvent<SidonBookingStatusDetail>;
121
- 'sidon-berth-selected': CustomEvent<SidonBerthSelectedDetail>;
122
- 'sidon-quickbook-submit': CustomEvent<SidonQuickbookSubmitDetail>;
123
- }
124
- }
1
+ // Hand-written typings for <sidon-booking-widget> and <sidon-berth-map>.
2
+ // The entry modules only register the elements (side-effect imports), so
3
+ // generated declarations come out as an empty `export {}`. The build copies
4
+ // this file verbatim to dist/elements.d.ts and both entry .d.ts files
5
+ // re-export it (scripts/write-element-types.mjs), which is why it imports
6
+ // nothing: a relative import would dangle in dist/.
7
+ //
8
+ // Keep it in step with the `props` blocks in BookingWidget.svelte and
9
+ // BerthMap.svelte and the events they emit. `npm run check` skips .d.ts
10
+ // files (skipLibCheck), so check an edit with:
11
+ // npx tsc --ignoreConfig --noEmit --skipLibCheck false --lib es2023,dom src/elements.d.ts
12
+
13
+ /** Peer-marina logo pin. Mirrors OtherMarina in lib/types.ts. */
14
+ export interface OtherMarina {
15
+ name: string;
16
+ lat: number;
17
+ lng: number;
18
+ logoMark: string | null;
19
+ /** Always host-supplied: the package owns no site's routing. */
20
+ href: string | null;
21
+ }
22
+
23
+ /** OTA booking status. An expired booking reports `cancelled`. */
24
+ export type SidonBookingStatus = 'hold' | 'pending' | 'confirmed' | 'declined' | 'cancelled';
25
+
26
+ /** 1 Documents, 2 Details, 3 Payment, 4 Booking. */
27
+ export interface SidonStepChangeDetail { step: 1 | 2 | 3 | 4 }
28
+ /** The booking widget fires this from the wizard only, never in booking-page mode. */
29
+ export interface SidonLoaChangeDetail { loa: number }
30
+ /** `bookingId` is OTA's booking UUID, `marina` the marina slug. */
31
+ export interface SidonBookedDetail { bookingId: string; marina: string }
32
+ export interface SidonBookingStatusDetail { bookingId: string; status: SidonBookingStatus }
33
+ /** A berth label, or null when deselected. */
34
+ export interface SidonBerthSelectedDetail { berthId: string | null }
35
+ /** Dates are `YYYY-MM-DD`; `berth` is a berth label. */
36
+ export interface SidonQuickbookSubmitDetail { from: string | null; to: string | null; length: number; berth: string | null }
37
+
38
+ // Element properties mirror the attributes, camelCased; optional like them.
39
+ export interface SidonBookingWidgetElement extends HTMLElement {
40
+ /** OTA marina slug. */
41
+ marina?: string;
42
+ /** '' (default) = this page's origin, where the forwarder route lives. */
43
+ apiOrigin?: string;
44
+ from?: string;
45
+ to?: string;
46
+ length?: number;
47
+ berth?: string;
48
+ /** en/it/fr/es (first two letters). Unset: the wizard is English and the
49
+ booking page follows the booking's own locale. */
50
+ locale?: string;
51
+ currencySymbol?: string;
52
+ variant?: 'navy' | 'dark';
53
+ /** Present (even empty) = booking-page mode; a value overrides `?booking=`. */
54
+ bookingId?: string | null;
55
+ mapsApiKey?: string;
56
+ mapStyle?: 'chart' | 'coastal';
57
+ mapHeight?: string;
58
+ mapWidth?: string;
59
+ mapGap?: string;
60
+ width?: string;
61
+ layout?: 'stacked' | 'overlay';
62
+ logoMark?: string | null;
63
+ marinaName?: string;
64
+ otherMarinas?: OtherMarina[];
65
+ /** Sidon's origin for the Documents step's sign-in popup; defaults to https://sidonmarine.uk. */
66
+ sidonOrigin?: string;
67
+ /** Size in px of Sidon's sign-in window; default 480 x 720. */
68
+ signInWidth?: number;
69
+ signInHeight?: number;
70
+ /** Origin serving OTA's /api/sailor/documents; '' (default) = this page's origin. */
71
+ sailorApiOrigin?: string;
72
+ }
73
+
74
+ export interface SidonBerthMapElement extends HTMLElement {
75
+ /** OTA marina slug. */
76
+ marina?: string;
77
+ mapsApiKey?: string;
78
+ /** '' (default) = this page's origin, where the forwarder route lives. */
79
+ apiOrigin?: string;
80
+ mapStyle?: 'chart' | 'coastal';
81
+ locale?: string;
82
+ currencySymbol?: string;
83
+ from?: string;
84
+ to?: string;
85
+ length?: number;
86
+ berth?: string;
87
+ /** 'staff' (the OTA dashboard): every listed berth is clickable and fires
88
+ sidon-berth-selected, occupied berths are painted for [from, to), and
89
+ from/to follow their attributes. No card, availability or boat-length
90
+ checks. Default 'guest'. */
91
+ mode?: 'guest' | 'staff';
92
+ /** Re-reads the map payload. Undefined until the element has mounted
93
+ (a microtask after it is connected), so call `el.refresh?.()`. */
94
+ readonly refresh?: () => void;
95
+ bookPath?: string;
96
+ logoMark?: string | null;
97
+ marinaName?: string;
98
+ otherMarinas?: OtherMarina[];
99
+ mapHeight?: string;
100
+ showWeather?: boolean;
101
+ eyebrow?: string;
102
+ cardTitle?: string;
103
+ intro?: string;
104
+ rangeLabel?: string;
105
+ rangePlaceholder?: string;
106
+ lengthLabel?: string;
107
+ selectedLabel?: string;
108
+ selectedPlaceholder?: string;
109
+ ctaLabel?: string;
110
+ }
111
+
112
+ declare global {
113
+ interface HTMLElementTagNameMap {
114
+ 'sidon-booking-widget': SidonBookingWidgetElement;
115
+ 'sidon-berth-map': SidonBerthMapElement;
116
+ }
117
+ // Dispatched with bubbles + composed, so listeners on any ancestor
118
+ // element get the typed detail too.
119
+ interface HTMLElementEventMap {
120
+ 'sidon-step-change': CustomEvent<SidonStepChangeDetail>;
121
+ 'sidon-loa-change': CustomEvent<SidonLoaChangeDetail>;
122
+ 'sidon-booked': CustomEvent<SidonBookedDetail>;
123
+ 'sidon-booking-status': CustomEvent<SidonBookingStatusDetail>;
124
+ 'sidon-berth-selected': CustomEvent<SidonBerthSelectedDetail>;
125
+ 'sidon-quickbook-submit': CustomEvent<SidonQuickbookSubmitDetail>;
126
+ }
127
+ }