@tak-ps/cloudtak 13.3.0 → 13.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/dist/types/src/base/capacitor.d.ts +0 -8
- package/dist/types/src/base/icon.d.ts +0 -5
- package/dist/types/src/base/iconset.d.ts +27 -5
- package/dist/types/src/base/interface.d.ts +2 -2
- package/dist/types/src/base/overlay-class.d.ts +101 -0
- package/dist/types/src/base/overlay.d.ts +67 -97
- package/dist/types/src/components/CloudTAK/Menu/Overlays/TreeCots.vue.d.ts +1 -1
- package/dist/types/src/components/CloudTAK/Menu/Overlays/TreeMission.vue.d.ts +1 -1
- package/dist/types/src/components/CloudTAK/util/CopyField.vue.d.ts +1 -1
- package/dist/types/src/components/CloudTAK/util/GenericSelect.vue.d.ts +1 -0
- package/dist/types/src/components/CloudTAK/util/featureCut.d.ts +3 -3
- package/dist/types/src/database.d.ts +3 -1
- package/dist/types/src/router.d.ts +1 -1
- package/dist/types/src/std.d.ts +7 -0
- package/dist/types/src/stores/device/camera.d.ts +9 -0
- package/dist/types/src/stores/device/file-system.d.ts +7 -0
- package/dist/types/src/stores/device/geolocation.d.ts +15 -0
- package/dist/types/src/stores/device/index.d.ts +264 -0
- package/dist/types/src/stores/device/notification.d.ts +15 -0
- package/dist/types/src/stores/device/orientation.d.ts +15 -0
- package/dist/types/src/stores/device/shared.d.ts +2 -0
- package/dist/types/src/stores/device/storage.d.ts +7 -0
- package/dist/types/src/stores/device/types.d.ts +23 -0
- package/dist/types/src/stores/device/wake-lock.d.ts +10 -0
- package/dist/types/src/stores/map.d.ts +0 -8
- package/dist/types/src/stores/modules/icons.d.ts +4 -7
- package/dist/types/src/workers/atlas.d.ts +0 -2
- package/package.json +5 -1
- package/dist/types/src/stores/modules/permissions.d.ts +0 -37
- package/dist/types/src/workers/atlas-icons.d.ts +0 -14
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import type { CallbackID, Position, PositionOptions } from '@capacitor/geolocation';
|
|
2
1
|
export declare function isNativePlatform(): boolean;
|
|
3
2
|
export declare function supportsServiceWorker(): boolean;
|
|
4
|
-
export declare function supportsLocationRequests(): boolean;
|
|
5
3
|
export declare function openExternalUrl(url: string | URL): Promise<void>;
|
|
6
4
|
export declare function openSecondaryView(url: string | URL): Promise<void>;
|
|
7
|
-
export declare function writeClipboardText(value: string): Promise<void>;
|
|
8
|
-
export declare function checkNativeLocationPermission(): Promise<PermissionState | 'prompt' | 'unknown'>;
|
|
9
|
-
export declare function requestNativeLocationPermission(): Promise<PermissionState | 'prompt' | 'unknown'>;
|
|
10
|
-
export declare function getCurrentLocation(options?: PositionOptions): Promise<Position>;
|
|
11
|
-
export declare function watchLocation(options: PositionOptions, callback: (position: Position | null, err?: unknown) => void): Promise<CallbackID>;
|
|
12
|
-
export declare function clearLocationWatch(id: CallbackID): Promise<void>;
|
|
@@ -40,9 +40,4 @@ export default class Icon {
|
|
|
40
40
|
token: string;
|
|
41
41
|
force?: boolean;
|
|
42
42
|
}): Promise<boolean>;
|
|
43
|
-
/**
|
|
44
|
-
* Remove an iconset and all of its icons from Dexie. Returns true when
|
|
45
|
-
* something was actually removed.
|
|
46
|
-
*/
|
|
47
|
-
static removeIconset(uid: string): Promise<boolean>;
|
|
48
43
|
}
|
|
@@ -1,20 +1,42 @@
|
|
|
1
1
|
import { type Observable } from 'dexie';
|
|
2
2
|
import { type DBIconset } from '../database.ts';
|
|
3
|
+
import type { paths } from '@cloudtak/api-types';
|
|
4
|
+
import type { Iconset } from '../types.ts';
|
|
3
5
|
import BaseInterface from './interface.ts';
|
|
4
6
|
import type { BaseInterface_ListOptions, BaseInterface_FromOptions } from './interface.ts';
|
|
7
|
+
export type Iconset_DeleteOptions = {
|
|
8
|
+
localOnly?: boolean;
|
|
9
|
+
};
|
|
5
10
|
export type Iconset_ListOptions = BaseInterface_ListOptions & {
|
|
6
|
-
|
|
11
|
+
filter?: string;
|
|
12
|
+
limit?: number;
|
|
13
|
+
page?: number;
|
|
14
|
+
};
|
|
15
|
+
export type Iconset_Page = {
|
|
16
|
+
total: number;
|
|
17
|
+
items: DBIconset[];
|
|
7
18
|
};
|
|
8
19
|
export default class IconsetManager extends BaseInterface {
|
|
9
20
|
static readonly listCacheKey = "iconset";
|
|
10
|
-
static count(): Promise<number>;
|
|
11
|
-
static liveCount(): Observable<number>;
|
|
21
|
+
static count(opts?: Pick<Iconset_ListOptions, 'filter'>): Promise<number>;
|
|
22
|
+
static liveCount(opts?: Pick<Iconset_ListOptions, 'filter'>): Observable<number>;
|
|
12
23
|
/**
|
|
13
24
|
* Return all locally cached iconsets ordered by name.
|
|
14
25
|
*/
|
|
15
26
|
static list(opts?: Iconset_ListOptions): Promise<DBIconset[]>;
|
|
16
|
-
static
|
|
27
|
+
static page(opts?: Iconset_ListOptions): Promise<Iconset_Page>;
|
|
28
|
+
static liveList<T extends Iconset_ListOptions & {
|
|
29
|
+
paged?: boolean;
|
|
30
|
+
} = Iconset_ListOptions>(opts?: T): Observable<T extends {
|
|
31
|
+
paged: true;
|
|
32
|
+
} ? Iconset_Page : DBIconset[]>;
|
|
17
33
|
static from(uid: string, opts?: BaseInterface_FromOptions): Promise<DBIconset | undefined>;
|
|
18
34
|
static liveFrom(uid: string): Observable<DBIconset | undefined>;
|
|
19
|
-
static
|
|
35
|
+
static get(uid: string): Promise<Iconset>;
|
|
36
|
+
static create(body: paths['/api/iconset']['post']['requestBody']['content']['application/json']): Promise<Iconset>;
|
|
37
|
+
static update(uid: string, body: paths['/api/iconset/{:iconset}']['patch']['requestBody']['content']['application/json']): Promise<void>;
|
|
38
|
+
static regenerate(uid: string): Promise<void>;
|
|
39
|
+
static download(uid: string): Promise<void>;
|
|
40
|
+
static sync(): Promise<void>;
|
|
41
|
+
static delete(uid: string, opts?: Iconset_DeleteOptions): Promise<void>;
|
|
20
42
|
}
|
|
@@ -54,14 +54,14 @@ export default class BaseInterface {
|
|
|
54
54
|
/**
|
|
55
55
|
* Generates a new item, attempt to save it via the API and save it to the database
|
|
56
56
|
*/
|
|
57
|
-
static generate(): Promise<unknown>;
|
|
57
|
+
static generate(data: unknown): Promise<unknown>;
|
|
58
58
|
/**
|
|
59
59
|
* Updates an item in the database by its unique identifier and attempts to update it via the API
|
|
60
60
|
*
|
|
61
61
|
* @param id - The unique identifier of the item to update
|
|
62
62
|
* @param data - The data to update the item with
|
|
63
63
|
*/
|
|
64
|
-
static update(): Promise<void>;
|
|
64
|
+
static update(id: string, data: unknown): Promise<void>;
|
|
65
65
|
/**
|
|
66
66
|
* Deletes an item from the database by its unique identifier and attempts to delete it via the API
|
|
67
67
|
*
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { ProfileOverlay, ProfileOverlay_Create } from '../types.ts';
|
|
2
|
+
import type { LayerSpecification } from 'maplibre-gl';
|
|
3
|
+
/**
|
|
4
|
+
* @class
|
|
5
|
+
*/
|
|
6
|
+
export default class Overlay {
|
|
7
|
+
_destroyed: boolean;
|
|
8
|
+
_internal: boolean;
|
|
9
|
+
_timer: ReturnType<typeof setInterval> | null;
|
|
10
|
+
_clickable: Array<{
|
|
11
|
+
id: string;
|
|
12
|
+
type: string;
|
|
13
|
+
}>;
|
|
14
|
+
_error?: Error;
|
|
15
|
+
_loaded: boolean;
|
|
16
|
+
loading: boolean;
|
|
17
|
+
id: number;
|
|
18
|
+
name: string;
|
|
19
|
+
active: boolean;
|
|
20
|
+
username?: string;
|
|
21
|
+
frequency: number | null;
|
|
22
|
+
iconset: string | null;
|
|
23
|
+
created: string;
|
|
24
|
+
updated: string;
|
|
25
|
+
pos: number;
|
|
26
|
+
type: string;
|
|
27
|
+
opacity: number;
|
|
28
|
+
visible: boolean;
|
|
29
|
+
mode: string;
|
|
30
|
+
mode_id: string | null;
|
|
31
|
+
encoding: 'mapbox' | 'terrarium' | null;
|
|
32
|
+
actions: ProfileOverlay["actions"];
|
|
33
|
+
url?: string;
|
|
34
|
+
styles: Array<LayerSpecification>;
|
|
35
|
+
token: string | null;
|
|
36
|
+
static create(body: ProfileOverlay | ProfileOverlay_Create, opts?: {
|
|
37
|
+
internal?: boolean;
|
|
38
|
+
skipSave?: boolean;
|
|
39
|
+
clickable?: Array<{
|
|
40
|
+
id: string;
|
|
41
|
+
type: string;
|
|
42
|
+
}>;
|
|
43
|
+
before?: string;
|
|
44
|
+
skipLayers?: boolean;
|
|
45
|
+
}): Promise<Overlay>;
|
|
46
|
+
static internal(body: {
|
|
47
|
+
id: number;
|
|
48
|
+
type: string;
|
|
49
|
+
name: string;
|
|
50
|
+
styles?: Array<LayerSpecification>;
|
|
51
|
+
clickable?: Array<{
|
|
52
|
+
id: string;
|
|
53
|
+
type: string;
|
|
54
|
+
}>;
|
|
55
|
+
}): Promise<Overlay>;
|
|
56
|
+
static load(id: number): Promise<Overlay>;
|
|
57
|
+
constructor(overlay: ProfileOverlay & {
|
|
58
|
+
encoding?: 'mapbox' | 'terrarium' | null;
|
|
59
|
+
}, opts?: {
|
|
60
|
+
internal?: boolean;
|
|
61
|
+
});
|
|
62
|
+
healthy(): boolean;
|
|
63
|
+
hasBounds(): boolean;
|
|
64
|
+
zoomTo(): Promise<void>;
|
|
65
|
+
addLayers(before?: string): Promise<void>;
|
|
66
|
+
init(opts?: {
|
|
67
|
+
clickable?: Array<{
|
|
68
|
+
id: string;
|
|
69
|
+
type: string;
|
|
70
|
+
}>;
|
|
71
|
+
before?: string;
|
|
72
|
+
skipLayers?: boolean;
|
|
73
|
+
}): Promise<void>;
|
|
74
|
+
remove(): void;
|
|
75
|
+
moveBefore(overlay?: Overlay): void;
|
|
76
|
+
replace(overlay: {
|
|
77
|
+
name?: string;
|
|
78
|
+
active?: boolean;
|
|
79
|
+
username?: string;
|
|
80
|
+
actions?: ProfileOverlay["actions"];
|
|
81
|
+
type?: string;
|
|
82
|
+
opacity?: number;
|
|
83
|
+
visible?: boolean;
|
|
84
|
+
mode?: string;
|
|
85
|
+
mode_id?: string;
|
|
86
|
+
encoding?: 'mapbox' | 'terrarium' | null;
|
|
87
|
+
url?: string;
|
|
88
|
+
token?: string;
|
|
89
|
+
styles?: Array<LayerSpecification>;
|
|
90
|
+
}, opts?: {
|
|
91
|
+
before?: string;
|
|
92
|
+
}): Promise<void>;
|
|
93
|
+
delete(): Promise<void>;
|
|
94
|
+
update(body: {
|
|
95
|
+
pos?: number;
|
|
96
|
+
visible?: boolean;
|
|
97
|
+
opacity?: number;
|
|
98
|
+
encoding?: 'mapbox' | 'terrarium' | null;
|
|
99
|
+
}): Promise<void>;
|
|
100
|
+
save(): Promise<void>;
|
|
101
|
+
}
|
|
@@ -1,100 +1,70 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import { type Observable } from 'dexie';
|
|
2
|
+
import { type DBOverlay } from '../database.ts';
|
|
3
|
+
import type { paths } from '@cloudtak/api-types';
|
|
4
|
+
import type { ProfileOverlay } from '../types.ts';
|
|
5
|
+
import BaseInterface from './interface.ts';
|
|
6
|
+
import Overlay from './overlay-class.ts';
|
|
7
|
+
import type { BaseInterface_ListOptions, BaseInterface_FromOptions } from './interface.ts';
|
|
8
|
+
export type Overlay_DeleteOptions = {
|
|
9
|
+
localOnly?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type Overlay_ListOptions = BaseInterface_ListOptions & {
|
|
12
|
+
active?: boolean;
|
|
13
|
+
filter?: string;
|
|
14
|
+
limit?: number;
|
|
15
|
+
localFirst?: boolean;
|
|
16
|
+
mode?: string;
|
|
17
|
+
modeId?: string | null;
|
|
18
|
+
page?: number;
|
|
19
|
+
visible?: boolean;
|
|
20
|
+
};
|
|
21
|
+
export type Overlay_Page = {
|
|
22
|
+
total: number;
|
|
23
|
+
items: DBOverlay[];
|
|
24
|
+
};
|
|
25
|
+
export type Overlay_CreateLoadedOptions = NonNullable<Parameters<typeof Overlay.create>[1]> & {
|
|
26
|
+
position?: 'default' | 'prepend';
|
|
27
|
+
};
|
|
28
|
+
export default class OverlayManager extends BaseInterface {
|
|
29
|
+
static readonly listCacheKey = "overlay";
|
|
30
|
+
static readonly loaded: Overlay[];
|
|
31
|
+
static listLoaded(): Overlay[];
|
|
32
|
+
static clearLoaded(): void;
|
|
33
|
+
static loadedFrom(id: string | number): Overlay | undefined;
|
|
34
|
+
static loadedByName(name: string): Overlay | undefined;
|
|
35
|
+
static loadedByMode(mode: string, modeId: string): Overlay | undefined;
|
|
36
|
+
static loadedBeforeId(): string | undefined;
|
|
37
|
+
static addLoaded(overlay: Overlay): void;
|
|
38
|
+
static prependLoaded(overlay: Overlay): void;
|
|
39
|
+
static appendLoaded(...overlays: Overlay[]): void;
|
|
40
|
+
static createLoaded(body: Parameters<typeof Overlay.create>[0], opts?: Overlay_CreateLoadedOptions): Promise<Overlay>;
|
|
41
|
+
static reorderLoaded(orderedIds: number[], movedId: string | number): Promise<void>;
|
|
42
|
+
static deleteLoaded(idOrOverlay: string | number | Overlay): Promise<void>;
|
|
43
|
+
static loadedBasemapIds(mode?: string): Set<string>;
|
|
44
|
+
static loadedProfileUrls(): Set<string>;
|
|
45
|
+
static queryableOverlayNames(): string[];
|
|
46
|
+
static clickableLayerMap(): Map<string, {
|
|
12
47
|
type: string;
|
|
48
|
+
id: string;
|
|
13
49
|
}>;
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
styles: Array<LayerSpecification>;
|
|
35
|
-
token: string | null;
|
|
36
|
-
static create(body: ProfileOverlay | ProfileOverlay_Create, opts?: {
|
|
37
|
-
internal?: boolean;
|
|
38
|
-
skipSave?: boolean;
|
|
39
|
-
clickable?: Array<{
|
|
40
|
-
id: string;
|
|
41
|
-
type: string;
|
|
42
|
-
}>;
|
|
43
|
-
before?: string;
|
|
44
|
-
skipLayers?: boolean;
|
|
45
|
-
}): Promise<Overlay>;
|
|
46
|
-
static internal(body: {
|
|
47
|
-
id: number;
|
|
48
|
-
type: string;
|
|
49
|
-
name: string;
|
|
50
|
-
styles?: Array<LayerSpecification>;
|
|
51
|
-
clickable?: Array<{
|
|
52
|
-
id: string;
|
|
53
|
-
type: string;
|
|
54
|
-
}>;
|
|
55
|
-
}): Promise<Overlay>;
|
|
56
|
-
static load(id: number): Promise<Overlay>;
|
|
57
|
-
constructor(overlay: ProfileOverlay & {
|
|
58
|
-
encoding?: 'mapbox' | 'terrarium' | null;
|
|
59
|
-
}, opts?: {
|
|
60
|
-
internal?: boolean;
|
|
61
|
-
});
|
|
62
|
-
healthy(): boolean;
|
|
63
|
-
hasBounds(): boolean;
|
|
64
|
-
zoomTo(): Promise<void>;
|
|
65
|
-
addLayers(before?: string): Promise<void>;
|
|
66
|
-
init(opts?: {
|
|
67
|
-
clickable?: Array<{
|
|
68
|
-
id: string;
|
|
69
|
-
type: string;
|
|
70
|
-
}>;
|
|
71
|
-
before?: string;
|
|
72
|
-
skipLayers?: boolean;
|
|
73
|
-
}): Promise<void>;
|
|
74
|
-
remove(): void;
|
|
75
|
-
replace(overlay: {
|
|
76
|
-
name?: string;
|
|
77
|
-
active?: boolean;
|
|
78
|
-
username?: string;
|
|
79
|
-
actions?: ProfileOverlay["actions"];
|
|
80
|
-
type?: string;
|
|
81
|
-
opacity?: number;
|
|
82
|
-
visible?: boolean;
|
|
83
|
-
mode?: string;
|
|
84
|
-
mode_id?: string;
|
|
85
|
-
encoding?: 'mapbox' | 'terrarium' | null;
|
|
86
|
-
url?: string;
|
|
87
|
-
token?: string;
|
|
88
|
-
styles?: Array<LayerSpecification>;
|
|
89
|
-
}, opts?: {
|
|
90
|
-
before?: string;
|
|
91
|
-
}): Promise<void>;
|
|
92
|
-
delete(): Promise<void>;
|
|
93
|
-
update(body: {
|
|
94
|
-
pos?: number;
|
|
95
|
-
visible?: boolean;
|
|
96
|
-
opacity?: number;
|
|
97
|
-
encoding?: 'mapbox' | 'terrarium' | null;
|
|
98
|
-
}): Promise<void>;
|
|
99
|
-
save(): Promise<void>;
|
|
50
|
+
static missionOverlays(): Overlay[];
|
|
51
|
+
static visibleBasemaps(): Overlay[];
|
|
52
|
+
static count(opts?: Omit<Overlay_ListOptions, 'limit' | 'page' | 'sync'>): Promise<number>;
|
|
53
|
+
static liveCount(opts?: Omit<Overlay_ListOptions, 'limit' | 'page' | 'sync'>): Observable<number>;
|
|
54
|
+
static list(opts?: Overlay_ListOptions): Promise<DBOverlay[]>;
|
|
55
|
+
static page(opts?: Overlay_ListOptions): Promise<Overlay_Page>;
|
|
56
|
+
static liveList<T extends Overlay_ListOptions & {
|
|
57
|
+
paged?: boolean;
|
|
58
|
+
} = Overlay_ListOptions>(opts?: T): Observable<T extends {
|
|
59
|
+
paged: true;
|
|
60
|
+
} ? Overlay_Page : DBOverlay[]>;
|
|
61
|
+
static from(id: string, opts?: BaseInterface_FromOptions): Promise<DBOverlay | undefined>;
|
|
62
|
+
static liveFrom(id: string): Observable<DBOverlay | undefined>;
|
|
63
|
+
static get(id: string | number): Promise<ProfileOverlay>;
|
|
64
|
+
static create(body: paths['/api/profile/overlay']['post']['requestBody']['content']['application/json']): Promise<ProfileOverlay>;
|
|
65
|
+
static update(id: string, body: paths['/api/profile/overlay/{:overlay}']['patch']['requestBody']['content']['application/json']): Promise<void>;
|
|
66
|
+
static sync(): Promise<void>;
|
|
67
|
+
static delete(id: string, opts?: Overlay_DeleteOptions): Promise<void>;
|
|
68
|
+
private static query;
|
|
69
|
+
private static overlayId;
|
|
100
70
|
}
|
|
@@ -102,8 +102,8 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
|
|
|
102
102
|
onDelete?: ((...args: any[]) => any) | undefined;
|
|
103
103
|
}>, {
|
|
104
104
|
stroke: number;
|
|
105
|
-
size: number;
|
|
106
105
|
mode: string;
|
|
106
|
+
size: number;
|
|
107
107
|
label: string;
|
|
108
108
|
rows: number;
|
|
109
109
|
hover: boolean;
|
|
@@ -5,6 +5,7 @@ declare const __VLS_export: <T extends SelectableItem>(__VLS_props: NonNullable<
|
|
|
5
5
|
props: import("vue").PublicProps & __VLS_PrettifyLocal<{
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
hover?: boolean;
|
|
8
|
+
stickyControls?: boolean;
|
|
8
9
|
items: T[];
|
|
9
10
|
}> & (typeof globalThis extends {
|
|
10
11
|
__VLS_PROPS_FALLBACK: infer P;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Feature } from 'geojson';
|
|
2
2
|
import type { MapGeoJSONFeature } from 'maplibre-gl';
|
|
3
3
|
import type { useMapStore } from '../../../stores/map.ts';
|
|
4
|
-
import type Overlay from '../../../base/overlay.ts';
|
|
4
|
+
import type Overlay from '../../../base/overlay-class.ts';
|
|
5
5
|
type FeatureLike = Feature | MapGeoJSONFeature;
|
|
6
6
|
type MapStore = ReturnType<typeof useMapStore>;
|
|
7
|
-
export declare function getFeatureOverlay(
|
|
8
|
-
export declare function canCutOverlayFeature(
|
|
7
|
+
export declare function getFeatureOverlay(feature?: FeatureLike): Overlay | null;
|
|
8
|
+
export declare function canCutOverlayFeature(feature?: FeatureLike): boolean;
|
|
9
9
|
export declare function cutOverlayFeature(mapStore: MapStore, feature?: FeatureLike): Promise<void>;
|
|
10
10
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Dexie, { type EntityTable } from 'dexie';
|
|
2
|
-
import type { Feature, GroupChannel, Mission, MissionRole, MissionChange, MissionLog, Contact, Server } from './types.ts';
|
|
2
|
+
import type { Feature, GroupChannel, Mission, MissionRole, MissionChange, MissionLog, Contact, Server, ProfileOverlayList } from './types.ts';
|
|
3
3
|
export interface DBIcon {
|
|
4
4
|
/** Maplibre image id, e.g. "<iconsetUid>:<icon-path-without-extension>" */
|
|
5
5
|
name: string;
|
|
@@ -56,6 +56,7 @@ export interface DBIconset {
|
|
|
56
56
|
default_unknown: string | null;
|
|
57
57
|
skip_resize: boolean;
|
|
58
58
|
}
|
|
59
|
+
export type DBOverlay = ProfileOverlayList["items"][number];
|
|
59
60
|
export interface DBFilter {
|
|
60
61
|
id: string;
|
|
61
62
|
external: string;
|
|
@@ -187,6 +188,7 @@ export interface DBSprite {
|
|
|
187
188
|
export type DatabaseType = Dexie & {
|
|
188
189
|
icon: EntityTable<DBIcon, 'name'>;
|
|
189
190
|
iconset: EntityTable<DBIconset, 'uid'>;
|
|
191
|
+
overlay: EntityTable<DBOverlay, 'id'>;
|
|
190
192
|
sprite: EntityTable<DBSprite, 'id'>;
|
|
191
193
|
group: EntityTable<GroupChannel, 'name'>;
|
|
192
194
|
video: EntityTable<DBVideo, 'id'>;
|
package/dist/types/src/std.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { Router } from 'vue-router';
|
|
|
3
3
|
export declare const serverUrl: string;
|
|
4
4
|
export declare const server: import("openapi-fetch").Client<paths, `${string}/${string}`>;
|
|
5
5
|
export declare function getServer(): Promise<import("openapi-fetch").Client<paths, `${string}/${string}`>>;
|
|
6
|
+
export declare function getRuntimeToken(): Promise<string | undefined>;
|
|
6
7
|
export declare function stdurl(url: string | URL): URL;
|
|
7
8
|
/**
|
|
8
9
|
* Standardize interactions with the backend API
|
|
@@ -17,5 +18,11 @@ export declare function std(url: string | URL, opts?: {
|
|
|
17
18
|
body?: unknown;
|
|
18
19
|
method?: string;
|
|
19
20
|
}): Promise<unknown>;
|
|
21
|
+
export declare function downloadBlob(blob: Blob, response: Response, fallbackName: string): void;
|
|
22
|
+
export declare function downloadUrl(url: string | URL, opts?: {
|
|
23
|
+
filename?: string;
|
|
24
|
+
token?: boolean;
|
|
25
|
+
native?: boolean;
|
|
26
|
+
}): Promise<void>;
|
|
20
27
|
export declare function stdclick($router: Router, event: MouseEvent | KeyboardEvent, path: string): void;
|
|
21
28
|
export declare function humanSeconds(seconds: number): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { DevicePermissionContext } from './types.ts';
|
|
2
|
+
export declare function checkNativeCameraPermission(): Promise<PermissionState | 'prompt' | 'unknown'>;
|
|
3
|
+
export declare function requestNativeCameraPermission(): Promise<PermissionState | 'prompt' | 'unknown'>;
|
|
4
|
+
export declare class CameraPermission {
|
|
5
|
+
private readonly context;
|
|
6
|
+
constructor(context: DevicePermissionContext);
|
|
7
|
+
refreshStatus(): Promise<void>;
|
|
8
|
+
request(): Promise<void>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { CallbackID, Position, PositionOptions } from '@capacitor/geolocation';
|
|
2
|
+
import type { DevicePermissionContext } from './types.ts';
|
|
3
|
+
export declare function supportsLocationRequests(): boolean;
|
|
4
|
+
export declare function checkNativeLocationPermission(): Promise<PermissionState | 'prompt' | 'unknown'>;
|
|
5
|
+
export declare function requestNativeLocationPermission(): Promise<PermissionState | 'prompt' | 'unknown'>;
|
|
6
|
+
export declare function getCurrentLocation(options?: PositionOptions): Promise<Position>;
|
|
7
|
+
export declare function watchLocation(options: PositionOptions, callback: (position: Position | null, err?: unknown) => void): Promise<CallbackID>;
|
|
8
|
+
export declare function clearLocationWatch(id: CallbackID): Promise<void>;
|
|
9
|
+
export declare class GeolocationPermission {
|
|
10
|
+
private readonly context;
|
|
11
|
+
constructor(context: DevicePermissionContext);
|
|
12
|
+
refreshStatus(): Promise<void>;
|
|
13
|
+
request(onGranted?: () => void): Promise<void>;
|
|
14
|
+
initializeSubscription(onGranted?: () => void): Promise<void>;
|
|
15
|
+
}
|
|
@@ -0,0 +1,264 @@
|
|
|
1
|
+
import { CameraPermission } from './camera.ts';
|
|
2
|
+
import { FileSystemPermission } from './file-system.ts';
|
|
3
|
+
import { GeolocationPermission } from './geolocation.ts';
|
|
4
|
+
import { BrowserNotificationPermission } from './notification.ts';
|
|
5
|
+
import { OrientationPermission } from './orientation.ts';
|
|
6
|
+
import { StoragePermission } from './storage.ts';
|
|
7
|
+
import { WakeLockPermission } from './wake-lock.ts';
|
|
8
|
+
import type { BrowserPermissionState, BrowserPermissionType } from './types.ts';
|
|
9
|
+
export type { BrowserPermissionState, BrowserPermissionType } from './types.ts';
|
|
10
|
+
export { CameraPermission } from './camera.ts';
|
|
11
|
+
export { FileSystemPermission } from './file-system.ts';
|
|
12
|
+
export { GeolocationPermission } from './geolocation.ts';
|
|
13
|
+
export { BrowserNotificationPermission } from './notification.ts';
|
|
14
|
+
export { OrientationPermission } from './orientation.ts';
|
|
15
|
+
export { StoragePermission } from './storage.ts';
|
|
16
|
+
export { WakeLockPermission } from './wake-lock.ts';
|
|
17
|
+
export declare const usePermissionStore: import("pinia").StoreDefinition<"permissions", Pick<{
|
|
18
|
+
permissions: {
|
|
19
|
+
notification: BrowserPermissionState;
|
|
20
|
+
orientation: BrowserPermissionState;
|
|
21
|
+
location: BrowserPermissionState;
|
|
22
|
+
storage: BrowserPermissionState;
|
|
23
|
+
camera: BrowserPermissionState;
|
|
24
|
+
wakeLock: BrowserPermissionState;
|
|
25
|
+
fileSystem: BrowserPermissionState;
|
|
26
|
+
};
|
|
27
|
+
geolocation: import("vue").Raw<GeolocationPermission>;
|
|
28
|
+
notification: import("vue").Raw<BrowserNotificationPermission>;
|
|
29
|
+
orientation: import("vue").Raw<OrientationPermission>;
|
|
30
|
+
storage: import("vue").Raw<StoragePermission>;
|
|
31
|
+
camera: import("vue").Raw<CameraPermission>;
|
|
32
|
+
wakeLock: import("vue").Raw<WakeLockPermission>;
|
|
33
|
+
fileSystem: import("vue").Raw<FileSystemPermission>;
|
|
34
|
+
setPermissionStatus: (type: BrowserPermissionType, state: BrowserPermissionState) => void;
|
|
35
|
+
refreshPermissionStatuses: () => Promise<void>;
|
|
36
|
+
initializePermissionSubscriptions: (onLocationGranted?: () => void) => Promise<void>;
|
|
37
|
+
hasOrientationSupport: () => boolean;
|
|
38
|
+
hasOrientationPermissionRequest: () => boolean;
|
|
39
|
+
getOrientationEventName: () => "deviceorientation" | "deviceorientationabsolute";
|
|
40
|
+
getOrientationHeading: (event: DeviceOrientationEvent) => number | null;
|
|
41
|
+
addOrientationListener: (listener: (event: DeviceOrientationEvent) => void) => void;
|
|
42
|
+
removeOrientationListener: (listener: (event: DeviceOrientationEvent) => void) => void;
|
|
43
|
+
refreshLocationPermissionStatus: () => Promise<void>;
|
|
44
|
+
refreshNotificationPermissionStatus: () => Promise<void>;
|
|
45
|
+
refreshOrientationPermissionStatus: () => Promise<void>;
|
|
46
|
+
refreshStoragePermissionStatus: () => Promise<void>;
|
|
47
|
+
refreshCameraPermissionStatus: () => Promise<void>;
|
|
48
|
+
refreshWakeLockPermissionStatus: () => Promise<void>;
|
|
49
|
+
refreshFileSystemPermissionStatus: () => Promise<void>;
|
|
50
|
+
requestLocationPermission: (onGranted?: () => void) => Promise<void>;
|
|
51
|
+
requestNotificationPermission: () => Promise<void>;
|
|
52
|
+
requestOrientationPermission: () => Promise<void>;
|
|
53
|
+
requestStoragePermission: () => Promise<void>;
|
|
54
|
+
requestCameraPermission: () => Promise<void>;
|
|
55
|
+
requestWakeLockPermission: () => Promise<void>;
|
|
56
|
+
requestFileSystemPermission: () => Promise<void>;
|
|
57
|
+
releaseWakeLockSentinel: () => Promise<void>;
|
|
58
|
+
}, "notification" | "orientation" | "storage" | "permissions" | "camera" | "geolocation" | "wakeLock" | "fileSystem">, Pick<{
|
|
59
|
+
permissions: {
|
|
60
|
+
notification: BrowserPermissionState;
|
|
61
|
+
orientation: BrowserPermissionState;
|
|
62
|
+
location: BrowserPermissionState;
|
|
63
|
+
storage: BrowserPermissionState;
|
|
64
|
+
camera: BrowserPermissionState;
|
|
65
|
+
wakeLock: BrowserPermissionState;
|
|
66
|
+
fileSystem: BrowserPermissionState;
|
|
67
|
+
};
|
|
68
|
+
geolocation: import("vue").Raw<GeolocationPermission>;
|
|
69
|
+
notification: import("vue").Raw<BrowserNotificationPermission>;
|
|
70
|
+
orientation: import("vue").Raw<OrientationPermission>;
|
|
71
|
+
storage: import("vue").Raw<StoragePermission>;
|
|
72
|
+
camera: import("vue").Raw<CameraPermission>;
|
|
73
|
+
wakeLock: import("vue").Raw<WakeLockPermission>;
|
|
74
|
+
fileSystem: import("vue").Raw<FileSystemPermission>;
|
|
75
|
+
setPermissionStatus: (type: BrowserPermissionType, state: BrowserPermissionState) => void;
|
|
76
|
+
refreshPermissionStatuses: () => Promise<void>;
|
|
77
|
+
initializePermissionSubscriptions: (onLocationGranted?: () => void) => Promise<void>;
|
|
78
|
+
hasOrientationSupport: () => boolean;
|
|
79
|
+
hasOrientationPermissionRequest: () => boolean;
|
|
80
|
+
getOrientationEventName: () => "deviceorientation" | "deviceorientationabsolute";
|
|
81
|
+
getOrientationHeading: (event: DeviceOrientationEvent) => number | null;
|
|
82
|
+
addOrientationListener: (listener: (event: DeviceOrientationEvent) => void) => void;
|
|
83
|
+
removeOrientationListener: (listener: (event: DeviceOrientationEvent) => void) => void;
|
|
84
|
+
refreshLocationPermissionStatus: () => Promise<void>;
|
|
85
|
+
refreshNotificationPermissionStatus: () => Promise<void>;
|
|
86
|
+
refreshOrientationPermissionStatus: () => Promise<void>;
|
|
87
|
+
refreshStoragePermissionStatus: () => Promise<void>;
|
|
88
|
+
refreshCameraPermissionStatus: () => Promise<void>;
|
|
89
|
+
refreshWakeLockPermissionStatus: () => Promise<void>;
|
|
90
|
+
refreshFileSystemPermissionStatus: () => Promise<void>;
|
|
91
|
+
requestLocationPermission: (onGranted?: () => void) => Promise<void>;
|
|
92
|
+
requestNotificationPermission: () => Promise<void>;
|
|
93
|
+
requestOrientationPermission: () => Promise<void>;
|
|
94
|
+
requestStoragePermission: () => Promise<void>;
|
|
95
|
+
requestCameraPermission: () => Promise<void>;
|
|
96
|
+
requestWakeLockPermission: () => Promise<void>;
|
|
97
|
+
requestFileSystemPermission: () => Promise<void>;
|
|
98
|
+
releaseWakeLockSentinel: () => Promise<void>;
|
|
99
|
+
}, never>, Pick<{
|
|
100
|
+
permissions: {
|
|
101
|
+
notification: BrowserPermissionState;
|
|
102
|
+
orientation: BrowserPermissionState;
|
|
103
|
+
location: BrowserPermissionState;
|
|
104
|
+
storage: BrowserPermissionState;
|
|
105
|
+
camera: BrowserPermissionState;
|
|
106
|
+
wakeLock: BrowserPermissionState;
|
|
107
|
+
fileSystem: BrowserPermissionState;
|
|
108
|
+
};
|
|
109
|
+
geolocation: import("vue").Raw<GeolocationPermission>;
|
|
110
|
+
notification: import("vue").Raw<BrowserNotificationPermission>;
|
|
111
|
+
orientation: import("vue").Raw<OrientationPermission>;
|
|
112
|
+
storage: import("vue").Raw<StoragePermission>;
|
|
113
|
+
camera: import("vue").Raw<CameraPermission>;
|
|
114
|
+
wakeLock: import("vue").Raw<WakeLockPermission>;
|
|
115
|
+
fileSystem: import("vue").Raw<FileSystemPermission>;
|
|
116
|
+
setPermissionStatus: (type: BrowserPermissionType, state: BrowserPermissionState) => void;
|
|
117
|
+
refreshPermissionStatuses: () => Promise<void>;
|
|
118
|
+
initializePermissionSubscriptions: (onLocationGranted?: () => void) => Promise<void>;
|
|
119
|
+
hasOrientationSupport: () => boolean;
|
|
120
|
+
hasOrientationPermissionRequest: () => boolean;
|
|
121
|
+
getOrientationEventName: () => "deviceorientation" | "deviceorientationabsolute";
|
|
122
|
+
getOrientationHeading: (event: DeviceOrientationEvent) => number | null;
|
|
123
|
+
addOrientationListener: (listener: (event: DeviceOrientationEvent) => void) => void;
|
|
124
|
+
removeOrientationListener: (listener: (event: DeviceOrientationEvent) => void) => void;
|
|
125
|
+
refreshLocationPermissionStatus: () => Promise<void>;
|
|
126
|
+
refreshNotificationPermissionStatus: () => Promise<void>;
|
|
127
|
+
refreshOrientationPermissionStatus: () => Promise<void>;
|
|
128
|
+
refreshStoragePermissionStatus: () => Promise<void>;
|
|
129
|
+
refreshCameraPermissionStatus: () => Promise<void>;
|
|
130
|
+
refreshWakeLockPermissionStatus: () => Promise<void>;
|
|
131
|
+
refreshFileSystemPermissionStatus: () => Promise<void>;
|
|
132
|
+
requestLocationPermission: (onGranted?: () => void) => Promise<void>;
|
|
133
|
+
requestNotificationPermission: () => Promise<void>;
|
|
134
|
+
requestOrientationPermission: () => Promise<void>;
|
|
135
|
+
requestStoragePermission: () => Promise<void>;
|
|
136
|
+
requestCameraPermission: () => Promise<void>;
|
|
137
|
+
requestWakeLockPermission: () => Promise<void>;
|
|
138
|
+
requestFileSystemPermission: () => Promise<void>;
|
|
139
|
+
releaseWakeLockSentinel: () => Promise<void>;
|
|
140
|
+
}, "setPermissionStatus" | "refreshPermissionStatuses" | "initializePermissionSubscriptions" | "hasOrientationSupport" | "hasOrientationPermissionRequest" | "getOrientationEventName" | "getOrientationHeading" | "addOrientationListener" | "removeOrientationListener" | "refreshLocationPermissionStatus" | "refreshNotificationPermissionStatus" | "refreshOrientationPermissionStatus" | "refreshStoragePermissionStatus" | "refreshCameraPermissionStatus" | "refreshWakeLockPermissionStatus" | "refreshFileSystemPermissionStatus" | "requestLocationPermission" | "requestNotificationPermission" | "requestOrientationPermission" | "requestStoragePermission" | "requestCameraPermission" | "requestWakeLockPermission" | "requestFileSystemPermission" | "releaseWakeLockSentinel">>;
|
|
141
|
+
export declare const useDeviceStore: import("pinia").StoreDefinition<"permissions", Pick<{
|
|
142
|
+
permissions: {
|
|
143
|
+
notification: BrowserPermissionState;
|
|
144
|
+
orientation: BrowserPermissionState;
|
|
145
|
+
location: BrowserPermissionState;
|
|
146
|
+
storage: BrowserPermissionState;
|
|
147
|
+
camera: BrowserPermissionState;
|
|
148
|
+
wakeLock: BrowserPermissionState;
|
|
149
|
+
fileSystem: BrowserPermissionState;
|
|
150
|
+
};
|
|
151
|
+
geolocation: import("vue").Raw<GeolocationPermission>;
|
|
152
|
+
notification: import("vue").Raw<BrowserNotificationPermission>;
|
|
153
|
+
orientation: import("vue").Raw<OrientationPermission>;
|
|
154
|
+
storage: import("vue").Raw<StoragePermission>;
|
|
155
|
+
camera: import("vue").Raw<CameraPermission>;
|
|
156
|
+
wakeLock: import("vue").Raw<WakeLockPermission>;
|
|
157
|
+
fileSystem: import("vue").Raw<FileSystemPermission>;
|
|
158
|
+
setPermissionStatus: (type: BrowserPermissionType, state: BrowserPermissionState) => void;
|
|
159
|
+
refreshPermissionStatuses: () => Promise<void>;
|
|
160
|
+
initializePermissionSubscriptions: (onLocationGranted?: () => void) => Promise<void>;
|
|
161
|
+
hasOrientationSupport: () => boolean;
|
|
162
|
+
hasOrientationPermissionRequest: () => boolean;
|
|
163
|
+
getOrientationEventName: () => "deviceorientation" | "deviceorientationabsolute";
|
|
164
|
+
getOrientationHeading: (event: DeviceOrientationEvent) => number | null;
|
|
165
|
+
addOrientationListener: (listener: (event: DeviceOrientationEvent) => void) => void;
|
|
166
|
+
removeOrientationListener: (listener: (event: DeviceOrientationEvent) => void) => void;
|
|
167
|
+
refreshLocationPermissionStatus: () => Promise<void>;
|
|
168
|
+
refreshNotificationPermissionStatus: () => Promise<void>;
|
|
169
|
+
refreshOrientationPermissionStatus: () => Promise<void>;
|
|
170
|
+
refreshStoragePermissionStatus: () => Promise<void>;
|
|
171
|
+
refreshCameraPermissionStatus: () => Promise<void>;
|
|
172
|
+
refreshWakeLockPermissionStatus: () => Promise<void>;
|
|
173
|
+
refreshFileSystemPermissionStatus: () => Promise<void>;
|
|
174
|
+
requestLocationPermission: (onGranted?: () => void) => Promise<void>;
|
|
175
|
+
requestNotificationPermission: () => Promise<void>;
|
|
176
|
+
requestOrientationPermission: () => Promise<void>;
|
|
177
|
+
requestStoragePermission: () => Promise<void>;
|
|
178
|
+
requestCameraPermission: () => Promise<void>;
|
|
179
|
+
requestWakeLockPermission: () => Promise<void>;
|
|
180
|
+
requestFileSystemPermission: () => Promise<void>;
|
|
181
|
+
releaseWakeLockSentinel: () => Promise<void>;
|
|
182
|
+
}, "notification" | "orientation" | "storage" | "permissions" | "camera" | "geolocation" | "wakeLock" | "fileSystem">, Pick<{
|
|
183
|
+
permissions: {
|
|
184
|
+
notification: BrowserPermissionState;
|
|
185
|
+
orientation: BrowserPermissionState;
|
|
186
|
+
location: BrowserPermissionState;
|
|
187
|
+
storage: BrowserPermissionState;
|
|
188
|
+
camera: BrowserPermissionState;
|
|
189
|
+
wakeLock: BrowserPermissionState;
|
|
190
|
+
fileSystem: BrowserPermissionState;
|
|
191
|
+
};
|
|
192
|
+
geolocation: import("vue").Raw<GeolocationPermission>;
|
|
193
|
+
notification: import("vue").Raw<BrowserNotificationPermission>;
|
|
194
|
+
orientation: import("vue").Raw<OrientationPermission>;
|
|
195
|
+
storage: import("vue").Raw<StoragePermission>;
|
|
196
|
+
camera: import("vue").Raw<CameraPermission>;
|
|
197
|
+
wakeLock: import("vue").Raw<WakeLockPermission>;
|
|
198
|
+
fileSystem: import("vue").Raw<FileSystemPermission>;
|
|
199
|
+
setPermissionStatus: (type: BrowserPermissionType, state: BrowserPermissionState) => void;
|
|
200
|
+
refreshPermissionStatuses: () => Promise<void>;
|
|
201
|
+
initializePermissionSubscriptions: (onLocationGranted?: () => void) => Promise<void>;
|
|
202
|
+
hasOrientationSupport: () => boolean;
|
|
203
|
+
hasOrientationPermissionRequest: () => boolean;
|
|
204
|
+
getOrientationEventName: () => "deviceorientation" | "deviceorientationabsolute";
|
|
205
|
+
getOrientationHeading: (event: DeviceOrientationEvent) => number | null;
|
|
206
|
+
addOrientationListener: (listener: (event: DeviceOrientationEvent) => void) => void;
|
|
207
|
+
removeOrientationListener: (listener: (event: DeviceOrientationEvent) => void) => void;
|
|
208
|
+
refreshLocationPermissionStatus: () => Promise<void>;
|
|
209
|
+
refreshNotificationPermissionStatus: () => Promise<void>;
|
|
210
|
+
refreshOrientationPermissionStatus: () => Promise<void>;
|
|
211
|
+
refreshStoragePermissionStatus: () => Promise<void>;
|
|
212
|
+
refreshCameraPermissionStatus: () => Promise<void>;
|
|
213
|
+
refreshWakeLockPermissionStatus: () => Promise<void>;
|
|
214
|
+
refreshFileSystemPermissionStatus: () => Promise<void>;
|
|
215
|
+
requestLocationPermission: (onGranted?: () => void) => Promise<void>;
|
|
216
|
+
requestNotificationPermission: () => Promise<void>;
|
|
217
|
+
requestOrientationPermission: () => Promise<void>;
|
|
218
|
+
requestStoragePermission: () => Promise<void>;
|
|
219
|
+
requestCameraPermission: () => Promise<void>;
|
|
220
|
+
requestWakeLockPermission: () => Promise<void>;
|
|
221
|
+
requestFileSystemPermission: () => Promise<void>;
|
|
222
|
+
releaseWakeLockSentinel: () => Promise<void>;
|
|
223
|
+
}, never>, Pick<{
|
|
224
|
+
permissions: {
|
|
225
|
+
notification: BrowserPermissionState;
|
|
226
|
+
orientation: BrowserPermissionState;
|
|
227
|
+
location: BrowserPermissionState;
|
|
228
|
+
storage: BrowserPermissionState;
|
|
229
|
+
camera: BrowserPermissionState;
|
|
230
|
+
wakeLock: BrowserPermissionState;
|
|
231
|
+
fileSystem: BrowserPermissionState;
|
|
232
|
+
};
|
|
233
|
+
geolocation: import("vue").Raw<GeolocationPermission>;
|
|
234
|
+
notification: import("vue").Raw<BrowserNotificationPermission>;
|
|
235
|
+
orientation: import("vue").Raw<OrientationPermission>;
|
|
236
|
+
storage: import("vue").Raw<StoragePermission>;
|
|
237
|
+
camera: import("vue").Raw<CameraPermission>;
|
|
238
|
+
wakeLock: import("vue").Raw<WakeLockPermission>;
|
|
239
|
+
fileSystem: import("vue").Raw<FileSystemPermission>;
|
|
240
|
+
setPermissionStatus: (type: BrowserPermissionType, state: BrowserPermissionState) => void;
|
|
241
|
+
refreshPermissionStatuses: () => Promise<void>;
|
|
242
|
+
initializePermissionSubscriptions: (onLocationGranted?: () => void) => Promise<void>;
|
|
243
|
+
hasOrientationSupport: () => boolean;
|
|
244
|
+
hasOrientationPermissionRequest: () => boolean;
|
|
245
|
+
getOrientationEventName: () => "deviceorientation" | "deviceorientationabsolute";
|
|
246
|
+
getOrientationHeading: (event: DeviceOrientationEvent) => number | null;
|
|
247
|
+
addOrientationListener: (listener: (event: DeviceOrientationEvent) => void) => void;
|
|
248
|
+
removeOrientationListener: (listener: (event: DeviceOrientationEvent) => void) => void;
|
|
249
|
+
refreshLocationPermissionStatus: () => Promise<void>;
|
|
250
|
+
refreshNotificationPermissionStatus: () => Promise<void>;
|
|
251
|
+
refreshOrientationPermissionStatus: () => Promise<void>;
|
|
252
|
+
refreshStoragePermissionStatus: () => Promise<void>;
|
|
253
|
+
refreshCameraPermissionStatus: () => Promise<void>;
|
|
254
|
+
refreshWakeLockPermissionStatus: () => Promise<void>;
|
|
255
|
+
refreshFileSystemPermissionStatus: () => Promise<void>;
|
|
256
|
+
requestLocationPermission: (onGranted?: () => void) => Promise<void>;
|
|
257
|
+
requestNotificationPermission: () => Promise<void>;
|
|
258
|
+
requestOrientationPermission: () => Promise<void>;
|
|
259
|
+
requestStoragePermission: () => Promise<void>;
|
|
260
|
+
requestCameraPermission: () => Promise<void>;
|
|
261
|
+
requestWakeLockPermission: () => Promise<void>;
|
|
262
|
+
requestFileSystemPermission: () => Promise<void>;
|
|
263
|
+
releaseWakeLockSentinel: () => Promise<void>;
|
|
264
|
+
}, "setPermissionStatus" | "refreshPermissionStatuses" | "initializePermissionSubscriptions" | "hasOrientationSupport" | "hasOrientationPermissionRequest" | "getOrientationEventName" | "getOrientationHeading" | "addOrientationListener" | "removeOrientationListener" | "refreshLocationPermissionStatus" | "refreshNotificationPermissionStatus" | "refreshOrientationPermissionStatus" | "refreshStoragePermissionStatus" | "refreshCameraPermissionStatus" | "refreshWakeLockPermissionStatus" | "refreshFileSystemPermissionStatus" | "requestLocationPermission" | "requestNotificationPermission" | "requestOrientationPermission" | "requestStoragePermission" | "requestCameraPermission" | "requestWakeLockPermission" | "requestFileSystemPermission" | "releaseWakeLockSentinel">>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { DevicePermissionContext } from './types.ts';
|
|
2
|
+
export declare class BrowserNotificationPermission {
|
|
3
|
+
private readonly context;
|
|
4
|
+
private messagingToken;
|
|
5
|
+
private tokenListener;
|
|
6
|
+
constructor(context: DevicePermissionContext);
|
|
7
|
+
refreshStatus(): Promise<void>;
|
|
8
|
+
request(): Promise<void>;
|
|
9
|
+
initializeSubscription(): Promise<void>;
|
|
10
|
+
getMessagingToken(): string | null;
|
|
11
|
+
refreshMessagingToken(): Promise<string | null>;
|
|
12
|
+
deleteMessagingToken(): Promise<void>;
|
|
13
|
+
private refreshNativeStatus;
|
|
14
|
+
private initializeNativeMessaging;
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { DevicePermissionContext } from './types.ts';
|
|
2
|
+
type DeviceOrientationEventName = 'deviceorientationabsolute' | 'deviceorientation';
|
|
3
|
+
export declare class OrientationPermission {
|
|
4
|
+
private readonly context;
|
|
5
|
+
constructor(context: DevicePermissionContext);
|
|
6
|
+
hasSupport(): boolean;
|
|
7
|
+
hasPermissionRequest(): boolean;
|
|
8
|
+
getEventName(): DeviceOrientationEventName;
|
|
9
|
+
getHeading(event: DeviceOrientationEvent): number | null;
|
|
10
|
+
addListener(listener: (event: DeviceOrientationEvent) => void): void;
|
|
11
|
+
removeListener(listener: (event: DeviceOrientationEvent) => void): void;
|
|
12
|
+
refreshStatus(): Promise<void>;
|
|
13
|
+
request(): Promise<void>;
|
|
14
|
+
}
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export type BrowserPermissionState = PermissionState | 'unsupported' | 'unknown';
|
|
2
|
+
export type BrowserPermissionType = 'location' | 'notification' | 'orientation' | 'storage' | 'camera' | 'wakeLock' | 'fileSystem';
|
|
3
|
+
export type FileSystemAccessHandle = FileSystemHandle & {
|
|
4
|
+
queryPermission?: (descriptor?: {
|
|
5
|
+
mode?: 'read' | 'readwrite';
|
|
6
|
+
}) => Promise<PermissionState>;
|
|
7
|
+
requestPermission?: (descriptor?: {
|
|
8
|
+
mode?: 'read' | 'readwrite';
|
|
9
|
+
}) => Promise<PermissionState>;
|
|
10
|
+
};
|
|
11
|
+
export type WindowWithFilePicker = Window & {
|
|
12
|
+
showOpenFilePicker?: (options?: {
|
|
13
|
+
multiple?: boolean;
|
|
14
|
+
}) => Promise<FileSystemAccessHandle[]>;
|
|
15
|
+
};
|
|
16
|
+
export interface DevicePermissionContext {
|
|
17
|
+
permissions: Record<BrowserPermissionType, BrowserPermissionState>;
|
|
18
|
+
setPermissionStatus: (type: BrowserPermissionType, state: BrowserPermissionState) => void;
|
|
19
|
+
getWakeLockSentinel: () => WakeLockSentinel | null;
|
|
20
|
+
setWakeLockSentinel: (sentinel: WakeLockSentinel | null) => void;
|
|
21
|
+
getFileSystemHandle: () => FileSystemAccessHandle | null;
|
|
22
|
+
setFileSystemHandle: (handle: FileSystemAccessHandle | null) => void;
|
|
23
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { DevicePermissionContext } from './types.ts';
|
|
2
|
+
export declare class WakeLockPermission {
|
|
3
|
+
private readonly context;
|
|
4
|
+
constructor(context: DevicePermissionContext);
|
|
5
|
+
refreshStatus(): Promise<void>;
|
|
6
|
+
request(): Promise<void>;
|
|
7
|
+
releaseSentinel(): Promise<void>;
|
|
8
|
+
private isSupported;
|
|
9
|
+
private isKeptAwake;
|
|
10
|
+
}
|
|
@@ -6,7 +6,6 @@ import * as Comlink from 'comlink';
|
|
|
6
6
|
import COT from '../base/cot.ts';
|
|
7
7
|
import type { DatabaseType } from '../database.ts';
|
|
8
8
|
import { LocationState } from '../base/events.ts';
|
|
9
|
-
import Overlay from '../base/overlay.ts';
|
|
10
9
|
import Subscription from '../base/subscription.ts';
|
|
11
10
|
import * as mapgl from 'maplibre-gl';
|
|
12
11
|
import type Atlas from '../workers/atlas.ts';
|
|
@@ -85,7 +84,6 @@ export declare const useMapStore: import("pinia").StoreDefinition<"cloudtak", {
|
|
|
85
84
|
y: number;
|
|
86
85
|
lngLat?: LngLat;
|
|
87
86
|
};
|
|
88
|
-
overlays: Array<Overlay>;
|
|
89
87
|
}, {
|
|
90
88
|
map: () => mapgl.Map;
|
|
91
89
|
draw: () => DrawTool;
|
|
@@ -94,13 +92,7 @@ export declare const useMapStore: import("pinia").StoreDefinition<"cloudtak", {
|
|
|
94
92
|
bottomBar: () => BottomBarManager;
|
|
95
93
|
}, {
|
|
96
94
|
destroy: () => Promise<void>;
|
|
97
|
-
getOverlayBeforeId: () => string | undefined;
|
|
98
|
-
addOverlay: (overlay: Overlay) => void;
|
|
99
|
-
removeOverlay: (overlay: Overlay) => Promise<void>;
|
|
100
95
|
makeActiveMission: (mission?: Subscription) => Promise<void>;
|
|
101
|
-
getOverlayById(id: number): Overlay | null;
|
|
102
|
-
getOverlayByName(name: string): Overlay | null;
|
|
103
|
-
getOverlayByMode(mode: string, mode_id: string): Overlay | null;
|
|
104
96
|
addTerrain: () => Promise<void>;
|
|
105
97
|
removeTerrain: () => void;
|
|
106
98
|
returnHome: () => Promise<void>;
|
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
import type { Map as MapLibreMap } from 'maplibre-gl';
|
|
2
|
-
import type * as Comlink from 'comlink';
|
|
3
|
-
import type Atlas from '../../workers/atlas.ts';
|
|
4
2
|
import { type DBIconset } from '../../database.ts';
|
|
5
3
|
export default class IconManager {
|
|
6
4
|
private cache;
|
|
7
5
|
private map;
|
|
8
|
-
private worker;
|
|
9
6
|
private loggedMissingImageIds;
|
|
10
7
|
private loggedErrors;
|
|
11
8
|
private inflightImage;
|
|
12
9
|
private fallbackBitmap;
|
|
13
10
|
private requestedIconsetImageIds;
|
|
14
|
-
constructor(map: MapLibreMap
|
|
11
|
+
constructor(map: MapLibreMap);
|
|
15
12
|
private logWarnOnce;
|
|
16
13
|
private logErrorOnce;
|
|
17
14
|
static from(uid: string): Promise<DBIconset | undefined>;
|
|
@@ -39,9 +36,8 @@ export default class IconManager {
|
|
|
39
36
|
/**
|
|
40
37
|
* Hydrate the local Dexie icon cache from the API.
|
|
41
38
|
*
|
|
42
|
-
*
|
|
43
|
-
*
|
|
44
|
-
* concerns like purging stale MapLibre images.
|
|
39
|
+
* This method also handles main-thread concerns like purging stale MapLibre
|
|
40
|
+
* images when the local Dexie cache changes.
|
|
45
41
|
*/
|
|
46
42
|
hydrate(opts?: {
|
|
47
43
|
force?: boolean;
|
|
@@ -55,6 +51,7 @@ export default class IconManager {
|
|
|
55
51
|
force?: boolean;
|
|
56
52
|
}): Promise<void>;
|
|
57
53
|
removeIconset(uid: string): Promise<void>;
|
|
54
|
+
deleteIconset(uid: string): Promise<void>;
|
|
58
55
|
private applyHydrateResult;
|
|
59
56
|
private purgeMapImagesForIconset;
|
|
60
57
|
onStyleImageMissing(e: {
|
|
@@ -3,7 +3,6 @@ import * as Comlink from 'comlink';
|
|
|
3
3
|
import AtlasProfile from './atlas-profile.ts';
|
|
4
4
|
import AtlasDatabase from './atlas-database.ts';
|
|
5
5
|
import AtlasConnection from './atlas-connection.ts';
|
|
6
|
-
import AtlasIcons from './atlas-icons.ts';
|
|
7
6
|
export default class Atlas {
|
|
8
7
|
channel: BroadcastChannel;
|
|
9
8
|
token: string;
|
|
@@ -12,7 +11,6 @@ export default class Atlas {
|
|
|
12
11
|
db: AtlasDatabase & Comlink.ProxyMarked;
|
|
13
12
|
conn: AtlasConnection & Comlink.ProxyMarked;
|
|
14
13
|
profile: AtlasProfile & Comlink.ProxyMarked;
|
|
15
|
-
icons: AtlasIcons & Comlink.ProxyMarked;
|
|
16
14
|
constructor();
|
|
17
15
|
postMessage(msg: WorkerMessage): Promise<void>;
|
|
18
16
|
init(authToken: string): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tak-ps/cloudtak",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "13.
|
|
4
|
+
"version": "13.4.0",
|
|
5
5
|
"types": "dist/types/plugin.d.ts",
|
|
6
6
|
"files": [
|
|
7
7
|
"dist/types"
|
|
@@ -29,7 +29,10 @@
|
|
|
29
29
|
"url": "git+https://github.com/dfpc-coe/CloudTAK.git"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
+
"@capacitor-community/keep-awake": "^8.0.1",
|
|
33
|
+
"@capacitor-firebase/messaging": "^8.2.0",
|
|
32
34
|
"@capacitor/browser": "^8.0.1",
|
|
35
|
+
"@capacitor/camera": "^8.2.0",
|
|
33
36
|
"@capacitor/clipboard": "^8.0.1",
|
|
34
37
|
"@capacitor/core": "^8.3.1",
|
|
35
38
|
"@capacitor/geolocation": "^8.1.0",
|
|
@@ -65,6 +68,7 @@
|
|
|
65
68
|
"cronstrue": "^3.0.0",
|
|
66
69
|
"dexie": "^4.2.1",
|
|
67
70
|
"dropzone": "^6.0.0-beta.2",
|
|
71
|
+
"firebase": "^12.13.0",
|
|
68
72
|
"floating-vue": "^2.0.0-beta.17",
|
|
69
73
|
"geo-coordinates-parser": "^1.7.4",
|
|
70
74
|
"geomagnetism": "^0.2.0",
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
export type BrowserPermissionState = PermissionState | 'unsupported' | 'unknown';
|
|
2
|
-
export type BrowserPermissionType = 'location' | 'notification' | 'orientation' | 'storage' | 'camera' | 'wakeLock' | 'fileSystem';
|
|
3
|
-
type FileSystemAccessHandle = FileSystemHandle & {
|
|
4
|
-
queryPermission?: (descriptor?: {
|
|
5
|
-
mode?: 'read' | 'readwrite';
|
|
6
|
-
}) => Promise<PermissionState>;
|
|
7
|
-
requestPermission?: (descriptor?: {
|
|
8
|
-
mode?: 'read' | 'readwrite';
|
|
9
|
-
}) => Promise<PermissionState>;
|
|
10
|
-
};
|
|
11
|
-
export declare const usePermissionStore: import("pinia").StoreDefinition<"permissions", {
|
|
12
|
-
permissions: Record<BrowserPermissionType, BrowserPermissionState>;
|
|
13
|
-
_wakeLockSentinel?: WakeLockSentinel | null;
|
|
14
|
-
_fileSystemHandle?: FileSystemAccessHandle | null;
|
|
15
|
-
}, {}, {
|
|
16
|
-
hasOrientationSupport: () => boolean;
|
|
17
|
-
hasOrientationPermissionRequest: () => boolean;
|
|
18
|
-
setPermissionStatus: (type: BrowserPermissionType, state: BrowserPermissionState) => void;
|
|
19
|
-
refreshLocationPermissionStatus: () => Promise<void>;
|
|
20
|
-
refreshNotificationPermissionStatus: () => Promise<void>;
|
|
21
|
-
refreshOrientationPermissionStatus: () => Promise<void>;
|
|
22
|
-
refreshStoragePermissionStatus: () => Promise<void>;
|
|
23
|
-
refreshCameraPermissionStatus: () => Promise<void>;
|
|
24
|
-
refreshWakeLockPermissionStatus: () => Promise<void>;
|
|
25
|
-
refreshFileSystemPermissionStatus: () => Promise<void>;
|
|
26
|
-
refreshPermissionStatuses: () => Promise<void>;
|
|
27
|
-
requestLocationPermission: (onGranted?: () => void) => Promise<void>;
|
|
28
|
-
requestNotificationPermission: () => Promise<void>;
|
|
29
|
-
requestOrientationPermission: () => Promise<void>;
|
|
30
|
-
requestStoragePermission: () => Promise<void>;
|
|
31
|
-
requestCameraPermission: () => Promise<void>;
|
|
32
|
-
requestWakeLockPermission: () => Promise<void>;
|
|
33
|
-
requestFileSystemPermission: () => Promise<void>;
|
|
34
|
-
initializePermissionSubscriptions: (onLocationGranted?: () => void) => Promise<void>;
|
|
35
|
-
releaseWakeLockSentinel: () => Promise<void>;
|
|
36
|
-
}>;
|
|
37
|
-
export {};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type IconHydrateResult } from '../base/icon.ts';
|
|
2
|
-
import type Atlas from './atlas.ts';
|
|
3
|
-
export type { IconHydrateResult };
|
|
4
|
-
export default class AtlasIcons {
|
|
5
|
-
atlas: Atlas;
|
|
6
|
-
constructor(atlas: Atlas);
|
|
7
|
-
hydrate(opts?: {
|
|
8
|
-
force?: boolean;
|
|
9
|
-
}): Promise<IconHydrateResult>;
|
|
10
|
-
addIconset(uid: string, opts?: {
|
|
11
|
-
force?: boolean;
|
|
12
|
-
}): Promise<boolean>;
|
|
13
|
-
removeIconset(uid: string): Promise<boolean>;
|
|
14
|
-
}
|