Skip to content

refactor(map) :: import and use 3rd party Leaflet types - #1514

Open
81reap wants to merge 3 commits into
mainfrom
81reap/ts-9-leaflet-types
Open

81reap wants to merge 3 commits into
mainfrom
81reap/ts-9-leaflet-types

Conversation

@81reap

@81reap 81reap commented Sep 29, 2026

Copy link
Copy Markdown
Collaborator

declare const L: Untyped meant every Leaflet value in sqlpage_map was typed any.

Now we import @types/leaflet and use the types in SQLPage.


Stack created with GitHub Stacks CLI • Give Feedback 💬

Before loosly typed `Object.protoype` was used to map user inputs to built in properties.

This is what a `Map` is supposed to do, so we use that with stong types.
`chart.handlebars` emits 6 keys for a reference line and stringifies so that unset fields come in as null. This is now explictly set in the type by making it a `Record`.
`declare const L: Untyped` meant every Leaflet value in sqlpage_map was typed `any`.

Now we import `@types/leaflet` and use the types in SQLPage.
@81reap
81reap added this pull request to stack #1512 September 29, 2026 23:31
@81reap
81reap force-pushed the 81reap/ts-9-leaflet-types branch from 03d2ac7 to c0b378d Compare September 30, 2026 00:19
Base automatically changed from 81reap/ts-8 to main September 30, 2026 00:35
@81reap
81reap force-pushed the 81reap/ts-9-leaflet-types branch 2 times, most recently from c7bd3da to 03d2ac7 Compare September 30, 2026 00:38
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