File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010// - Autocomplete + typo detection on operator names inside this package.
1111// - Cross-platform drift caught at the construction site: an operator not
1212// in this union fails to compile here, before it can reach a consumer.
13- // - Zero casts for the app-side consumer (types match `@rnmapbox/maps`).
14- // - Zero casts for the web-side consumer: `mapbox-gl`'s
15- // `ExpressionSpecification` is `[string, ...any[]]` (looser), so a value
16- // typed as `readonly [ExpressionName, ...]` flows in without a cast.
13+ // - Zero casts for the app-side consumer: our mutable tuple is assignable
14+ // to `@rnmapbox/maps`'s `readonly [ExpressionName, ...]` variant.
15+ // - Zero casts for the web-side consumer: the shape matches `mapbox-gl`'s
16+ // `ExpressionSpecification` (`[string, ...any[]]`) directly. A `readonly`
17+ // tuple would NOT be assignable there — TS rejects `readonly` → mutable.
1718//
1819// Keep in sync with `@rnmapbox/maps` if their `ExpressionName` union grows.
1920
@@ -110,7 +111,7 @@ type ExpressionField =
110111 | ExpressionField [ ]
111112 | { [ key : string ] : ExpressionField } ;
112113
113- export type Expression = readonly [ ExpressionName , ...ExpressionField [ ] ] ;
114+ export type Expression = [ ExpressionName , ...ExpressionField [ ] ] ;
114115export type FilterExpression = Expression ;
115116
116117// Value of a text-field property — a string or expression that produces a string.
You can’t perform that action at this time.
0 commit comments