Improve return type of useNodesdata

This commit is contained in:
peterkogo
2026-02-10 10:58:51 +01:00
parent be40c34010
commit ce6c869df4
7 changed files with 33 additions and 18 deletions

View File

@@ -56,3 +56,10 @@ export type Transform = [number, number, number];
* to represent an unbounded extent.
*/
export type CoordinateExtent = [[number, number], [number, number]];
/**
* Using Pick with a union type (e.g. `NodeType`) will merge every property type along all union members.
* See https://github.com/microsoft/TypeScript/issues/28339#issuecomment-463577347
* Note: Currently you are able to Pick properties that are not in the type without error.
*/
export type DistributivePick<T, K extends string> = T extends unknown ? { [P in Extract<keyof T, K>]: T[P] } : never;