Skip to content

Typescript fixes - #4093

Draft
Williangalvani wants to merge 23 commits into
bluerobotics:masterfrom
Williangalvani:tsfix/integration
Draft

Typescript fixes#4093
Williangalvani wants to merge 23 commits into
bluerobotics:masterfrom
Williangalvani:tsfix/integration

Conversation

@Williangalvani

@Williangalvani Williangalvani commented Aug 6, 2026

Copy link
Copy Markdown
Member

this is here as a reference, I'll re-submit it in smaller, targetted prs

Williangalvani and others added 23 commits August 6, 2026 12:57
…o 5.4.5

tsconfig.json already sets "moduleResolution": "bundler", which only exists
in TypeScript 5.0+, so the pinned ~4.9.5 could not even parse its own config
from the CLI. Editors were papering over this with their own bundled TS 5.x.

Adds vue-tsc so .vue single-file components can be type-checked, exposed as
a non-gating `type-check` script. CI is deliberately left alone; the script
is for local use until the existing errors are fixed.

Also drops the vestigial "webpack-env" type, left over from the vue-cli days
and no longer installed or used anywhere in src.

Co-authored-by: Cursor <cursoragent@cursor.com>
Under TS5's stricter decorator resolution, `@Module({...})` binds to the
void-returning overload, producing TS1238 on every Vuex store. Introduce a
small DynamicModule helper that wraps Module and casts the result to a
ClassDecorator, and use it (aliased as Module) across all stores.

Also removes a stray bare `@Module` decorator that was duplicated on top of
the `@Module({...})` factory in the notifications and video stores.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Drop "moduleDetection": "force", which forced every file to be a module
  and turned the ambient `declare module '*.ext'` shims into illegal
  augmentations.
- Remove the redundant *.svg/*.jpg/*.png shims that are already provided by
  vite/client (they conflicted on the default export).
- Remove the unused "webpack-env" types entry (leftover from the vue-cli
  setup; the package isn't installed and nothing in src uses it).

Co-authored-by: Cursor <cursoragent@cursor.com>
The inline lookup objects were inferred with only their two literal enum
keys, so indexing them with the full PreflightCalibration union produced
TS2339 for every other member. Annotate them as Record<number, number>.

Co-authored-by: Cursor <cursoragent@cursor.com>
The image prop was typed as Dictionary<string> (and inferred as {}), so
accessing .repository/.tag/.sha/.last_modified failed type-checking.
Type it as the existing Version interface, which is what callers pass.

Co-authored-by: Cursor <cursoragent@cursor.com>
QueryTarget has no BestMatching member (it is BEST_MATCHING), so these
queries were passing `undefined` as the target. Caught by type-checking.

Co-authored-by: Cursor <cursoragent@cursor.com>
`attrs` is undefined on this component (a leftover from Vuetify's
skeleton-loader slot example), so the binding was a no-op. Caught by
type-checking.

Co-authored-by: Cursor <cursoragent@cursor.com>
…solution

Vue 2.7's package `exports` map prevents `moduleResolution: "bundler"` from
resolving `vue/types/vue` as a `declare module` augmentation target. This
silently dropped the `interface Vue` augmentations from vue-router
($route/$router) and vuetify ($vuetify), producing ~26 spurious TS2339
errors on `this.$route`/`this.$router`/`this.$vuetify`.

Add an explicit `paths` mapping for `vue/types/vue` so those ambient
augmentations merge into the real `interface Vue` again.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Add @types/three (matching three@0.156) and map three addon subpaths
  and vuex to their declaration files (their exports maps hide types from
  bundler moduleResolution).
- Add ambient module shims for colorthief and the local style/colors js.
- Type OrientationPicker camera as PerspectiveCamera and widen GLTFLoader
  onError callbacks to unknown to match the loader signature.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Declare ambient require()/process.env globals (provided at build time by
  vue-template-babel-compiler and Vite's define).
- Import GPS message types from the Message namespace in GpsTrayMenu.
- Add the JournalResponse interface used by the system-information store.
- Import Dictionary from @/types/common instead of the (unexported)
  vue-router internal type.

Co-authored-by: Cursor <cursoragent@cursor.com>
The generated GpsRawInt/Gps2Raw types expose fix_type as a bare enum, but
mavlink2rest wraps enum fields as { type: <enum> } at runtime. Add a
fix_type computed that unwraps it via Type<GpsFixType>, and widen the
gps_raw_int field to also accept Gps2Raw.

Co-authored-by: Cursor <cursoragent@cursor.com>
Introduce a UdevProperties (Record<string, string | undefined>) type for
SerialPortInfo.udev_properties instead of the opaque JSONValue, so device
fields like DEVNAME/ID_MODEL/ID_VENDOR can be read directly, and add the
missing null-guard in BridgeCard's template.

Co-authored-by: Cursor <cursoragent@cursor.com>
Container stats report memory/disk as either a percentage number or the
string "N/A". Type the metrics prop accordingly and move the used/total
formatting into memory_usage_text/disk_usage_text computeds so the numeric
guard is type-checked instead of relying on a template `?.toFixed` probe.

Co-authored-by: Cursor <cursoragent@cursor.com>
Vuetify's v-checkbox binds v-model to its inputValue prop via the change
event, but vue-tsc's template checker assumes the default value prop, which
collides with the explicit :value used for array membership and raises a
false TS1117 duplicate-key error. Bind :input-value + @change explicitly
(the exact desugaring of v-model) to keep runtime behaviour identical.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Type the serial item-value/item-disabled callbacks and the parameter
  table row handlers instead of relying on implicit any.
- Narrow caught errors to the axios response shape before reading
  response.status in ExtensionSettingsModal.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Guard ProgressEvent.total (optional) before computing upload/download
  percentages in NetworkSpeedTest and VersionChooser.
- Accept a nullable sha in imageIsAvailableLocally and coerce the bag logo
  path to string | null to match the data field.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Optional-chain wifi_status and check filtered_networks against undefined
  in WifiManager.
- Drop the spurious | undefined from the always-populated filtered_param_sets
  computeds and coerce the v-for object key to string in ParamSets.
- Guard the light-steps division and compute baro ground pressure from the
  parameter value instead of the formatted printParam string.

Co-authored-by: Cursor <cursoragent@cursor.com>
…fy options

Same bundler/exports issue as vue/types/vue: without an explicit paths
mapping, vue-router's and vuetify's `router`/`vuetify` ComponentOptions
augmentations are dropped, so `new Vue({ router, vuetify, ... })` failed.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Deref the disposeWith WeakRef once and type the vue-internal _isDestroyed
  probe in OneMoreTime.
- Allow banner() to return undefined for unknown autopilot types.
- Cast the non-numeric ArduPilot metadata entries to Metadata.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Add a module augmentation for the $tours property vue-tour installs on
  the Vue prototype.
- Resolve openCreationDialogFromUpload's default inside the body instead of
  referencing this in a parameter default (which is untyped).

Co-authored-by: Cursor <cursoragent@cursor.com>
- getDHCPServerDetails now unwraps and returns the keyed details map it
  actually produces, and InterfaceCard indexes it directly.
- Type Wizard's current_page_bind as a record for v-bind spreading and cast
  the param_loader ref before calling validateParams.

Co-authored-by: Cursor <cursoragent@cursor.com>
- Give ServoFunctionRangeEditor's paramMap a literal key union so the
  computed params can be indexed on the instance.
- Type the model-viewer annotation JSON (with its extra text field) and the
  eager glob map, and derive the annotation path from autopilot's frame_name
  getter instead of calling the modelHelper frame_name() with no arguments.

Co-authored-by: Cursor <cursoragent@cursor.com>
Use cytoscape's ElementDefinition for the graph elements (so node labels and
edge ids are accepted), cast the fcose layout to FcoseLayoutOptions, and cast
the stylesheet to cytoscape's style option type.

Co-authored-by: Cursor <cursoragent@cursor.com>
@Williangalvani Williangalvani changed the title Tsfix/integration Typescript fixes Aug 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant