@tak-ps/cloudtak 13.60.0 → 13.61.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.
@@ -28,6 +28,7 @@ export declare const useMapStore: import("pinia").StoreDefinition<"cloudtak", {
28
28
  _bottomBar?: unknown;
29
29
  _removeOrientationListener?: () => Promise<void>;
30
30
  _resumeRecovery?: Promise<void>;
31
+ _cotResync?: Promise<void>;
31
32
  _removeBackgroundStateListener?: () => void;
32
33
  _removePushTokenListener?: () => void;
33
34
  channel: BroadcastChannel;
@@ -126,6 +127,13 @@ export declare const useMapStore: import("pinia").StoreDefinition<"cloudtak", {
126
127
  */
127
128
  sweepDirtyMissions: () => Promise<void>;
128
129
  updateCOT: () => Promise<void>;
130
+ /**
131
+ * Rebuild the CoT GeoJSON source wholesale from the worker's full
132
+ * feature state. Used on app resume and as recovery whenever an
133
+ * incremental diff was consumed from the worker but failed to apply -
134
+ * without this those features would never render again.
135
+ */
136
+ resyncCOT: () => Promise<void>;
129
137
  /**
130
138
  * Repaint a Mission overlay's source from locally stored features -
131
139
  * no network or Active Mission side effects, safe for the dirty sweep
@@ -11,6 +11,13 @@ export default class AtlasConnection {
11
11
  private reconnectTimer;
12
12
  constructor(atlas: Atlas);
13
13
  reconnect(connection: string): void;
14
+ /**
15
+ * Called when the app returns to the foreground. iOS suspension can kill
16
+ * the TCP connection with no FIN reaching the client (NAT/LB idle
17
+ * timeout), so no close event ever fires and `isOpen` cannot be trusted -
18
+ * always rebuild the socket unless the user has logged out.
19
+ */
20
+ resume(connection: string): void;
14
21
  connect(connection: string): void;
15
22
  private scheduleReconnect;
16
23
  private isAuthRejected;
@@ -3,6 +3,7 @@ import COT from '../base/cot.ts';
3
3
  import type { GeoJSONSourceDiff } from 'maplibre-gl';
4
4
  import type { Polygon } from 'geojson';
5
5
  import type { InputFeature, Feature } from '../types.ts';
6
+ import type { Feature as GeoJSONFeature, Geometry as GeoJSONGeometry } from 'geojson';
6
7
  import * as Comlink from 'comlink';
7
8
  import AtlasBreadcrumb from './atlas-breadcrumb.ts';
8
9
  type NestedArray = {
@@ -44,6 +45,18 @@ export default class AtlasDatabase {
44
45
  * Generate a GeoJSONDiff on existing COT Features
45
46
  */
46
47
  diff(): Promise<GeoJSONSourceDiff>;
48
+ /**
49
+ * Has a CoT's stale time exceeded the user's configured display window
50
+ */
51
+ static staleElapsed(display_stale: string, stale: number, now: number): boolean;
52
+ /**
53
+ * Full-state render of every visible CoT, for replacing the map source
54
+ * contents wholesale via setData. diff() consumes its pending queues
55
+ * even when the main thread fails to apply the result, so a lost diff
56
+ * (or any doubt after an app resume) is recovered here; the queues are
57
+ * cleared as the snapshot supersedes them.
58
+ */
59
+ snapshot(): Promise<Array<GeoJSONFeature<GeoJSONGeometry, Record<string, unknown>>>>;
47
60
  /**
48
61
  * Iterate over all CoTs and delete toTs that match the filter pattern
49
62
  * @param filter - JSONata filter expression to match CoTs against
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tak-ps/cloudtak",
3
3
  "type": "module",
4
- "version": "13.60.0",
4
+ "version": "13.61.0",
5
5
  "types": "dist/types/plugin.d.ts",
6
6
  "files": [
7
7
  "dist/types"