Skip to content

feat(deck.gl-geotiff): export COGLayer's default tile data type - #722

Merged
kylebarron merged 1 commit into
mainfrom
kyle/export-cog-tile-data-type
Oct 16, 2026
Merged

kylebarron merged 1 commit into
mainfrom
kyle/export-cog-tile-data-type

Conversation

@kylebarron

Copy link
Copy Markdown
Member

Note

This PR was written by Claude (Claude Code), not by @kylebarron.

COGLayer's default DataT was an unexported DefaultDataT with texture and byteLength, while the default pipeline returns TextureDataT, which also has an optional mask. Code that types a tile callback or stores the layer in a typed field had to copy the type by hand, and a copy of the default missed mask.

This makes TextureDataT the default DataT of COGLayer and COGLayerProps, deletes DefaultDataT, documents TextureDataT's fields, and exports it from @developmentseed/deck.gl-geotiff. A new type test checks that new COGLayer({ geotiff }) is a COGLayer<TextureDataT> and that onTileUnload receives TextureDataT | null.

The issue's second point, that DataT falls back to MinimalTileData when getTileData is omitted, doesn't reproduce with TypeScript 7.0.2 or 5.9.3: new COGLayer({ geotiff }) already infers the class default, which the new test checks.

Closes #672

🤖 Written by Claude Code

COGLayer's default `DataT` was an unexported `DefaultDataT` that left out
`mask`, while the default pipeline returns `TextureDataT`. Make
`TextureDataT` the default and export it, so code that types tile
callbacks or stores the layer can name the type, mask included.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@github-actions github-actions Bot added the feat label Oct 16, 2026

@kylebarron kylebarron left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

lgtm

@kylebarron
kylebarron merged commit 49326de into main Oct 16, 2026
3 checks passed
@kylebarron
kylebarron deleted the kyle/export-cog-tile-data-type branch October 16, 2026 18:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Export the default tile-data type and infer it for new COGLayer({...}) without getTileData

1 participant