diff --git a/AGENTS.md b/AGENTS.md index 97e36aedc..0585982f5 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -83,6 +83,25 @@ import { merchantList } from '$lib/merchantListStore'; import type { Place, Report, AreaTags } from '$lib/types'; ``` +### Generated API types (`$types/btcmap-api`) + +- `src/types/btcmap-api/` is generated from btcmap-api's Rust response structs + (ts-rs) — never hand-edit it; it is excluded from biome and must stay + byte-identical to the generator's output +- Refresh with `pnpm types:api` — it fetches the committed `bindings/ts/` + directory from btcmap-api's master on GitHub (no Rust toolchain or checkout + needed; btcmap-api CI guarantees that directory matches its code). Commit + the resulting diff — it documents the API change +- To develop against an unmerged btcmap-api branch: + `npx degit "teambtcmap/btcmap-api/bindings/ts#" src/types/btcmap-api` +- Import these types (via the `$types` alias) when typing raw v4 API responses, + e.g. `import type { SearchResponse } from "$types/btcmap-api/SearchResponse"` +- **Two `Place` types exist during the migration:** `Place` from `$lib/types` + stays the app-facing type used by stores and components; the generated + `$types/btcmap-api/Place` is the API contract shape for the `fields`-driven + endpoints (all fields optional). Don't autocomplete the wrong one — if a + store or component needs `Place`, it's the `$lib/types` one + ### Comments - **Avoid JSDoc comments** (`/** */` with `@param`, `@returns`, `@description`, etc.) diff --git a/biome.json b/biome.json index 1bd571d4d..362e945e3 100644 --- a/biome.json +++ b/biome.json @@ -18,7 +18,8 @@ "!spritesheet-*.ts", "!playwright-report", "!src/error.html", - "!**/*.svg" + "!**/*.svg", + "!src/types/btcmap-api" ] }, "assist": { diff --git a/package.json b/package.json index 63e6aa3de..4c506fb2f 100644 --- a/package.json +++ b/package.json @@ -23,6 +23,7 @@ "preview": "vite preview", "sync:rtl-plugin": "cp node_modules/@mapbox/mapbox-gl-rtl-text/dist/mapbox-gl-rtl-text.js static/mapbox-gl-rtl-text.js", "test": "vitest", + "types:api": "rm -rf src/types/btcmap-api && npx degit teambtcmap/btcmap-api/bindings/ts src/types/btcmap-api", "typecheck": "tsc --project ./tsconfig.json --noEmit --pretty" }, "lint-staged": { diff --git a/src/routes/api/search/places/+server.ts b/src/routes/api/search/places/+server.ts index 51d0b7a04..c05e6808a 100644 --- a/src/routes/api/search/places/+server.ts +++ b/src/routes/api/search/places/+server.ts @@ -3,6 +3,7 @@ import { error } from "@sveltejs/kit"; import { API_BASE } from "$lib/api-base"; import type { RequestHandler } from "./$types"; +import type { SearchResponse } from "$types/btcmap-api/SearchResponse"; // Worldwide free-text search. Backed by /v4/search, which matches every OSM tag // value, so a city name finds the places addressed in that city. Scoped to @@ -43,12 +44,11 @@ export const GET: RequestHandler = async ({ url, fetch }) => { error(res.status, "Search temporarily unavailable"); } - const body = (await res.json()) as { - results?: ({ type: string } & Record)[]; - total_count?: number; - has_more?: boolean; - }; - // Drop the discriminator so each row is exactly a Place. + // Partial: the type describes what the current API sends, but this proxy + // deliberately tolerates an upstream that omits fields (see tests). + const body = (await res.json()) as Partial; + // Drop the discriminator; `type_filter=place` means every row is a place + // at runtime, though the static type stays the area/place union. const places = (body.results ?? []).map(({ type: _type, ...place }) => place); // The API caps `limit`, so a broad query ("str" matches every addr:street) diff --git a/src/types/btcmap-api/ActivityItem.ts b/src/types/btcmap-api/ActivityItem.ts new file mode 100644 index 000000000..354d59d0e --- /dev/null +++ b/src/types/btcmap-api/ActivityItem.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type ActivityItem = { type: string, place_id: number, place_name?: string, osm_user_id?: number, osm_user_name?: string, osm_user_tip?: string, comment?: string, duration_days?: number, image: string, date: string, }; diff --git a/src/types/btcmap-api/Area.ts b/src/types/btcmap-api/Area.ts new file mode 100644 index 000000000..29e4fb773 --- /dev/null +++ b/src/types/btcmap-api/Area.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type Area = { id: number, name: string, type: string, url_alias: string, icon: string | null, icon_wide: string | null, website_url: string, description: string, }; diff --git a/src/types/btcmap-api/AreaSearchResult.ts b/src/types/btcmap-api/AreaSearchResult.ts new file mode 100644 index 000000000..2ebca8917 --- /dev/null +++ b/src/types/btcmap-api/AreaSearchResult.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type AreaSearchResult = { id: number, name: string, type: string, url_alias: string, icon: string | null, website_url: string, }; diff --git a/src/types/btcmap-api/AuthNostrResponse.ts b/src/types/btcmap-api/AuthNostrResponse.ts new file mode 100644 index 000000000..3a4916fbc --- /dev/null +++ b/src/types/btcmap-api/AuthNostrResponse.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type AuthNostrResponse = { token: string, username: string, npub: string, }; diff --git a/src/types/btcmap-api/ChangePasswordArgs.ts b/src/types/btcmap-api/ChangePasswordArgs.ts new file mode 100644 index 000000000..d73c4dc5f --- /dev/null +++ b/src/types/btcmap-api/ChangePasswordArgs.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type ChangePasswordArgs = { old_password: string, new_password: string, }; diff --git a/src/types/btcmap-api/ChartEntry.ts b/src/types/btcmap-api/ChartEntry.ts new file mode 100644 index 000000000..203e41da9 --- /dev/null +++ b/src/types/btcmap-api/ChartEntry.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type ChartEntry = { date: string, value: number, }; diff --git a/src/types/btcmap-api/Community.ts b/src/types/btcmap-api/Community.ts new file mode 100644 index 000000000..59934288d --- /dev/null +++ b/src/types/btcmap-api/Community.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type Community = { id: number, alias: string, name: string, icon: string | null, places_total: number, places_verified_1y: number, grade: number, }; diff --git a/src/types/btcmap-api/Country.ts b/src/types/btcmap-api/Country.ts new file mode 100644 index 000000000..dc1f1374a --- /dev/null +++ b/src/types/btcmap-api/Country.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type Country = { id: number, alias: string, name: string, icon: string | null, places_total: number, places_verified_1y: number, grade: number, }; diff --git a/src/types/btcmap-api/CreateTokenArgs.ts b/src/types/btcmap-api/CreateTokenArgs.ts new file mode 100644 index 000000000..ed5fb0bd5 --- /dev/null +++ b/src/types/btcmap-api/CreateTokenArgs.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type CreateTokenArgs = { label: string | null, }; diff --git a/src/types/btcmap-api/CreateTokenResponse.ts b/src/types/btcmap-api/CreateTokenResponse.ts new file mode 100644 index 000000000..b8ce5f23f --- /dev/null +++ b/src/types/btcmap-api/CreateTokenResponse.ts @@ -0,0 +1,4 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { MeResponse } from "./MeResponse"; + +export type CreateTokenResponse = { token: string, user: MeResponse, }; diff --git a/src/types/btcmap-api/CreateUserArgs.ts b/src/types/btcmap-api/CreateUserArgs.ts new file mode 100644 index 000000000..45a64adc5 --- /dev/null +++ b/src/types/btcmap-api/CreateUserArgs.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type CreateUserArgs = { name: string | null, password: string, }; diff --git a/src/types/btcmap-api/CreateUserResponse.ts b/src/types/btcmap-api/CreateUserResponse.ts new file mode 100644 index 000000000..67ee9bcb8 --- /dev/null +++ b/src/types/btcmap-api/CreateUserResponse.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type CreateUserResponse = { id: number, name: string, roles: Array, }; diff --git a/src/types/btcmap-api/Dashboard.ts b/src/types/btcmap-api/Dashboard.ts new file mode 100644 index 000000000..d7eb9d2d4 --- /dev/null +++ b/src/types/btcmap-api/Dashboard.ts @@ -0,0 +1,4 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { ChartEntry } from "./ChartEntry"; + +export type Dashboard = { total_merchants: number, total_merchants_chart: Array, verified_merchants_1y: number, verified_merchants_1y_chart: Array, total_exchanges: number, total_exchanges_chart: Array, verified_exchanges_1y: number, total_areas: number, verified_areas_1y: number, }; diff --git a/src/types/btcmap-api/Invoice.ts b/src/types/btcmap-api/Invoice.ts new file mode 100644 index 000000000..f59a7d627 --- /dev/null +++ b/src/types/btcmap-api/Invoice.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type Invoice = { id: string, status: string, }; diff --git a/src/types/btcmap-api/MeResponse.ts b/src/types/btcmap-api/MeResponse.ts new file mode 100644 index 000000000..f0e746f22 --- /dev/null +++ b/src/types/btcmap-api/MeResponse.ts @@ -0,0 +1,15 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { SavedArea } from "./SavedArea"; +import type { SavedPlace } from "./SavedPlace"; + +export type MeResponse = { id: number, name: string, roles: Array, saved_places: Array, saved_areas: Array, +/** + * Area ids the user is restricted to when acting as an event manager. + * Empty means unrestricted. + */ +geofence: Array, +/** + * Bech32 npub (`npub1...`) of the Nostr identity linked to this user, + * or `null` when no pubkey is linked. + */ +npub: string | null, }; diff --git a/src/types/btcmap-api/NostrIdentityResponse.ts b/src/types/btcmap-api/NostrIdentityResponse.ts new file mode 100644 index 000000000..07dcbc78e --- /dev/null +++ b/src/types/btcmap-api/NostrIdentityResponse.ts @@ -0,0 +1,7 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type NostrIdentityResponse = { +/** + * Bech32 npub (`npub1...`) currently linked to the account, or `null`. + */ +npub: string | null, }; diff --git a/src/types/btcmap-api/PaginationInfo.ts b/src/types/btcmap-api/PaginationInfo.ts new file mode 100644 index 000000000..0c0ded93e --- /dev/null +++ b/src/types/btcmap-api/PaginationInfo.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type PaginationInfo = { offset: number, limit: number, total: number, }; diff --git a/src/types/btcmap-api/Place.ts b/src/types/btcmap-api/Place.ts new file mode 100644 index 000000000..5ae718002 --- /dev/null +++ b/src/types/btcmap-api/Place.ts @@ -0,0 +1,11 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +/** + * Type-export-only description of the dynamic place responses. + * `GET /v4/places` and `GET /v4/places/{id}` build their JSON at runtime + * from the `fields` query param, so every field except `id` is optional. + * Fields requested via the `osm:` passthrough appear as extra keys and + * cannot be typed statically. Kept in sync with `service::element::TAGS` by + * `place_type_covers_all_generate_tags_fields`. + */ +export type Place = { id: number, osm_id?: string, osm_url?: string, osm_edit_url?: string, lat?: number, lon?: number, name?: string, address?: string, icon?: string, phone?: string, website?: string, twitter?: string, facebook?: string, instagram?: string, line?: string, email?: string, opening_hours?: string, boosted_until?: string, required_app_url?: string, created_at?: string, updated_at?: string, deleted_at?: string, verified_at?: string, comments?: number, description?: string, image?: string, payment_provider?: string, telegram?: string, localized_name?: Record, localized_opening_hours?: Record, }; diff --git a/src/types/btcmap-api/PlaceActivity.ts b/src/types/btcmap-api/PlaceActivity.ts new file mode 100644 index 000000000..c3032d1fc --- /dev/null +++ b/src/types/btcmap-api/PlaceActivity.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type PlaceActivity = { id: number, type: string, user_id: number | null, user_name?: string, user_tip?: string, created_at: string, updated_at: string, }; diff --git a/src/types/btcmap-api/PlaceArea.ts b/src/types/btcmap-api/PlaceArea.ts new file mode 100644 index 000000000..e330a4790 --- /dev/null +++ b/src/types/btcmap-api/PlaceArea.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type PlaceArea = { id: number, alias: string, tags: Record, created_at: string, updated_at: string, }; diff --git a/src/types/btcmap-api/PlaceBoostQuote.ts b/src/types/btcmap-api/PlaceBoostQuote.ts new file mode 100644 index 000000000..6b3126c0d --- /dev/null +++ b/src/types/btcmap-api/PlaceBoostQuote.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type PlaceBoostQuote = { quote_30d_sat: number, quote_90d_sat: number, quote_365d_sat: number, }; diff --git a/src/types/btcmap-api/PlaceComment.ts b/src/types/btcmap-api/PlaceComment.ts new file mode 100644 index 000000000..d3949fad4 --- /dev/null +++ b/src/types/btcmap-api/PlaceComment.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type PlaceComment = { id: number, text: string, created_at: string, }; diff --git a/src/types/btcmap-api/PlaceCommentListItem.ts b/src/types/btcmap-api/PlaceCommentListItem.ts new file mode 100644 index 000000000..7779b640b --- /dev/null +++ b/src/types/btcmap-api/PlaceCommentListItem.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type PlaceCommentListItem = { id: number, place_id: number, text: string, created_at: string, updated_at: string, deleted_at?: string, }; diff --git a/src/types/btcmap-api/PlaceCommentQuote.ts b/src/types/btcmap-api/PlaceCommentQuote.ts new file mode 100644 index 000000000..33422dd9d --- /dev/null +++ b/src/types/btcmap-api/PlaceCommentQuote.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type PlaceCommentQuote = { quote_sat: number, }; diff --git a/src/types/btcmap-api/PlaceIssue.ts b/src/types/btcmap-api/PlaceIssue.ts new file mode 100644 index 000000000..9ab2f9673 --- /dev/null +++ b/src/types/btcmap-api/PlaceIssue.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type PlaceIssue = { id: number, place_id: number, code: string, severity: number, created_at: string, updated_at: string, deleted_at?: string, }; diff --git a/src/types/btcmap-api/PlaceIssueSummary.ts b/src/types/btcmap-api/PlaceIssueSummary.ts new file mode 100644 index 000000000..b216373ff --- /dev/null +++ b/src/types/btcmap-api/PlaceIssueSummary.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type PlaceIssueSummary = { element_osm_type: string, element_osm_id: number, element_name: string, issue_code: string, }; diff --git a/src/types/btcmap-api/PlaceIssuesRes.ts b/src/types/btcmap-api/PlaceIssuesRes.ts new file mode 100644 index 000000000..0b2b98519 --- /dev/null +++ b/src/types/btcmap-api/PlaceIssuesRes.ts @@ -0,0 +1,4 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { PlaceIssueSummary } from "./PlaceIssueSummary"; + +export type PlaceIssuesRes = { total_issues: number, requested_issues: Array, }; diff --git a/src/types/btcmap-api/PostPlaceBoostArgs.ts b/src/types/btcmap-api/PostPlaceBoostArgs.ts new file mode 100644 index 000000000..ec70ac848 --- /dev/null +++ b/src/types/btcmap-api/PostPlaceBoostArgs.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type PostPlaceBoostArgs = { place_id: string, days: number, }; diff --git a/src/types/btcmap-api/PostPlaceBoostResponse.ts b/src/types/btcmap-api/PostPlaceBoostResponse.ts new file mode 100644 index 000000000..1a91a20d0 --- /dev/null +++ b/src/types/btcmap-api/PostPlaceBoostResponse.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type PostPlaceBoostResponse = { invoice_id: string, invoice: string, }; diff --git a/src/types/btcmap-api/PostPlaceCommentArgs.ts b/src/types/btcmap-api/PostPlaceCommentArgs.ts new file mode 100644 index 000000000..076094bbb --- /dev/null +++ b/src/types/btcmap-api/PostPlaceCommentArgs.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type PostPlaceCommentArgs = { place_id: string, comment: string, }; diff --git a/src/types/btcmap-api/PostPlaceCommentResponse.ts b/src/types/btcmap-api/PostPlaceCommentResponse.ts new file mode 100644 index 000000000..55c428f16 --- /dev/null +++ b/src/types/btcmap-api/PostPlaceCommentResponse.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type PostPlaceCommentResponse = { invoice_id: string, invoice: string, }; diff --git a/src/types/btcmap-api/SavedArea.ts b/src/types/btcmap-api/SavedArea.ts new file mode 100644 index 000000000..60a91d2ea --- /dev/null +++ b/src/types/btcmap-api/SavedArea.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type SavedArea = { id: number, name: string, }; diff --git a/src/types/btcmap-api/SavedPlace.ts b/src/types/btcmap-api/SavedPlace.ts new file mode 100644 index 000000000..179e30f8e --- /dev/null +++ b/src/types/btcmap-api/SavedPlace.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type SavedPlace = { id: number, name: string, }; diff --git a/src/types/btcmap-api/SearchResponse.ts b/src/types/btcmap-api/SearchResponse.ts new file mode 100644 index 000000000..b4ca7fba8 --- /dev/null +++ b/src/types/btcmap-api/SearchResponse.ts @@ -0,0 +1,5 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { PaginationInfo } from "./PaginationInfo"; +import type { SearchResult } from "./SearchResult"; + +export type SearchResponse = { results: Array, total_count: number, has_more: boolean, query: string, pagination: PaginationInfo, }; diff --git a/src/types/btcmap-api/SearchResult.ts b/src/types/btcmap-api/SearchResult.ts new file mode 100644 index 000000000..cd67dc125 --- /dev/null +++ b/src/types/btcmap-api/SearchResult.ts @@ -0,0 +1,9 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. +import type { SearchedArea } from "./SearchedArea"; +import type { SearchedPlace } from "./SearchedPlace"; + +/** + * `SearchedPlace` is boxed because it is an order of magnitude larger than + * `SearchedArea`, and clippy's `large_enum_variant` would otherwise fire. + */ +export type SearchResult = { "type": "area" } & SearchedArea | { "type": "place" } & SearchedPlace; diff --git a/src/types/btcmap-api/SearchedArea.ts b/src/types/btcmap-api/SearchedArea.ts new file mode 100644 index 000000000..a2fc2d22d --- /dev/null +++ b/src/types/btcmap-api/SearchedArea.ts @@ -0,0 +1,7 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type SearchedArea = { id: number, name: string, alias?: string, +/** + * `[west, south, east, north]`. Absent when the area has no bbox of its own. + */ +bbox?: [number, number, number, number], }; diff --git a/src/types/btcmap-api/SearchedPlace.ts b/src/types/btcmap-api/SearchedPlace.ts new file mode 100644 index 000000000..5a77e45ae --- /dev/null +++ b/src/types/btcmap-api/SearchedPlace.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type SearchedPlace = { id: number, lat: number, lon: number, icon: string, name: string, address?: string, opening_hours?: string, comments?: number, created_at: string, updated_at: string, verified_at: string | null, osm_id?: string, phone?: string, website?: string, twitter?: string, facebook?: string, instagram?: string, line?: string, email?: string, boosted_until?: string, required_app_url?: string, description?: string, image?: string, payment_provider?: string, localized_name?: Record, }; diff --git a/src/types/btcmap-api/TopEditor.ts b/src/types/btcmap-api/TopEditor.ts new file mode 100644 index 000000000..19dde8a3d --- /dev/null +++ b/src/types/btcmap-api/TopEditor.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type TopEditor = { id: number, name: string, avatar_url: string | null, total_edits: number, places_created: number, places_updated: number, places_deleted: number, tip_url: string | null, }; diff --git a/src/types/btcmap-api/UpdateUsernameArgs.ts b/src/types/btcmap-api/UpdateUsernameArgs.ts new file mode 100644 index 000000000..b1688af05 --- /dev/null +++ b/src/types/btcmap-api/UpdateUsernameArgs.ts @@ -0,0 +1,3 @@ +// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. + +export type UpdateUsernameArgs = { username: string, }; diff --git a/svelte.config.js b/svelte.config.js index ea0b50d94..edd615c36 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -14,7 +14,9 @@ const config = { adapter: adapter(), alias: { $components: 'src/components', - '$components/*': 'src/components/*' + '$components/*': 'src/components/*', + $types: 'src/types', + '$types/*': 'src/types/*' }, serviceWorker: { register: true,