@@ -8,15 +8,15 @@ import type {
88 DataDrivenPropertyValueSpecification
99} from './types.g' ;
1010
11- function getPropertyReference ( propertyName ) : StylePropertySpecification {
11+ function getPropertyReference ( propertyName : string ) : StylePropertySpecification | null {
1212 for ( let i = 0 ; i < Reference . layout . length ; i ++ ) {
1313 for ( const key in Reference [ Reference . layout [ i ] ] ) {
14- if ( key === propertyName ) return Reference [ Reference . layout [ i ] ] [ key ] as any ;
14+ if ( key === propertyName ) return Reference [ Reference . layout [ i ] ] [ key ] ;
1515 }
1616 }
1717 for ( let i = 0 ; i < Reference . paint . length ; i ++ ) {
1818 for ( const key in Reference [ Reference . paint [ i ] ] ) {
19- if ( key === propertyName ) return Reference [ Reference . paint [ i ] ] [ key ] as any ;
19+ if ( key === propertyName ) return Reference [ Reference . paint [ i ] ] [ key ] ;
2020 }
2121 }
2222
@@ -40,7 +40,7 @@ type PropertyCallback = (
4040 path : [ string , 'paint' | 'layout' , string ] ; // [layerid, paint/layout, property key],
4141 key : string ;
4242 value : PropertyValueSpecification < unknown > | DataDrivenPropertyValueSpecification < unknown > ;
43- reference : StylePropertySpecification ;
43+ reference : StylePropertySpecification | null ;
4444 set : (
4545 a : PropertyValueSpecification < unknown > | DataDrivenPropertyValueSpecification < unknown >
4646 ) => void ;
@@ -55,8 +55,8 @@ export function eachProperty(
5555 } ,
5656 callback : PropertyCallback
5757) {
58- function inner ( layer , propertyType : 'paint' | 'layout' ) {
59- const properties = ( layer [ propertyType ] as any ) ;
58+ function inner ( layer : LayerSpecification , propertyType : 'paint' | 'layout' ) {
59+ const properties = layer [ propertyType ] ;
6060 if ( ! properties ) return ;
6161 Object . keys ( properties ) . forEach ( ( key ) => {
6262 callback ( {
0 commit comments