@@ -67,61 +67,9 @@ interface PointsStyle {
6767 } ;
6868}
6969
70- interface UseModelComponentPointsStyleReturn {
71- visibility : ( modelId : string , componentId ?: string ) => boolean ;
72- size : ( modelId : string , componentId ?: string ) => number ;
73- color : ( modelId : string , componentId ?: string ) => RGBAColor ;
74- activeColoring : ( modelId : string , componentId ?: string ) => string ;
75- vertexAttributeName : ( modelId : string , componentId ?: string ) => string | undefined ;
76- vertexAttributeItem : ( modelId : string , componentId ?: string ) => number ;
77- vertexAttributeRange : (
78- modelId : string ,
79- componentId ?: string ,
80- ) => [ number | undefined , number | undefined ] ;
81- vertexAttributeColorMap : ( modelId : string , componentId ?: string ) => string | undefined ;
82- vertexAttributeNoDataColor : ( modelId : string , componentId ?: string ) => RGBAColor ;
83- setVisibility : ( modelId : string , componentIds : string [ ] , visibility : boolean ) => Promise < unknown > ;
84- setSize : ( modelId : string , componentIds : string [ ] , size : number ) => Promise < unknown > ;
85- setColor : ( modelId : string , componentIds : string [ ] , color : RGBAColor ) => Promise < unknown > ;
86- setActiveColoring : (
87- modelId : string ,
88- componentIds : string [ ] ,
89- activeColoring : string ,
90- ) => Promise < unknown > ;
91- setVertexAttributeName : (
92- modelId : string ,
93- componentIds : string [ ] ,
94- name : string ,
95- ) => Promise < unknown > ;
96- setVertexAttributeItem : (
97- modelId : string ,
98- componentIds : string [ ] ,
99- item : number ,
100- ) => Promise < unknown > ;
101- setVertexAttributeRange : (
102- modelId : string ,
103- componentIds : string [ ] ,
104- minimum : number ,
105- maximum : number ,
106- ) => Promise < unknown > ;
107- setVertexAttributeColorMap : (
108- modelId : string ,
109- componentIds : string [ ] ,
110- colorMap : string | undefined ,
111- ) => Promise < unknown > ;
112- setVertexAttributeNoDataColor : (
113- modelId : string ,
114- componentIds : string [ ] ,
115- no_data_color : RGBAColor ,
116- ) => Promise < unknown > ;
117- mutateStyledPoints : ( modelId : string , values : PointsStyle ) => Promise < void > ;
118- applyPointsStyle : ( modelId : string ) => Promise < void > ;
119- }
120-
121- // oxlint-disable-next-line max-lines-per-function, max-statements
122- function useModelComponentPointsStyle (
123- type : PointsComponentType ,
124- ) : UseModelComponentPointsStyleReturn {
70+ // Return type is inferred, see ModelComponentPointsStyle: signatures live on the functions only
71+ // oxlint-disable-next-line max-lines-per-function, max-statements, typescript/explicit-function-return-type, typescript/explicit-module-boundary-types
72+ function useModelComponentPointsStyle ( type : PointsComponentType ) {
12573 const dataStore = useDataStore ( ) ;
12674 const dataStyleState = useDataStyleState ( ) ;
12775 const modelCommonStyle = useModelCommonStyle ( ) ;
@@ -469,7 +417,7 @@ function useModelComponentPointsStyle(
469417 } ;
470418}
471419
472- type ModelComponentPointsStyle = UseModelComponentPointsStyleReturn ;
420+ type ModelComponentPointsStyle = ReturnType < typeof useModelComponentPointsStyle > ;
473421
474422export { POINTS_COMPONENT_TYPES , useModelComponentPointsStyle } ;
475423export type { ModelComponentPointsStyle } ;
0 commit comments