Skip to content

add TypeScript types to annotation async fetchers#414

Open
maxachis wants to merge 1 commit intodevfrom
issue/404-annotation-api-types
Open

add TypeScript types to annotation async fetchers#414
maxachis wants to merge 1 commit intodevfrom
issue/404-annotation-api-types

Conversation

@maxachis
Copy link
Copy Markdown
Contributor

Summary

  • Renames api/typeahead.js → .ts with exported TypeaheadLocationSuggestion and
    TypeaheadAgencySuggestion types and a generically-typed factory function
  • Types useMutation generics, refs, defineEmits, and handler params in
    SearchLocationForm.vue and SearchAgencyForm.vue
  • Re-exports LocationSuggestion from the canonical @/api/typeahead types for backward
    compatibility
  • Removes broken UseQueryResult annotation from index.vue
    (TanStack Query v5 infers it)
  • Removes dead AgencyLocationSuggestionType import from helpers.ts

Closes #404

Test plan

  • npm run lint — no errors
  • npm run build — builds successfully
  • npm run test:unit — all 30 tests pass
  • Verify annotation page loads and typeahead search works for both agency and location
  • Verify non-annotation consumers (SearchForm.vue, data-requests/create.vue,
    data-sources/create.vue) still resolve the renamed import

- Rename api/typeahead.js → .ts with typed generic factory
- Define TypeaheadLocationSuggestion and TypeaheadAgencySuggestion types
- Type useMutation generics, refs, emits, and handlers in SearchLocationForm and SearchAgencyForm
- Re-export LocationSuggestion from canonical typeahead types
- Remove broken UseQueryResult annotation from index.vue
- Remove dead AgencyLocationSuggestionType import from helpers.ts

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@maxachis maxachis changed the base branch from main to dev February 26, 2026 22:57
Copy link
Copy Markdown
Collaborator

@joshuagraber joshuagraber left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. One question on the devcontainer setup. I'm not opposed to adding that, but let's document any changes to dev workflow, please.

Comment thread .devcontainer/devcontainer.json Outdated
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you mean to commit this?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope! Removed.

@maxachis maxachis force-pushed the issue/404-annotation-api-types branch from 104940d to d9b548f Compare April 13, 2026 18:33
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.

Annotation: Define API types with the Async Fetchers

2 participants