@cosmicds/vue-toolkit 0.3.0 → 0.4.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 +20 -1
- package/dist/index.common.js +737 -628
- package/dist/index.umd.js +737 -628
- package/dist/index.umd.min.js +4 -4
- package/dist/src/background.d.ts +4 -0
- package/dist/src/components/CreditLogos.vue.d.ts +14 -9
- package/dist/src/components/Gallery.vue.d.ts +2 -2
- package/dist/src/components/GeolocationButton.vue.d.ts +5 -21
- package/dist/src/components/IconButton.vue.d.ts +9 -11
- package/dist/src/components/LocationSelector.vue.d.ts +6 -6
- package/dist/src/components/WwtHud.vue.d.ts +3 -3
- package/dist/src/composables.d.ts +15 -7
- package/dist/src/geolocation.d.ts +6 -0
- package/dist/src/index.d.ts +2 -2
- package/dist/src/keyboard.d.ts +35 -2
- package/dist/src/mapbox.d.ts +55 -3
- package/dist/src/stories/CreditLogos.stories.d.ts +6 -0
- package/dist/src/stories/FundingAcknowledgement.stories.d.ts +6 -0
- package/dist/src/stories/Gallery.stories.d.ts +6 -0
- package/dist/src/stories/IconButton.stories.d.ts +6 -0
- package/dist/src/stories/LocationSelector.stories.d.ts +6 -0
- package/dist/src/stories/WwtHud.stories.d.ts +6 -0
- package/dist/src/types.d.ts +123 -4
- package/dist/src/utils.d.ts +24 -2
- package/dist/src/wwt-utils.d.ts +6 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +29 -3
- package/src/background.ts +4 -0
- package/src/composables.ts +14 -1
- package/src/geolocation.ts +12 -0
- package/src/index.ts +2 -1
- package/src/keyboard.ts +36 -2
- package/src/mapbox.ts +74 -8
- package/src/types.ts +127 -5
- package/src/utils.ts +24 -4
- package/src/wwt-utils.ts +6 -0
package/dist/src/background.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
/** Class representing a background imageset for WorldWide Telescope */
|
|
1
2
|
export declare class BackgroundImageset {
|
|
3
|
+
/** The outward-facing name to use for the imageset in a story */
|
|
2
4
|
imagesetName: string;
|
|
5
|
+
/** The name of the imageset object inside WorldWide Telescope */
|
|
3
6
|
displayName: string;
|
|
4
7
|
constructor(displayName: string, imagesetName: string);
|
|
5
8
|
}
|
|
9
|
+
/** A default list of `BackgroundImagset` objects to use within data stories */
|
|
6
10
|
export declare const skyBackgroundImagesets: BackgroundImageset[];
|
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{
|
|
2
|
-
visible: {
|
|
3
|
-
type: BooleanConstructor;
|
|
4
|
-
default: boolean;
|
|
5
|
-
};
|
|
6
2
|
logoSize: {
|
|
7
3
|
default: string;
|
|
8
4
|
};
|
|
5
|
+
extraLogos: {
|
|
6
|
+
default: () => never[];
|
|
7
|
+
};
|
|
8
|
+
defaultLogos: {
|
|
9
|
+
default: () => string[];
|
|
10
|
+
};
|
|
9
11
|
}, (_ctx: any, _cache: any) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
10
12
|
[key: string]: any;
|
|
11
13
|
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
12
|
-
visible: {
|
|
13
|
-
type: BooleanConstructor;
|
|
14
|
-
default: boolean;
|
|
15
|
-
};
|
|
16
14
|
logoSize: {
|
|
17
15
|
default: string;
|
|
18
16
|
};
|
|
17
|
+
extraLogos: {
|
|
18
|
+
default: () => never[];
|
|
19
|
+
};
|
|
20
|
+
defaultLogos: {
|
|
21
|
+
default: () => string[];
|
|
22
|
+
};
|
|
19
23
|
}>>, {
|
|
20
|
-
visible: boolean;
|
|
21
24
|
logoSize: string;
|
|
25
|
+
extraLogos: never[];
|
|
26
|
+
defaultLogos: string[];
|
|
22
27
|
}, {}>;
|
|
23
28
|
export default _default;
|
|
@@ -67,10 +67,10 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
67
67
|
onDeselect?: ((...args: any[]) => any) | undefined;
|
|
68
68
|
onListAllSelected?: ((...args: any[]) => any) | undefined;
|
|
69
69
|
}, {
|
|
70
|
-
|
|
70
|
+
columns: string;
|
|
71
71
|
width: string;
|
|
72
|
+
maxHeight: string;
|
|
72
73
|
title: string;
|
|
73
|
-
columns: string;
|
|
74
74
|
selectedColor: string;
|
|
75
75
|
singleSelect: boolean;
|
|
76
76
|
highlightLastOnly: boolean;
|
|
@@ -2,10 +2,6 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
2
2
|
color: {
|
|
3
3
|
default: string;
|
|
4
4
|
};
|
|
5
|
-
disabled: {
|
|
6
|
-
type: BooleanConstructor;
|
|
7
|
-
default: boolean;
|
|
8
|
-
};
|
|
9
5
|
size: {
|
|
10
6
|
default: string;
|
|
11
7
|
};
|
|
@@ -52,23 +48,16 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
52
48
|
falseIcon: {
|
|
53
49
|
default: string;
|
|
54
50
|
};
|
|
55
|
-
backgroundColor: {
|
|
56
|
-
default: string;
|
|
57
|
-
};
|
|
58
51
|
showPermissions: {
|
|
59
52
|
type: BooleanConstructor;
|
|
60
53
|
default: boolean;
|
|
61
54
|
};
|
|
62
55
|
}, (_ctx: any, _cache: any) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
63
56
|
[key: string]: any;
|
|
64
|
-
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
57
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("error" | "geolocation" | "permission")[], "error" | "geolocation" | "permission", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
65
58
|
color: {
|
|
66
59
|
default: string;
|
|
67
60
|
};
|
|
68
|
-
disabled: {
|
|
69
|
-
type: BooleanConstructor;
|
|
70
|
-
default: boolean;
|
|
71
|
-
};
|
|
72
61
|
size: {
|
|
73
62
|
default: string;
|
|
74
63
|
};
|
|
@@ -115,21 +104,18 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
115
104
|
falseIcon: {
|
|
116
105
|
default: string;
|
|
117
106
|
};
|
|
118
|
-
backgroundColor: {
|
|
119
|
-
default: string;
|
|
120
|
-
};
|
|
121
107
|
showPermissions: {
|
|
122
108
|
type: BooleanConstructor;
|
|
123
109
|
default: boolean;
|
|
124
110
|
};
|
|
125
111
|
}>> & {
|
|
126
|
-
onPermission?: ((...args: any[]) => any) | undefined;
|
|
127
|
-
onGeolocation?: ((...args: any[]) => any) | undefined;
|
|
128
112
|
onError?: ((...args: any[]) => any) | undefined;
|
|
113
|
+
onGeolocation?: ((...args: any[]) => any) | undefined;
|
|
114
|
+
onPermission?: ((...args: any[]) => any) | undefined;
|
|
129
115
|
}, {
|
|
130
|
-
color: string;
|
|
131
|
-
disabled: boolean;
|
|
132
116
|
size: string;
|
|
117
|
+
color: string;
|
|
118
|
+
label: string;
|
|
133
119
|
density: string;
|
|
134
120
|
elevation: string;
|
|
135
121
|
hideButton: boolean;
|
|
@@ -139,10 +125,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
139
125
|
showProgressCircle: boolean;
|
|
140
126
|
useTextButton: boolean;
|
|
141
127
|
progressCircleSize: number;
|
|
142
|
-
label: string;
|
|
143
128
|
trueIcon: string;
|
|
144
129
|
falseIcon: string;
|
|
145
|
-
backgroundColor: string;
|
|
146
130
|
showPermissions: boolean;
|
|
147
131
|
}, {}>;
|
|
148
132
|
export default _default;
|
|
@@ -10,12 +10,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
10
10
|
focusColor: {
|
|
11
11
|
default: string;
|
|
12
12
|
};
|
|
13
|
-
|
|
13
|
+
activeColor: {
|
|
14
14
|
default: string;
|
|
15
15
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
default: boolean;
|
|
16
|
+
backgroundColor: {
|
|
17
|
+
default: string;
|
|
19
18
|
};
|
|
20
19
|
border: {
|
|
21
20
|
type: BooleanConstructor;
|
|
@@ -67,12 +66,11 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
67
66
|
focusColor: {
|
|
68
67
|
default: string;
|
|
69
68
|
};
|
|
70
|
-
|
|
69
|
+
activeColor: {
|
|
71
70
|
default: string;
|
|
72
71
|
};
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
default: boolean;
|
|
72
|
+
backgroundColor: {
|
|
73
|
+
default: string;
|
|
76
74
|
};
|
|
77
75
|
border: {
|
|
78
76
|
type: BooleanConstructor;
|
|
@@ -114,20 +112,20 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
114
112
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
115
113
|
onActivate?: ((...args: any[]) => any) | undefined;
|
|
116
114
|
}, {
|
|
115
|
+
border: boolean;
|
|
117
116
|
color: string;
|
|
118
117
|
backgroundColor: string;
|
|
119
|
-
border: boolean;
|
|
120
118
|
modelValue: boolean;
|
|
121
119
|
focusColor: string;
|
|
122
|
-
boxShadow: boolean;
|
|
123
120
|
longPressTimeMs: number;
|
|
124
121
|
tooltipLocation: string;
|
|
125
122
|
tooltipOnClick: boolean;
|
|
126
123
|
tooltipOnFocus: boolean;
|
|
127
124
|
tooltipOnHover: boolean;
|
|
128
|
-
tooltipOffset: number;
|
|
129
125
|
showTooltip: boolean;
|
|
130
126
|
faSize: string;
|
|
131
127
|
mdSize: string;
|
|
128
|
+
activeColor: string;
|
|
129
|
+
tooltipOffset: number;
|
|
132
130
|
}, {}>;
|
|
133
131
|
export default _default;
|
|
@@ -56,7 +56,7 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
56
56
|
};
|
|
57
57
|
}, (_ctx: any, _cache: any) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
58
58
|
[key: string]: any;
|
|
59
|
-
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("
|
|
59
|
+
}>, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, ("place" | "error" | "update:modelValue" | "mapReady")[], "place" | "error" | "update:modelValue" | "mapReady", import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
60
60
|
activatorColor: {
|
|
61
61
|
default: string;
|
|
62
62
|
};
|
|
@@ -110,9 +110,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
110
110
|
default: () => never[];
|
|
111
111
|
};
|
|
112
112
|
}>> & {
|
|
113
|
-
onError?: ((...args: any[]) => any) | undefined;
|
|
114
113
|
"onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
|
|
115
114
|
onPlace?: ((...args: any[]) => any) | undefined;
|
|
115
|
+
onError?: ((...args: any[]) => any) | undefined;
|
|
116
116
|
onMapReady?: ((...args: any[]) => any) | undefined;
|
|
117
117
|
}, {
|
|
118
118
|
modelValue: {
|
|
@@ -121,19 +121,19 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
121
121
|
};
|
|
122
122
|
activatorColor: string;
|
|
123
123
|
detectLocation: boolean;
|
|
124
|
+
placeSelectable: boolean;
|
|
125
|
+
selectable: boolean;
|
|
126
|
+
selectionEvent: string;
|
|
127
|
+
worldRadii: boolean;
|
|
124
128
|
mapOptions: LeafletMapOptions;
|
|
125
129
|
places: never[];
|
|
126
130
|
placeCircleOptions: L.CircleMarkerOptions;
|
|
127
|
-
placeSelectable: boolean;
|
|
128
|
-
selectable: boolean;
|
|
129
131
|
selectedCircleOptions: {
|
|
130
132
|
color: string;
|
|
131
133
|
fillColor: string;
|
|
132
134
|
fillOpacity: number;
|
|
133
135
|
radius: number;
|
|
134
136
|
};
|
|
135
|
-
selectionEvent: string;
|
|
136
|
-
worldRadii: boolean;
|
|
137
137
|
geoJsonFiles: never[];
|
|
138
138
|
layers: never[];
|
|
139
139
|
}, {}>;
|
|
@@ -53,17 +53,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
53
53
|
};
|
|
54
54
|
store: {};
|
|
55
55
|
}>>, {
|
|
56
|
-
backgroundColor: string;
|
|
57
56
|
location: {
|
|
58
57
|
top: string;
|
|
59
58
|
left: string;
|
|
60
59
|
};
|
|
60
|
+
backgroundColor: string;
|
|
61
|
+
fontSize: string;
|
|
62
|
+
textShadow: string;
|
|
61
63
|
offsetCenter: {
|
|
62
64
|
x: number;
|
|
63
65
|
y: number;
|
|
64
66
|
};
|
|
65
67
|
otherVariables: {};
|
|
66
|
-
fontSize: string;
|
|
67
|
-
textShadow: string;
|
|
68
68
|
}, {}>;
|
|
69
69
|
export default _default;
|
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
import { Ref } from "vue";
|
|
2
|
+
/**
|
|
3
|
+
* A composable that encapsulates fullscreen behavior.
|
|
4
|
+
* @returns A reactive variable indicating whether or not fullscreen mode is active
|
|
5
|
+
*/
|
|
2
6
|
export declare function useFullscreen(): Ref<boolean>;
|
|
7
|
+
/** Interface describing the shape of a browser window */
|
|
3
8
|
export interface WindowShape {
|
|
4
9
|
width: number;
|
|
5
10
|
height: number;
|
|
6
11
|
}
|
|
12
|
+
/** A default `WindowShape` to use */
|
|
7
13
|
export declare const defaultWindowShape: {
|
|
8
14
|
width: number;
|
|
9
15
|
height: number;
|
|
10
16
|
};
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
17
|
+
/**
|
|
18
|
+
* A composable that encapsulates a changing window shape.
|
|
19
|
+
*
|
|
20
|
+
* @returns A reactive variable describing the current window shape.
|
|
21
|
+
*/
|
|
22
|
+
export declare function useWindowShape(): Ref<{
|
|
23
|
+
width: number;
|
|
24
|
+
height: number;
|
|
25
|
+
}>;
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { Position } from "@capacitor/geolocation";
|
|
2
2
|
export type PositionCoords = Position['coords'];
|
|
3
|
+
/**
|
|
4
|
+
* A composable that encapsulates the current state of the browser
|
|
5
|
+
* geolocation position and permission status.
|
|
6
|
+
* @param onStartup - Whether or not to query the user's geolocation on startup.
|
|
7
|
+
* @returns Reactive state describing the geolocation
|
|
8
|
+
*/
|
|
3
9
|
export declare function useGeolocation(onStartup?: boolean): {
|
|
4
10
|
geolocation: import("vue").Ref<{
|
|
5
11
|
latitude: number;
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BackgroundImageset, skyBackgroundImagesets } from "./background";
|
|
2
2
|
import { useFullscreen, useWindowShape, WindowShape } from "./composables";
|
|
3
3
|
import { PositionCoords, useGeolocation } from "./geolocation";
|
|
4
|
-
import { KeyboardControlSettings } from "./keyboard";
|
|
4
|
+
import { KeyPressInfo, KeyboardControlSettings } from "./keyboard";
|
|
5
5
|
import { useWWTKeyboardControls } from "./wwt-utils";
|
|
6
6
|
import IconButton from "./components/IconButton.vue";
|
|
7
7
|
import LocationSelector from "./components/LocationSelector.vue";
|
|
@@ -10,6 +10,6 @@ import CreditLogos from "./components/CreditLogos.vue";
|
|
|
10
10
|
import GeolocationButton from "./components/GeolocationButton.vue";
|
|
11
11
|
import WwtHud from "./components/WwtHud.vue";
|
|
12
12
|
import Gallery from "./components/Gallery.vue";
|
|
13
|
-
export { BackgroundImageset, KeyboardControlSettings, Gallery, IconButton, LocationSelector, skyBackgroundImagesets, useFullscreen, useWindowShape, WindowShape, FundingAcknowledgement, CreditLogos, GeolocationButton, WwtHud, PositionCoords, useGeolocation, useWWTKeyboardControls, };
|
|
13
|
+
export { BackgroundImageset, KeyPressInfo, KeyboardControlSettings, Gallery, IconButton, LocationSelector, skyBackgroundImagesets, useFullscreen, useWindowShape, WindowShape, FundingAcknowledgement, CreditLogos, GeolocationButton, WwtHud, PositionCoords, useGeolocation, useWWTKeyboardControls, };
|
|
14
14
|
export * from "./types";
|
|
15
15
|
export * from "./utils";
|
package/dist/src/keyboard.d.ts
CHANGED
|
@@ -1,24 +1,52 @@
|
|
|
1
|
-
|
|
1
|
+
/** Class representing a key press */
|
|
2
|
+
export declare class KeyPressInfo {
|
|
3
|
+
/** The code of the key that was pressed */
|
|
2
4
|
code: string;
|
|
5
|
+
/** Whether the control modifier was pressed */
|
|
3
6
|
ctrl: boolean;
|
|
7
|
+
/** Whether the alt modifier was pressed */
|
|
4
8
|
alt: boolean;
|
|
9
|
+
/** Whether the shift modifier was pressed */
|
|
5
10
|
shift: boolean;
|
|
11
|
+
/** Whether the meta modifier was pressed */
|
|
6
12
|
meta: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Create an instance of key press information
|
|
15
|
+
* @param code The key code describing the keypress
|
|
16
|
+
* @param modifiers An object of boolean values describing which modifier keys were pressed down
|
|
17
|
+
*/
|
|
7
18
|
constructor(code: string, modifiers?: {
|
|
8
19
|
ctrl?: boolean;
|
|
9
20
|
alt?: boolean;
|
|
10
21
|
shift?: boolean;
|
|
11
22
|
meta?: boolean;
|
|
12
23
|
});
|
|
24
|
+
/**
|
|
25
|
+
* Determine whether a keyboard event matches this key press information
|
|
26
|
+
* @param event - The keyboard event to test
|
|
27
|
+
* @returns Whether or not the given event matches
|
|
28
|
+
*/
|
|
13
29
|
matches(event: KeyboardEvent): boolean;
|
|
14
30
|
}
|
|
31
|
+
/** Type describing the possible WWT actions */
|
|
32
|
+
type ActionType = KeyboardControlSettings["actionTypes"][number];
|
|
33
|
+
/**
|
|
34
|
+
* Class describing keyboard control settings for WorldWide Telescope actions
|
|
35
|
+
*/
|
|
15
36
|
export declare class KeyboardControlSettings {
|
|
37
|
+
/** A list of key presses that should result in zooming in */
|
|
16
38
|
zoomIn: KeyPressInfo[];
|
|
39
|
+
/** A list of key presses that should result in zooming out */
|
|
17
40
|
zoomOut: KeyPressInfo[];
|
|
41
|
+
/** A list of key presses that should result in moving the view up */
|
|
18
42
|
moveUp: KeyPressInfo[];
|
|
43
|
+
/** A list of key presses that should result in moving the view down */
|
|
19
44
|
moveDown: KeyPressInfo[];
|
|
45
|
+
/** A list of key presses that should result in moving the view left */
|
|
20
46
|
moveLeft: KeyPressInfo[];
|
|
47
|
+
/** A list of key presses that should result in moving the view right */
|
|
21
48
|
moveRight: KeyPressInfo[];
|
|
49
|
+
/** A value describing how much to move on a movement press. Larger means more movement. */
|
|
22
50
|
moveAmount: number;
|
|
23
51
|
constructor({ zoomIn, zoomOut, moveUp, moveLeft, moveDown, moveRight, moveAmount }: {
|
|
24
52
|
zoomIn?: KeyPressInfo[] | undefined;
|
|
@@ -30,6 +58,11 @@ export declare class KeyboardControlSettings {
|
|
|
30
58
|
moveAmount?: number | undefined;
|
|
31
59
|
});
|
|
32
60
|
readonly actionTypes: readonly ["zoomIn", "zoomOut", "moveUp", "moveDown", "moveLeft", "moveRight"];
|
|
33
|
-
|
|
61
|
+
/** Make a listener for a given WWT action
|
|
62
|
+
* @param actionName - The WWT action to make a listener for
|
|
63
|
+
* @param action - Function to execute when the given WWT action occurs
|
|
64
|
+
* @returns The key event listener for the desired behavior
|
|
65
|
+
*/
|
|
66
|
+
makeListener(actionName: ActionType, action: () => void): (event: KeyboardEvent) => void;
|
|
34
67
|
}
|
|
35
68
|
export {};
|
package/dist/src/mapbox.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/** Interface describing a MapBox content item */
|
|
1
2
|
export interface MapBoxContextItem {
|
|
2
3
|
id: string;
|
|
3
4
|
mapbox_id: string;
|
|
@@ -15,32 +16,83 @@ export interface MapBoxFeature {
|
|
|
15
16
|
center: [number, number];
|
|
16
17
|
context: MapBoxContextItem[];
|
|
17
18
|
}
|
|
19
|
+
/** Interface describing a MapBox feature collection, which is a GeoJSON object */
|
|
18
20
|
export interface MapBoxFeatureCollection {
|
|
19
21
|
type: "FeatureCollection";
|
|
22
|
+
/** The list of features in the collection */
|
|
20
23
|
features: MapBoxFeature[];
|
|
21
24
|
}
|
|
25
|
+
/** Union type describing the feature types available in MapBox */
|
|
22
26
|
export type MapBoxFeatureType = "country" | "region" | "postcode" | "district" | "place" | "locality" | "neighborhood" | "street" | "address";
|
|
27
|
+
/** Union type describing the worldviews available in MapBox */
|
|
23
28
|
export type MapBoxWorldviewType = "ar" | "cn" | "in" | "jp" | "ma" | "ru" | "tr" | "us";
|
|
29
|
+
/** Interface describing options common to both forward and reverse MapBox geocoding */
|
|
24
30
|
interface BaseMapBoxGeocodingOptions {
|
|
25
|
-
|
|
31
|
+
/** The language to use for the results, as an IEFT language tag */
|
|
26
32
|
language?: string;
|
|
33
|
+
/** The number of results to return. Default is 5 */
|
|
27
34
|
limit?: number;
|
|
35
|
+
/** Countries to include in the results. If a list is given, any result outside of these countries is omitted
|
|
36
|
+
* Specify countries using ISO 3166-1 alpha-2 country codes: https://en.wikipedia.org/wiki/ISO_3166-1_alpha-2
|
|
37
|
+
*/
|
|
28
38
|
countries?: string[];
|
|
39
|
+
/** The result types to include */
|
|
29
40
|
types?: MapBoxFeatureType[];
|
|
41
|
+
/** The access token for MapBox. Required */
|
|
30
42
|
access_token: string;
|
|
31
43
|
}
|
|
44
|
+
/** Interface describing options for forward geocoding */
|
|
32
45
|
interface MapBoxForwardGeocodingOptions extends BaseMapBoxGeocodingOptions {
|
|
46
|
+
/** Whether to return autocomplete results. MapBox default is true */
|
|
33
47
|
autocomplete?: boolean;
|
|
34
|
-
|
|
35
|
-
|
|
48
|
+
/** A bounding box for results. Should be a string of the form "minLon,minLat,maxLon,maxLat" */
|
|
49
|
+
bbox?: string;
|
|
50
|
+
/** Whether MapBox should try approximate, as well as exact, matching. MapBox default is true */
|
|
51
|
+
fuzzyMatch?: boolean;
|
|
52
|
+
/** If specified, results are biased to favor results closer to this location. Should be a string of the form "longitude, latitude" */
|
|
36
53
|
proximity?: string;
|
|
37
54
|
}
|
|
55
|
+
/** Interface describing options for reverse geocoding */
|
|
38
56
|
interface MapBoxReverseGeocodingOptions extends BaseMapBoxGeocodingOptions {
|
|
57
|
+
/** The worldview to use for search results. MapBox default is "us" */
|
|
39
58
|
worldview?: MapBoxWorldviewType[];
|
|
40
59
|
}
|
|
60
|
+
/** Find the best feature from a collection of MapBox features.
|
|
61
|
+
* We look for feature place types in the order: 'place', 'postcode', 'region', 'country'
|
|
62
|
+
* @param collection The collection of items to search
|
|
63
|
+
* @param relevantTypes The set of feature place types to consider. If not specified, we use the four types mentioned above
|
|
64
|
+
* @returns The "best" feature, as described above
|
|
65
|
+
*/
|
|
41
66
|
export declare function findBestFeature(collection: MapBoxFeatureCollection, relevantTypes?: MapBoxFeatureType[]): MapBoxFeature | null;
|
|
67
|
+
/**
|
|
68
|
+
* Create text describing a MapBox feature, based on the MapBox items inside of the feature's context
|
|
69
|
+
* @param feature The MapBox feature
|
|
70
|
+
* @param relevantTypes The item types inside the feature's context that we want to consider when creating the string. If not specified, we use 'place', 'postcode', 'region', and 'country'
|
|
71
|
+
* @returns A string describing the feature
|
|
72
|
+
*/
|
|
42
73
|
export declare function textForMapboxFeature(feature: MapBoxFeature, relevantTypes?: MapBoxFeatureType[]): string;
|
|
74
|
+
/**
|
|
75
|
+
* Return text describing the "best" feature in a MapBox collection.
|
|
76
|
+
* See @link{findBestFeature} for a description of how a feature is chosen
|
|
77
|
+
* @param results The feature collection to use
|
|
78
|
+
* @param relevantTypes The item types inside the best feature's context that we want to consider when creating the string. If not specified, we use 'place', 'postcode', 'region', and 'country'
|
|
79
|
+
*/
|
|
43
80
|
export declare function textForMapboxResults(results: MapBoxFeatureCollection, relevantTypes?: MapBoxFeatureType[]): string;
|
|
81
|
+
/**
|
|
82
|
+
* Obtain text describing a given longitude and latitude based on a MapBox reverse geocoding query
|
|
83
|
+
* @param longitudeDeg The longitude of the location, in degrees
|
|
84
|
+
* @param latitudeDeg The latitude of the location, in degrees
|
|
85
|
+
* @param options Options for the MapBox reverse geocoding
|
|
86
|
+
* @returns A promise that resolves to the string describing the given coordinates
|
|
87
|
+
*/
|
|
44
88
|
export declare function textForLocation(longitudeDeg: number, latitudeDeg: number, options: MapBoxReverseGeocodingOptions): Promise<string>;
|
|
89
|
+
/**
|
|
90
|
+
* Obtain a collection of MapBox items obtained from performing a forward geocoding query for a particular search string.
|
|
91
|
+
* Note that the number of items returned is set by the `limit` field in your options.
|
|
92
|
+
* If `limit` is not specified, the MapBox default is 5
|
|
93
|
+
* @param searchText The search string
|
|
94
|
+
* @param options Options for the MapBox forward geocoding
|
|
95
|
+
* @returns A promise that resolves to the found collection of MapBox items
|
|
96
|
+
*/
|
|
45
97
|
export declare function geocodingInfoForSearch(searchText: string, options: MapBoxForwardGeocodingOptions): Promise<MapBoxFeatureCollection>;
|
|
46
98
|
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { Meta, StoryObj } from "@storybook/vue3";
|
|
2
|
+
import { FundingAcknowledgement } from "..";
|
|
3
|
+
declare const meta: Meta<typeof FundingAcknowledgement>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof FundingAcknowledgement>;
|
|
6
|
+
export declare const Primary: Story;
|