You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm following the API Reference docs for SimpleMeshLayer - specifically [here]https://deck.gl/docs/api-reference/mesh-layers/simple-mesh-layer#mesh). I'm trying to pass an object as the docs suggest I should be able to however I get a typescript error that there is a type mismatch:
Type '{ positions: Float32Array; normals: Float32Array; texCoords: Float32Array; }' is not assignable to type '({ positions: Float32Array; normals: Float32Array; texCoords: Float32Array; } & (string | Mesh | Promise<Mesh> | null)) | undefined'.
Type '{ positions: Float32Array; normals: Float32Array; texCoords: Float32Array; }' is not assignable to type '{ positions: Float32Array; normals: Float32Array; texCoords: Float32Array; } & Promise<Mesh>'.
Type '{ positions: Float32Array; normals: Float32Array; texCoords: Float32Array; }' is missing the following properties from type 'Promise<Mesh>': then, catch, finally, [Symbol.toStringTag]ts(2322)
Flavors
Script tag
React
Python/Jupyter notebook
MapboxOverlay
GoogleMapsOverlay
CartoLayer
ArcGIS
Expected Behavior
If I create a SimpleMeshLayer and provide a correctly formatted object for the mesh property, I would expect no type errors and the typescript compiler to build it without any issues.
Steps to Reproduce
The data and layer I use are below, the issue I have is with typing the mesh property of the layer. As you can see from the description, it seems as though it expects the object to have the fields it does, but also be a promise.
Browser: Firefox / Brave (N/A as issue as at build stage)
OS: Windows
Logs
Type '{ positions: Float32Array; normals: Float32Array; texCoords: Float32Array; }' is not assignable to type '({ positions: Float32Array; normals: Float32Array; texCoords: Float32Array; } & (string | Mesh | Promise<Mesh> | null)) | undefined'.
Type '{ positions: Float32Array; normals: Float32Array; texCoords: Float32Array; }' is not assignable to type '{ positions: Float32Array; normals: Float32Array; texCoords: Float32Array; } & Promise<Mesh>'.
Type '{ positions: Float32Array; normals: Float32Array; texCoords: Float32Array; }' is missing the following properties from type 'Promise<Mesh>': then, catch, finally, [Symbol.toStringTag]ts(2322)
The text was updated successfully, but these errors were encountered:
Description
I'm following the API Reference docs for SimpleMeshLayer - specifically [here]https://deck.gl/docs/api-reference/mesh-layers/simple-mesh-layer#mesh). I'm trying to pass an object as the docs suggest I should be able to however I get a typescript error that there is a type mismatch:
Flavors
Expected Behavior
If I create a SimpleMeshLayer and provide a correctly formatted object for the mesh property, I would expect no type errors and the typescript compiler to build it without any issues.
Steps to Reproduce
The data and layer I use are below, the issue I have is with typing the mesh property of the layer. As you can see from the description, it seems as though it expects the object to have the fields it does, but also be a promise.
Environment
Logs
The text was updated successfully, but these errors were encountered: