From 0680dd79d8b7e4f9b67d75c94acb5c221c1c767f Mon Sep 17 00:00:00 2001 From: James Hamilton Date: Mon, 9 Aug 2021 22:38:49 +0900 Subject: [PATCH 1/2] minor fixes --- src/data/bucket/circle_bucket.ts | 7 +++---- src/data/bucket/fill_bucket.ts | 5 ++--- src/data/bucket/line_bucket.ts | 11 +++++------ src/data/bucket/symbol_bucket.ts | 12 ++++++------ src/data/segment.ts | 2 +- 5 files changed, 17 insertions(+), 20 deletions(-) diff --git a/src/data/bucket/circle_bucket.ts b/src/data/bucket/circle_bucket.ts index 0d61a4717d..0f40cdee48 100644 --- a/src/data/bucket/circle_bucket.ts +++ b/src/data/bucket/circle_bucket.ts @@ -77,13 +77,13 @@ class CircleBucket implement populate(features: Array, options: PopulateParameters, canonical: CanonicalTileID) { const styleLayer = this.layers[0]; - const bucketFeatures = []; + const bucketFeatures: BucketFeature[] = []; let circleSortKey = null; let sortFeaturesByKey = false; // Heatmap layers are handled in this bucket and have no evaluated properties, so we check our access if (styleLayer.type === 'circle') { - circleSortKey = (styleLayer as any as CircleStyleLayer).layout.get('circle-sort-key'); + circleSortKey = (styleLayer as CircleStyleLayer).layout.get('circle-sort-key'); sortFeaturesByKey = !circleSortKey.isConstant(); } @@ -94,7 +94,6 @@ class CircleBucket implement if (!this.layers[0]._featureFilter.filter(new EvaluationParameters(this.zoom), evaluationFeature, canonical)) continue; const sortKey = sortFeaturesByKey ? - // $FlowFixMe circleSortKey.evaluate(evaluationFeature, {}, canonical) : undefined; @@ -116,7 +115,7 @@ class CircleBucket implement if (sortFeaturesByKey) { bucketFeatures.sort((a, b) => { // a.sortKey is always a number when in use - return (a.sortKey as any as number) - (b.sortKey as any as number); + return (a.sortKey) - (b.sortKey); }); } diff --git a/src/data/bucket/fill_bucket.ts b/src/data/bucket/fill_bucket.ts index 1b6965a7ab..56d1d5d770 100644 --- a/src/data/bucket/fill_bucket.ts +++ b/src/data/bucket/fill_bucket.ts @@ -77,7 +77,7 @@ class FillBucket implements Bucket { this.hasPattern = hasPattern('fill', this.layers, options); const fillSortKey = this.layers[0].layout.get('fill-sort-key'); const sortFeaturesByKey = !fillSortKey.isConstant(); - const bucketFeatures = []; + const bucketFeatures: BucketFeature[] = []; for (const {feature, id, index, sourceLayerIndex} of features) { const needGeometry = this.layers[0]._featureFilter.needGeometry; @@ -105,8 +105,7 @@ class FillBucket implements Bucket { if (sortFeaturesByKey) { bucketFeatures.sort((a, b) => { - // a.sortKey is always a number when in use - return (a.sortKey as any as number) - (b.sortKey as any as number); + return (a.sortKey) - (b.sortKey); }); } diff --git a/src/data/bucket/line_bucket.ts b/src/data/bucket/line_bucket.ts index f40af85d2d..e5a73d1da7 100644 --- a/src/data/bucket/line_bucket.ts +++ b/src/data/bucket/line_bucket.ts @@ -76,7 +76,7 @@ type LineClips = { type GradientTexture = { texture: Texture, - gradient: RGBAImage | undefined | null, + gradient?: RGBAImage, version: number }; @@ -88,7 +88,7 @@ class LineBucket implements Bucket { totalDistance: number; maxLineLength: number; scaledDistance: number; - lineClips: LineClips | undefined | null; + lineClips?: LineClips; e1: number; e2: number; @@ -147,7 +147,7 @@ class LineBucket implements Bucket { this.hasPattern = hasPattern('line', this.layers, options); const lineSortKey = this.layers[0].layout.get('line-sort-key'); const sortFeaturesByKey = !lineSortKey.isConstant(); - const bucketFeatures = []; + const bucketFeatures: BucketFeature[] = []; for (const {feature, id, index, sourceLayerIndex} of features) { const needGeometry = this.layers[0]._featureFilter.needGeometry; @@ -175,8 +175,7 @@ class LineBucket implements Bucket { if (sortFeaturesByKey) { bucketFeatures.sort((a, b) => { - // a.sortKey is always a number when in use - return (a.sortKey as any as number) - (b.sortKey as any as number); + return (a.sortKey) - (b.sortKey); }); } @@ -240,7 +239,7 @@ class LineBucket implements Bucket { this.segments.destroy(); } - lineFeatureClips(feature: BucketFeature): LineClips | undefined | null { + lineFeatureClips(feature: BucketFeature): LineClips | undefined { if (!!feature.properties && Object.prototype.hasOwnProperty.call(feature.properties, 'mapbox_clip_start') && Object.prototype.hasOwnProperty.call(feature.properties, 'mapbox_clip_end')) { const start = +feature.properties['mapbox_clip_start']; const end = +feature.properties['mapbox_clip_end']; diff --git a/src/data/bucket/symbol_bucket.ts b/src/data/bucket/symbol_bucket.ts index d69d1e4735..b51e6d7284 100644 --- a/src/data/bucket/symbol_bucket.ts +++ b/src/data/bucket/symbol_bucket.ts @@ -539,7 +539,7 @@ class SymbolBucket implements Bucket { if (this.sortFeaturesByKey) { this.features.sort((a, b) => { // a.sortKey is always a number when sortFeaturesByKey is true - return (a.sortKey as any as number) - (b.sortKey as any as number); + return (a.sortKey as number) - (b.sortKey as number); }); } } @@ -720,7 +720,7 @@ class SymbolBucket implements Bucket { addDebugCollisionBoxes(startIndex: number, endIndex: number, symbolInstance: SymbolInstance, isText: boolean) { for (let b = startIndex; b < endIndex; b++) { - const box: CollisionBox = (this.collisionBoxArray.get(b) as any); + const box: CollisionBox = this.collisionBoxArray.get(b); const x1 = box.x1; const y1 = box.y1; const x2 = box.x2; @@ -765,27 +765,27 @@ class SymbolBucket implements Bucket { const collisionArrays = {} as CollisionArrays; for (let k = textStartIndex; k < textEndIndex; k++) { - const box: CollisionBox = (collisionBoxArray.get(k) as any); + const box: CollisionBox = collisionBoxArray.get(k); collisionArrays.textBox = {x1: box.x1, y1: box.y1, x2: box.x2, y2: box.y2, anchorPointX: box.anchorPointX, anchorPointY: box.anchorPointY}; collisionArrays.textFeatureIndex = box.featureIndex; break; // Only one box allowed per instance } for (let k = verticalTextStartIndex; k < verticalTextEndIndex; k++) { - const box: CollisionBox = (collisionBoxArray.get(k) as any); + const box: CollisionBox = collisionBoxArray.get(k); collisionArrays.verticalTextBox = {x1: box.x1, y1: box.y1, x2: box.x2, y2: box.y2, anchorPointX: box.anchorPointX, anchorPointY: box.anchorPointY}; collisionArrays.verticalTextFeatureIndex = box.featureIndex; break; // Only one box allowed per instance } for (let k = iconStartIndex; k < iconEndIndex; k++) { // An icon can only have one box now, so this indexing is a bit vestigial... - const box: CollisionBox = (collisionBoxArray.get(k) as any); + const box: CollisionBox = collisionBoxArray.get(k); collisionArrays.iconBox = {x1: box.x1, y1: box.y1, x2: box.x2, y2: box.y2, anchorPointX: box.anchorPointX, anchorPointY: box.anchorPointY}; collisionArrays.iconFeatureIndex = box.featureIndex; break; // Only one box allowed per instance } for (let k = verticalIconStartIndex; k < verticalIconEndIndex; k++) { // An icon can only have one box now, so this indexing is a bit vestigial... - const box: CollisionBox = (collisionBoxArray.get(k) as any); + const box: CollisionBox = collisionBoxArray.get(k); collisionArrays.verticalIconBox = {x1: box.x1, y1: box.y1, x2: box.x2, y2: box.y2, anchorPointX: box.anchorPointX, anchorPointY: box.anchorPointY}; collisionArrays.verticalIconFeatureIndex = box.featureIndex; break; // Only one box allowed per instance diff --git a/src/data/segment.ts b/src/data/segment.ts index 5e422d5fee..c14d28587a 100644 --- a/src/data/segment.ts +++ b/src/data/segment.ts @@ -6,7 +6,7 @@ import type VertexArrayObject from '../render/vertex_array_object'; import type {StructArray} from '../util/struct_array'; export type Segment = { - sortKey: number | void, + sortKey?: number, vertexOffset: number, primitiveOffset: number, vertexLength: number, From 0c44bf438a36d9c13e62782b8445278e08681a3b Mon Sep 17 00:00:00 2001 From: James Hamilton Date: Tue, 10 Aug 2021 01:42:45 +0900 Subject: [PATCH 2/2] fix formatting of object key value types --- src/data/bucket.ts | 8 +- src/data/bucket/circle_bucket.ts | 9 +-- src/data/bucket/fill_extrusion_bucket.ts | 12 +-- src/data/bucket/line_bucket.ts | 16 +--- src/data/bucket/symbol_bucket.ts | 8 +- src/data/evaluation_feature.ts | 4 +- src/data/feature_index.ts | 39 +++------- src/data/program_configuration.ts | 48 +++--------- src/data/segment.ts | 4 +- src/geo/transform.ts | 8 +- src/render/image_atlas.ts | 20 +---- src/render/image_manager.ts | 28 ++----- src/render/line_atlas.ts | 4 +- src/render/painter.ts | 28 ++----- src/render/program.ts | 4 +- src/render/uniform_binding.ts | 8 +- src/source/geojson_worker_source.ts | 8 +- src/source/geojson_wrapper.ts | 16 +--- src/source/image_source.ts | 4 +- src/source/query_features.ts | 42 ++++------ src/source/raster_dem_tile_worker_source.ts | 4 +- src/source/source_cache.ts | 32 ++------ src/source/source_state.ts | 8 +- src/source/tile.ts | 23 ++---- src/source/vector_tile_worker_source.ts | 8 +- src/source/worker.ts | 8 +- src/source/worker_tile.ts | 12 +-- .../expression/compound_expression.ts | 8 +- .../expression/evaluation_context.ts | 4 +- src/style-spec/expression/expression.ts | 4 +- src/style-spec/expression/index.ts | 16 +--- src/style-spec/expression/scope.ts | 4 +- src/style-spec/expression/types/formatted.ts | 4 +- src/style-spec/feature_filter/convert.ts | 4 +- src/style-spec/style-spec.ts | 4 +- src/style-spec/types.ts | 8 +- src/style-spec/util/unbundle_jsonlint.ts | 4 +- src/style/load_sprite.ts | 4 +- src/style/pauseable_placement.ts | 28 +++---- src/style/style.ts | 78 ++++++++----------- src/style/style_layer_index.ts | 12 +-- src/symbol/cross_tile_symbol_index.ts | 8 +- src/symbol/mergelines.ts | 8 +- src/symbol/placement.ts | 4 +- src/symbol/quads.ts | 4 +- src/symbol/shaping.ts | 20 ++--- src/symbol/symbol_layout.ts | 24 ++---- src/types/non-typed-modules.d.ts | 8 +- src/ui/handler_manager.ts | 16 +--- src/ui/map.ts | 4 +- src/util/config.ts | 4 +- src/util/dictionary_coder.ts | 4 +- src/util/evented.ts | 4 +- src/util/is_char_in_unicode_block.ts | 4 +- src/util/mapbox.ts | 9 ++- src/util/util.ts | 16 +--- 56 files changed, 209 insertions(+), 523 deletions(-) diff --git a/src/data/bucket.ts b/src/data/bucket.ts index 815891ab85..6e3c21c086 100644 --- a/src/data/bucket.ts +++ b/src/data/bucket.ts @@ -88,9 +88,7 @@ export interface Bucket { update( states: FeatureStates, vtLayer: VectorTileLayer, - imagePositions: { - [_: string]: ImagePosition - } + imagePositions: {[_: string]: ImagePosition} ): void; isEmpty(): boolean; upload(context: Context): void; @@ -105,9 +103,7 @@ export interface Bucket { destroy(): void; } -export function deserialize(input: Array, style: Style): { - [_: string]: Bucket -} { +export function deserialize(input: Array, style: Style): {[_: string]: Bucket} { const output = {}; // Guard against the case where the map's style has been set to null while diff --git a/src/data/bucket/circle_bucket.ts b/src/data/bucket/circle_bucket.ts index 0f40cdee48..a8b2df15c7 100644 --- a/src/data/bucket/circle_bucket.ts +++ b/src/data/bucket/circle_bucket.ts @@ -113,10 +113,7 @@ class CircleBucket implement } if (sortFeaturesByKey) { - bucketFeatures.sort((a, b) => { - // a.sortKey is always a number when in use - return (a.sortKey) - (b.sortKey); - }); + bucketFeatures.sort((a, b) => a.sortKey - b.sortKey); } for (const bucketFeature of bucketFeatures) { @@ -128,9 +125,7 @@ class CircleBucket implement } } - update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: { - [_: string]: ImagePosition - }) { + update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: {[_: string]: ImagePosition}) { if (!this.stateDependentLayers.length) return; this.programConfigurations.updatePaintArrays(states, vtLayer, this.stateDependentLayers, imagePositions); } diff --git a/src/data/bucket/fill_extrusion_bucket.ts b/src/data/bucket/fill_extrusion_bucket.ts index fcd144f06a..75782afc8f 100644 --- a/src/data/bucket/fill_extrusion_bucket.ts +++ b/src/data/bucket/fill_extrusion_bucket.ts @@ -117,18 +117,14 @@ class FillExtrusionBucket implements Bucket { } } - addFeatures(options: PopulateParameters, canonical: CanonicalTileID, imagePositions: { - [_: string]: ImagePosition - }) { + addFeatures(options: PopulateParameters, canonical: CanonicalTileID, imagePositions: {[_: string]: ImagePosition}) { for (const feature of this.features) { const {geometry} = feature; this.addFeature(feature, geometry, feature.index, canonical, imagePositions); } } - update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: { - [_: string]: ImagePosition - }) { + update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: {[_: string]: ImagePosition}) { if (!this.stateDependentLayers.length) return; this.programConfigurations.updatePaintArrays(states, vtLayer, this.stateDependentLayers, imagePositions); } @@ -158,9 +154,7 @@ class FillExtrusionBucket implements Bucket { this.segments.destroy(); } - addFeature(feature: BucketFeature, geometry: Array>, index: number, canonical: CanonicalTileID, imagePositions: { - [_: string]: ImagePosition - }) { + addFeature(feature: BucketFeature, geometry: Array>, index: number, canonical: CanonicalTileID, imagePositions: {[_: string]: ImagePosition}) { for (const polygon of classifyRings(geometry, EARCUT_MAX_RINGS)) { let numVertices = 0; for (const ring of polygon) { diff --git a/src/data/bucket/line_bucket.ts b/src/data/bucket/line_bucket.ts index e5a73d1da7..deb575036b 100644 --- a/src/data/bucket/line_bucket.ts +++ b/src/data/bucket/line_bucket.ts @@ -98,9 +98,7 @@ class LineBucket implements Bucket { overscaling: number; layers: Array; layerIds: Array; - gradients: { - [x: string]: GradientTexture - }; + gradients: {[x: string]: GradientTexture}; stateDependentLayers: Array; stateDependentLayerIds: Array; patternFeatures: Array; @@ -196,16 +194,12 @@ class LineBucket implements Bucket { } } - update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: { - [_: string]: ImagePosition - }) { + update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: {[_: string]: ImagePosition}) { if (!this.stateDependentLayers.length) return; this.programConfigurations.updatePaintArrays(states, vtLayer, this.stateDependentLayers, imagePositions); } - addFeatures(options: PopulateParameters, canonical: CanonicalTileID, imagePositions: { - [_: string]: ImagePosition - }) { + addFeatures(options: PopulateParameters, canonical: CanonicalTileID, imagePositions: {[_: string]: ImagePosition}) { for (const feature of this.patternFeatures) { this.addFeature(feature, feature.geometry, feature.index, canonical, imagePositions); } @@ -247,9 +241,7 @@ class LineBucket implements Bucket { } } - addFeature(feature: BucketFeature, geometry: Array>, index: number, canonical: CanonicalTileID, imagePositions: { - [_: string]: ImagePosition - }) { + addFeature(feature: BucketFeature, geometry: Array>, index: number, canonical: CanonicalTileID, imagePositions: {[_: string]: ImagePosition}) { const layout = this.layers[0].layout; const join = layout.get('line-join').evaluate(feature, {}); const cap = layout.get('line-cap'); diff --git a/src/data/bucket/symbol_bucket.ts b/src/data/bucket/symbol_bucket.ts index b51e6d7284..215d0c319a 100644 --- a/src/data/bucket/symbol_bucket.ts +++ b/src/data/bucket/symbol_bucket.ts @@ -322,9 +322,7 @@ class SymbolBucket implements Bucket { sortKeyRanges: Array; pixelRatio: number; tilePixelRatio: number; - compareText: { - [_: string]: Array - }; + compareText: {[_: string]: Array}; fadeStartTime: number; sortFeaturesByKey: boolean; sortFeaturesByY: boolean; @@ -544,9 +542,7 @@ class SymbolBucket implements Bucket { } } - update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: { - [_: string]: ImagePosition - }) { + update(states: FeatureStates, vtLayer: VectorTileLayer, imagePositions: {[_: string]: ImagePosition}) { if (!this.stateDependentLayers.length) return; this.text.programConfigurations.updatePaintArrays(states, vtLayer, this.layers, imagePositions); this.icon.programConfigurations.updatePaintArrays(states, vtLayer, this.layers, imagePositions); diff --git a/src/data/evaluation_feature.ts b/src/data/evaluation_feature.ts index 0587ed9d3b..206b425642 100644 --- a/src/data/evaluation_feature.ts +++ b/src/data/evaluation_feature.ts @@ -4,9 +4,7 @@ import type Point from '../symbol/point'; type EvaluationFeature = { readonly type: 1 | 2 | 3 | "Unknown" | "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon", readonly id?: any, - readonly properties: { - [_: string]: any - }, + readonly properties: {[_: string]: any}, readonly patterns?: { [_: string]: { "min": string, diff --git a/src/data/feature_index.ts b/src/data/feature_index.ts index 31e398c48d..ce25518df4 100644 --- a/src/data/feature_index.ts +++ b/src/data/feature_index.ts @@ -53,9 +53,7 @@ class FeatureIndex { rawTileData: ArrayBuffer; bucketLayerIDs: Array>; - vtLayers: { - [_: string]: VectorTileLayer - }; + vtLayers: {[_: string]: VectorTileLayer}; sourceLayerCoder: DictionaryCoder; constructor(tileID: OverscaledTileID, promoteId?: PromoteIdSpecification | null) { @@ -96,9 +94,7 @@ class FeatureIndex { } } - loadVTLayers(): { - [_: string]: VectorTileLayer - } { + loadVTLayers(): {[_: string]: VectorTileLayer} { if (!this.vtLayers) { this.vtLayers = new vt.VectorTile(new Protobuf(this.rawTileData)).layers; this.sourceLayerCoder = new DictionaryCoder(this.vtLayers ? Object.keys(this.vtLayers).sort() : ['_geojsonTileLayer']); @@ -109,19 +105,10 @@ class FeatureIndex { // Finds non-symbol features in this tile at a particular position. query( args: QueryParameters, - styleLayers: { - [_: string]: StyleLayer - }, - serializedLayers: { - [_: string]: any - }, + styleLayers: {[_: string]: StyleLayer}, + serializedLayers: {[_: string]: any}, sourceFeatureState: SourceFeatureState - ): { - [_: string]: Array<{ - featureIndex: number, - feature: GeoJSONFeature - }> - } { + ): {[_: string]: Array<{featureIndex: number, feature: GeoJSONFeature}>} { this.loadVTLayers(); const params = args.params || {} as { filter: any, layers: string[], availableImages: string[] }, @@ -196,12 +183,8 @@ class FeatureIndex { filter: FeatureFilter, filterLayerIDs: Array, availableImages: Array, - styleLayers: { - [_: string]: StyleLayer - }, - serializedLayers: { - [_: string]: any - }, + styleLayers: {[_: string]: StyleLayer}, + serializedLayers: {[_: string]: any}, sourceFeatureState?: SourceFeatureState, intersectionTest?: ( feature: VectorTileFeature, @@ -270,17 +253,13 @@ class FeatureIndex { // Given a set of symbol indexes that have already been looked up, // return a matching set of GeoJSONFeatures lookupSymbolFeatures(symbolFeatureIndexes: Array, - serializedLayers: { - [x: string]: StyleLayer - }, + serializedLayers: {[_: string]: StyleLayer}, bucketIndex: number, sourceLayerIndex: number, filterSpec: FilterSpecification, filterLayerIDs: Array, availableImages: Array, - styleLayers: { - [_: string]: StyleLayer - }) { + styleLayers: {[_: string]: StyleLayer}) { const result = {}; this.loadVTLayers(); diff --git a/src/data/program_configuration.ts b/src/data/program_configuration.ts index ed29eee593..3b733b923e 100644 --- a/src/data/program_configuration.ts +++ b/src/data/program_configuration.ts @@ -74,9 +74,7 @@ interface AttributeBinder { populatePaintArray( length: number, feature: Feature, - imagePositions: { - [_: string]: ImagePosition - }, + imagePositions: {[_: string]: ImagePosition}, canonical?: CanonicalTileID, formattedSection?: FormattedSection ): void; @@ -85,9 +83,7 @@ interface AttributeBinder { length: number, feature: Feature, featureState: FeatureState, - imagePositions: { - [_: string]: ImagePosition - } + imagePositions: {[_: string]: ImagePosition} ): void; upload(a: Context): void; destroy(): void; @@ -192,9 +188,7 @@ class SourceExpressionBinder implements AttributeBinder { this.paintVertexArray = new PaintVertexArray(); } - populatePaintArray(newLength: number, feature: Feature, imagePositions: { - [_: string]: ImagePosition - }, canonical?: CanonicalTileID, formattedSection?: FormattedSection) { + populatePaintArray(newLength: number, feature: Feature, imagePositions: {[_: string]: ImagePosition}, canonical?: CanonicalTileID, formattedSection?: FormattedSection) { const start = this.paintVertexArray.length; const value = this.expression.evaluate(new EvaluationParameters(0), feature, {}, canonical, [], formattedSection); this.paintVertexArray.resize(newLength); @@ -267,9 +261,7 @@ class CompositeExpressionBinder implements AttributeBinder, UniformBinder { this.paintVertexArray = new PaintVertexArray(); } - populatePaintArray(newLength: number, feature: Feature, imagePositions: { - [_: string]: ImagePosition - }, canonical?: CanonicalTileID, formattedSection?: FormattedSection) { + populatePaintArray(newLength: number, feature: Feature, imagePositions: {[_: string]: ImagePosition}, canonical?: CanonicalTileID, formattedSection?: FormattedSection) { const min = this.expression.evaluate(new EvaluationParameters(this.zoom), feature, {}, canonical, [], formattedSection); const max = this.expression.evaluate(new EvaluationParameters(this.zoom + 1), feature, {}, canonical, [], formattedSection); const start = this.paintVertexArray.length; @@ -351,18 +343,14 @@ class CrossFadedCompositeBinder implements AttributeBinder { this.zoomOutPaintVertexArray = new PaintVertexArray(); } - populatePaintArray(length: number, feature: Feature, imagePositions: { - [_: string]: ImagePosition - }) { + populatePaintArray(length: number, feature: Feature, imagePositions: {[_: string]: ImagePosition}) { const start = this.zoomInPaintVertexArray.length; this.zoomInPaintVertexArray.resize(length); this.zoomOutPaintVertexArray.resize(length); this._setPaintValues(start, length, feature.patterns && feature.patterns[this.layerId], imagePositions); } - updatePaintArray(start: number, end: number, feature: Feature, featureState: FeatureState, imagePositions: { - [_: string]: ImagePosition - }) { + updatePaintArray(start: number, end: number, feature: Feature, featureState: FeatureState, imagePositions: {[_: string]: ImagePosition}) { this._setPaintValues(start, end, feature.patterns && feature.patterns[this.layerId], imagePositions); } @@ -428,9 +416,7 @@ class CrossFadedCompositeBinder implements AttributeBinder { * @private */ export default class ProgramConfiguration { - binders: { - [_: string]: AttributeBinder | UniformBinder - }; + binders: {[_: string]: AttributeBinder | UniformBinder}; cacheKey: string; _buffers: Array; @@ -482,9 +468,7 @@ export default class ProgramConfiguration { return binder instanceof SourceExpressionBinder || binder instanceof CompositeExpressionBinder ? binder.maxValue : 0; } - populatePaintArrays(newLength: number, feature: Feature, imagePositions: { - [_: string]: ImagePosition - }, canonical?: CanonicalTileID, formattedSection?: FormattedSection) { + populatePaintArrays(newLength: number, feature: Feature, imagePositions: {[_: string]: ImagePosition}, canonical?: CanonicalTileID, formattedSection?: FormattedSection) { for (const property in this.binders) { const binder = this.binders[property]; if (binder instanceof SourceExpressionBinder || binder instanceof CompositeExpressionBinder || binder instanceof CrossFadedCompositeBinder) @@ -504,9 +488,7 @@ export default class ProgramConfiguration { featureMap: FeaturePositionMap, vtLayer: VectorTileLayer, layer: TypedStyleLayer, - imagePositions: { - [_: string]: ImagePosition - } + imagePositions: {[_: string]: ImagePosition} ): boolean { let dirty: boolean = false; for (const id in featureStates) { @@ -639,9 +621,7 @@ export default class ProgramConfiguration { } export class ProgramConfigurationSet { - programConfigurations: { - [_: string]: ProgramConfiguration - }; + programConfigurations: {[_: string]: ProgramConfiguration}; needsUpload: boolean; _featureMap: FeaturePositionMap; _bufferOffset: number; @@ -656,9 +636,7 @@ export class ProgramConfigurationSet { this._bufferOffset = 0; } - populatePaintArrays(length: number, feature: Feature, index: number, imagePositions: { - [_: string]: ImagePosition - }, canonical: CanonicalTileID, formattedSection?: FormattedSection) { + populatePaintArrays(length: number, feature: Feature, index: number, imagePositions: {[_: string]: ImagePosition}, canonical: CanonicalTileID, formattedSection?: FormattedSection) { for (const key in this.programConfigurations) { this.programConfigurations[key].populatePaintArrays(length, feature, imagePositions, canonical, formattedSection); } @@ -671,9 +649,7 @@ export class ProgramConfigurationSet { this.needsUpload = true; } - updatePaintArrays(featureStates: FeatureStates, vtLayer: VectorTileLayer, layers: ReadonlyArray, imagePositions: { - [_: string]: ImagePosition - }) { + updatePaintArrays(featureStates: FeatureStates, vtLayer: VectorTileLayer, layers: ReadonlyArray, imagePositions: {[_: string]: ImagePosition}) { for (const layer of layers) { this.needsUpload = this.programConfigurations[layer.id].updatePaintArrays(featureStates, this._featureMap, vtLayer, layer, imagePositions) || this.needsUpload; } diff --git a/src/data/segment.ts b/src/data/segment.ts index c14d28587a..f67803150f 100644 --- a/src/data/segment.ts +++ b/src/data/segment.ts @@ -11,9 +11,7 @@ export type Segment = { primitiveOffset: number, vertexLength: number, primitiveLength: number, - vaos: { - [_: string]: VertexArrayObject - } + vaos: {[_: string]: VertexArrayObject} }; class SegmentVector { diff --git a/src/geo/transform.ts b/src/geo/transform.ts index 29eb7cbf89..e3f132f0b7 100644 --- a/src/geo/transform.ts +++ b/src/geo/transform.ts @@ -51,12 +51,8 @@ class Transform { _center: LngLat; _edgeInsets: EdgeInsets; _constraining: boolean; - _posMatrixCache: { - [_: string]: mat4 - }; - _alignedPosMatrixCache: { - [_: string]: mat4 - }; + _posMatrixCache: {[_: string]: mat4}; + _alignedPosMatrixCache: {[_: string]: mat4}; constructor(minZoom: number | undefined | null, maxZoom: number | undefined | null, minPitch: number | undefined | null, maxPitch: number | undefined | null, renderWorldCopies: boolean) { this.tileSize = 512; // constant diff --git a/src/render/image_atlas.ts b/src/render/image_atlas.ts index 87ebb0c868..1231e837b9 100644 --- a/src/render/image_atlas.ts +++ b/src/render/image_atlas.ts @@ -67,20 +67,12 @@ export class ImagePosition { export default class ImageAtlas { image: RGBAImage; - iconPositions: { - [_: string]: ImagePosition - }; - patternPositions: { - [_: string]: ImagePosition - }; + iconPositions: {[_: string]: ImagePosition}; + patternPositions: {[_: string]: ImagePosition}; haveRenderCallbacks: Array; uploaded: boolean | undefined | null; - constructor(icons: { - [_: string]: StyleImage - }, patterns: { - [_: string]: StyleImage - }) { + constructor(icons: {[_: string]: StyleImage}, patterns: {[_: string]: StyleImage}) { const iconPositions = {}, patternPositions = {}; this.haveRenderCallbacks = []; @@ -119,11 +111,7 @@ export default class ImageAtlas { this.patternPositions = patternPositions; } - addImages(images: { - [_: string]: StyleImage - }, positions: { - [_: string]: ImagePosition - }, bins: Array) { + addImages(images: {[_: string]: StyleImage}, positions: {[_: string]: ImagePosition}, bins: Array) { for (const id in images) { const src = images[id]; const bin = { diff --git a/src/render/image_manager.ts b/src/render/image_manager.ts index ba69546f4a..0abd365350 100644 --- a/src/render/image_manager.ts +++ b/src/render/image_manager.ts @@ -36,26 +36,16 @@ const padding = 1; to refactor this. */ class ImageManager extends Evented { - images: { - [_: string]: StyleImage - }; - updatedImages: { - [_: string]: boolean - }; - callbackDispatchedThisFrame: { - [_: string]: boolean - }; + images: {[_: string]: StyleImage}; + updatedImages: {[_: string]: boolean}; + callbackDispatchedThisFrame: {[_: string]: boolean}; loaded: boolean; requestors: Array<{ ids: Array, - callback: Callback<{ - [_: string]: StyleImage - }> + callback: Callback<{[_: string]: StyleImage}> }>; - patterns: { - [_: string]: Pattern - }; + patterns: {[_: string]: Pattern}; atlasImage: RGBAImage; atlasTexture: Texture | undefined | null; dirty: boolean; @@ -167,9 +157,7 @@ class ImageManager extends Evented { return Object.keys(this.images); } - getImages(ids: Array, callback: Callback<{ - [_: string]: StyleImage - }>) { + getImages(ids: Array, callback: Callback<{[_: string]: StyleImage}>) { // If the sprite has been loaded, or if all the icon dependencies are already present // (i.e. if they've been added via runtime styling), then notify the requestor immediately. // Otherwise, delay notification until the sprite is loaded. At that point, if any of the @@ -189,9 +177,7 @@ class ImageManager extends Evented { } } - _notify(ids: Array, callback: Callback<{ - [_: string]: StyleImage - }>) { + _notify(ids: Array, callback: Callback<{[_: string]: StyleImage}>) { const response = {}; for (const id of ids) { diff --git a/src/render/line_atlas.ts b/src/render/line_atlas.ts index 69f65905d4..65d552d303 100644 --- a/src/render/line_atlas.ts +++ b/src/render/line_atlas.ts @@ -17,9 +17,7 @@ class LineAtlas { nextRow: number; bytes: number; data: Uint8Array; - dashEntry: { - [_: string]: any - }; + dashEntry: {[_: string]: any}; dirty: boolean; texture: WebGLTexture; diff --git a/src/render/painter.ts b/src/render/painter.ts index 71b0ff3c62..2410a7d7ac 100644 --- a/src/render/painter.ts +++ b/src/render/painter.ts @@ -103,9 +103,7 @@ class Painter { viewportSegments: SegmentVector; quadTriangleIndexBuffer: IndexBuffer; tileBorderIndexBuffer: IndexBuffer; - _tileClippingMaskIDs: { - [_: string]: number - }; + _tileClippingMaskIDs: {[_: string]: number}; stencilClearMode: StencilMode; style: Style; options: PainterOptions; @@ -120,14 +118,10 @@ class Painter { nextStencilID: number; id: string; _showOverdrawInspector: boolean; - cache: { - [_: string]: Program - }; + cache: {[_: string]: Program}; crossTileSymbolIndex: CrossTileSymbolIndex; symbolFadeChange: number; - gpuTimers: { - [_: string]: any - }; + gpuTimers: {[_: string]: any}; emptyTexture: Texture; debugOverlayTexture: Texture; debugOverlayCanvas: HTMLCanvasElement; @@ -384,15 +378,9 @@ class Painter { } } - const coordsAscending: { - [_: string]: Array - } = {}; - const coordsDescending: { - [_: string]: Array - } = {}; - const coordsDescendingSymbol: { - [_: string]: Array - } = {}; + const coordsAscending: {[_: string]: Array} = {}; + const coordsDescending: {[_: string]: Array} = {}; + const coordsDescendingSymbol: {[_: string]: Array} = {}; for (const id in sourceCaches) { const sourceCache = sourceCaches[id]; @@ -536,9 +524,7 @@ class Painter { return currentLayerTimers; } - queryGpuTimers(gpuTimers: { - [_: string]: any - }) { + queryGpuTimers(gpuTimers: {[_: string]: any}) { const layers = {}; for (const layerId in gpuTimers) { const gpuTimer = gpuTimers[layerId]; diff --git a/src/render/program.ts b/src/render/program.ts index 2cafd05622..a7e7581365 100644 --- a/src/render/program.ts +++ b/src/render/program.ts @@ -28,9 +28,7 @@ function getTokenizedAttributesAndUniforms(array: Array): Array } class Program { program: WebGLProgram; - attributes: { - [_: string]: number - }; + attributes: {[_: string]: number}; numAttributes: number; fixedUniforms: Us; binderUniforms: Array; diff --git a/src/render/uniform_binding.ts b/src/render/uniform_binding.ts index 4978862bf2..918be23bac 100644 --- a/src/render/uniform_binding.ts +++ b/src/render/uniform_binding.ts @@ -8,9 +8,7 @@ type $ObjMap any> = { }; export type UniformValues = $ObjMap(u: Uniform) => V>; -export type UniformLocations = { - [_: string]: WebGLUniformLocation -}; +export type UniformLocations = {[_: string]: WebGLUniformLocation}; abstract class Uniform { gl: WebGLRenderingContext; @@ -148,6 +146,4 @@ export { UniformMatrix4f }; -export type UniformBindings = { - [_: string]: Uniform -}; +export type UniformBindings = {[_: string]: Uniform}; diff --git a/src/source/geojson_worker_source.ts b/src/source/geojson_worker_source.ts index 21981fa969..24e5c127b3 100644 --- a/src/source/geojson_worker_source.ts +++ b/src/source/geojson_worker_source.ts @@ -89,9 +89,7 @@ export type SourceState = // Source empty or data loaded class GeoJSONWorkerSource extends VectorTileWorkerSource { _state: SourceState; _pendingCallback: Callback<{ - resourceTiming?: { - [_: string]: Array - }, + resourceTiming?: {[_: string]: Array}, abandoned?: boolean }>; _pendingLoadDataParams: LoadGeoJSONParameters; @@ -128,9 +126,7 @@ class GeoJSONWorkerSource extends VectorTileWorkerSource { * @private */ loadData(params: LoadGeoJSONParameters, callback: Callback<{ - resourceTiming?: { - [_: string]: Array - }, + resourceTiming?: {[_: string]: Array}, abandoned?: boolean }>) { if (this._pendingCallback) { diff --git a/src/source/geojson_wrapper.ts b/src/source/geojson_wrapper.ts index 2b1fca8d75..cc33db8db4 100644 --- a/src/source/geojson_wrapper.ts +++ b/src/source/geojson_wrapper.ts @@ -9,16 +9,12 @@ import EXTENT from '../data/extent'; type Feature = { type: 1, id: any, - tags: { - [_: string]: string | number | boolean - }, + tags: {[_: string]: string | number | boolean}, geometry: Array<[number, number]> } | { type: 2 | 3, id: any, - tags: { - [_: string]: string | number | boolean - }, + tags: {[_: string]: string | number | boolean}, geometry: Array> }; @@ -28,9 +24,7 @@ class FeatureWrapper implements VectorTileFeature { extent: number; type: 1 | 2 | 3; id: number; - properties: { - [_: string]: string | number | boolean - }; + properties: {[_: string]: string | number | boolean}; constructor(feature: Feature) { this._feature = feature; @@ -76,9 +70,7 @@ class FeatureWrapper implements VectorTileFeature { } class GeoJSONWrapper implements VectorTile, VectorTileLayer { - layers: { - [_: string]: VectorTileLayer - }; + layers: {[_: string]: VectorTileLayer}; name: string; extent: number; length: number; diff --git a/src/source/image_source.ts b/src/source/image_source.ts index 9e1fd429f6..1b01471b34 100644 --- a/src/source/image_source.ts +++ b/src/source/image_source.ts @@ -70,9 +70,7 @@ class ImageSource extends Evented implements Source { url: string; coordinates: Coordinates; - tiles: { - [_: string]: Tile - }; + tiles: {[_: string]: Tile}; options: any; dispatcher: Dispatcher; map: Map; diff --git a/src/source/query_features.ts b/src/source/query_features.ts index 0c0e81e48a..13e01acc02 100644 --- a/src/source/query_features.ts +++ b/src/source/query_features.ts @@ -18,9 +18,7 @@ function getPixelPosMatrix(transform, tileID) { return mat4.multiply(t, t, transform.calculatePosMatrix(tileID.toUnwrapped())); } -function queryIncludes3DLayer(layers: Array | undefined | null, styleLayers: { - [_: string]: StyleLayer -}, sourceID: string) { +function queryIncludes3DLayer(layers: Array | undefined | null, styleLayers: {[_: string]: StyleLayer}, sourceID: string) { if (layers) { for (const layerID of layers) { const layer = styleLayers[layerID]; @@ -39,20 +37,18 @@ function queryIncludes3DLayer(layers: Array | undefined | null, styleLay return false; } -export function queryRenderedFeatures(sourceCache: SourceCache, - styleLayers: { - [_: string]: StyleLayer - }, - serializedLayers: { - [_: string]: any - }, - queryGeometry: Array, - params: { - filter: FilterSpecification, - layers: Array, - availableImages: Array - }, - transform: Transform) { +export function queryRenderedFeatures( + sourceCache: SourceCache, + styleLayers: {[_: string]: StyleLayer}, + serializedLayers: {[_: string]: any}, + queryGeometry: Array, + params: { + filter: FilterSpecification, + layers: Array, + availableImages: Array + }, + transform: Transform +) { const has3DLayer = queryIncludes3DLayer(params && params.layers, styleLayers, sourceCache.id); const maxPitchScaleFactor = transform.maxPitchScaleFactor(); @@ -94,15 +90,9 @@ export function queryRenderedFeatures(sourceCache: SourceCache, return result; } -export function queryRenderedSymbols(styleLayers: { - [_: string]: StyleLayer -}, - serializedLayers: { - [_: string]: StyleLayer - }, - sourceCaches: { - [_: string]: SourceCache - }, +export function queryRenderedSymbols(styleLayers: {[_: string]: StyleLayer}, + serializedLayers: {[_: string]: StyleLayer}, + sourceCaches: {[_: string]: SourceCache}, queryGeometry: Array, params: { filter: FilterSpecification, diff --git a/src/source/raster_dem_tile_worker_source.ts b/src/source/raster_dem_tile_worker_source.ts index 8505f915da..553bd73305 100644 --- a/src/source/raster_dem_tile_worker_source.ts +++ b/src/source/raster_dem_tile_worker_source.ts @@ -10,9 +10,7 @@ import type { class RasterDEMTileWorkerSource { actor: Actor; - loaded: { - [_: string]: DEMData - }; + loaded: {[_: string]: DEMData}; offscreenCanvas: OffscreenCanvas; offscreenCanvasContext: OffscreenCanvasRenderingContext2D; diff --git a/src/source/source_cache.ts b/src/source/source_cache.ts index 5e8ff7d65a..00cc498267 100644 --- a/src/source/source_cache.ts +++ b/src/source/source_cache.ts @@ -42,9 +42,7 @@ class SourceCache extends Evented { _source: Source; _sourceLoaded: boolean; _sourceErrored: boolean; - _tiles: { - [_: string]: Tile - }; + _tiles: {[_: string]: Tile}; _prevLng: number; _cache: TileCache; _timers: { @@ -56,15 +54,11 @@ class SourceCache extends Evented { _maxTileCacheSize: number | undefined | null; _paused: boolean; _shouldReloadOnResume: boolean; - _coveredTiles: { - [_: string]: boolean - }; + _coveredTiles: {[_: string]: boolean}; transform: Transform; used: boolean; _state: SourceFeatureState; - _loadedParentTiles: { - [_: string]: Tile | undefined | null - }; + _loadedParentTiles: {[_: string]: Tile | undefined | null}; static maxUnderzooming: number; static maxOverzooming: number; @@ -457,9 +451,7 @@ class SourceCache extends Evented { this._prevLng = lng; if (wrapDelta) { - const tiles: { - [_: string]: Tile - } = {}; + const tiles: {[_: string]: Tile} = {}; for (const key in this._tiles) { const tile = this._tiles[key]; tile.tileID = tile.tileID.unwrapTo(tile.tileID.wrap + wrapDelta); @@ -526,9 +518,7 @@ class SourceCache extends Evented { const retain = this._updateRetainedTiles(idealTileIDs, zoom); if (isRasterType(this._source.type)) { - const parentsForFading: { - [_: string]: OverscaledTileID - } = {}; + const parentsForFading: {[_: string]: OverscaledTileID} = {}; const fadingTiles = {}; const ids = Object.keys(retain); for (const id of ids) { @@ -589,15 +579,9 @@ class SourceCache extends Evented { } } - _updateRetainedTiles(idealTileIDs: Array, zoom: number): { - [_: string]: OverscaledTileID - } { - const retain: { - [_: string]: OverscaledTileID - } = {}; - const checked: { - [_: string]: boolean - } = {}; + _updateRetainedTiles(idealTileIDs: Array, zoom: number): {[_: string]: OverscaledTileID} { + const retain: {[_: string]: OverscaledTileID} = {}; + const checked: {[_: string]: boolean} = {}; const minCoveringZoom = Math.max(zoom - SourceCache.maxOverzooming, this._source.minzoom); const maxCoveringZoom = Math.max(zoom + SourceCache.maxUnderzooming, this._source.minzoom); diff --git a/src/source/source_state.ts b/src/source/source_state.ts index d5b49e39fa..38df4b0bbb 100644 --- a/src/source/source_state.ts +++ b/src/source/source_state.ts @@ -2,12 +2,8 @@ import {extend} from '../util/util'; import Tile from './tile'; import type {FeatureState} from '../style-spec/expression'; -export type FeatureStates = { - [featureId: string]: FeatureState -}; -export type LayerFeatureStates = { - [layer: string]: FeatureStates -}; +export type FeatureStates = {[featureId: string]: FeatureState}; +export type LayerFeatureStates = {[layer: string]: FeatureStates}; /** * SourceFeatureState manages the state and pending changes diff --git a/src/source/tile.ts b/src/source/tile.ts index 839a075f59..a3ccec39a2 100644 --- a/src/source/tile.ts +++ b/src/source/tile.ts @@ -52,9 +52,7 @@ class Tile { uid: number; uses: number; tileSize: number; - buckets: { - [_: string]: Bucket - }; + buckets: {[_: string]: Bucket}; latestFeatureIndex: FeatureIndex; latestRawTileData: ArrayBuffer | undefined | null; imageAtlas: ImageAtlas | undefined | null; @@ -71,9 +69,7 @@ class Tile { showCollisionBoxes: boolean; placementSource: any; actor: Actor | undefined | null; - vtLayers: { - [_: string]: VectorTileLayer - }; + vtLayers: {[_: string]: VectorTileLayer}; neighboringTiles: any; dem: DEMData | undefined | null; @@ -271,12 +267,8 @@ class Tile { // Queries non-symbol features rendered for this tile. // Symbol features are queried globally queryRenderedFeatures( - layers: { - [_: string]: StyleLayer - }, - serializedLayers: { - [x: string]: any - }, + layers: {[_: string]: StyleLayer}, + serializedLayers: {[_: string]: any}, sourceFeatureState: SourceFeatureState, queryGeometry: Array, cameraQueryGeometry: Array, @@ -289,12 +281,7 @@ class Tile { transform: Transform, maxPitchScaleFactor: number, pixelPosMatrix: mat4 - ): { - [_: string]: Array<{ - featureIndex: number, - feature: GeoJSONFeature - }> - } { + ): {[_: string]: Array<{featureIndex: number, feature: GeoJSONFeature}>} { if (!this.latestFeatureIndex || !this.latestFeatureIndex.rawTileData) return {}; diff --git a/src/source/vector_tile_worker_source.ts b/src/source/vector_tile_worker_source.ts index 967104cc5e..343589ad5f 100644 --- a/src/source/vector_tile_worker_source.ts +++ b/src/source/vector_tile_worker_source.ts @@ -72,12 +72,8 @@ class VectorTileWorkerSource implements WorkerSource { layerIndex: StyleLayerIndex; availableImages: Array; loadVectorData: LoadVectorData; - loading: { - [_: string]: WorkerTile - }; - loaded: { - [_: string]: WorkerTile - }; + loading: {[_: string]: WorkerTile}; + loaded: {[_: string]: WorkerTile}; /** * @param [loadVectorData] Optional method for custom loading of a VectorTile diff --git a/src/source/worker.ts b/src/source/worker.ts index 8f71d1688f..50035e07af 100644 --- a/src/source/worker.ts +++ b/src/source/worker.ts @@ -28,12 +28,8 @@ import type {PluginState} from './rtl_text_plugin'; export default class Worker { self: WorkerGlobalScopeInterface; actor: Actor; - layerIndexes: { - [_: string]: StyleLayerIndex - }; - availableImages: { - [_: string]: Array - }; + layerIndexes: {[_: string]: StyleLayerIndex}; + availableImages: {[_: string]: Array}; workerSourceTypes: { [_: string]: { new (...args: any): WorkerSource diff --git a/src/source/worker_tile.ts b/src/source/worker_tile.ts index a839d623f8..45c3d3d77b 100644 --- a/src/source/worker_tile.ts +++ b/src/source/worker_tile.ts @@ -71,9 +71,7 @@ class WorkerTile { const featureIndex = new FeatureIndex(this.tileID, this.promoteId); featureIndex.bucketLayerIDs = []; - const buckets: { - [_: string]: Bucket - } = {}; + const buckets: {[_: string]: Bucket} = {}; const options = { featureIndex, @@ -135,12 +133,8 @@ class WorkerTile { [_: number]: StyleGlyph | undefined | null } } | undefined | null; - let iconMap: { - [_: string]: StyleImage - } | undefined | null; - let patternMap: { - [_: string]: StyleImage - } | undefined | null; + let iconMap: {[_: string]: StyleImage} | undefined | null; + let patternMap: {[_: string]: StyleImage} | undefined | null; const stacks = mapObject(options.glyphDependencies, (glyphs) => Object.keys(glyphs).map(Number)); if (Object.keys(stacks).length) { diff --git a/src/style-spec/expression/compound_expression.ts b/src/style-spec/expression/compound_expression.ts index 1788c71900..381ad1eca0 100644 --- a/src/style-spec/expression/compound_expression.ts +++ b/src/style-spec/expression/compound_expression.ts @@ -25,9 +25,7 @@ class CompoundExpression implements Expression { _evaluate: Evaluate; args: Array; - static definitions: { - [_: string]: Definition - }; + static definitions: {[_: string]: Definition}; constructor(name: string, type: Type, evaluate: Evaluate, args: Array) { this.name = name; @@ -146,9 +144,7 @@ class CompoundExpression implements Expression { static register( registry: ExpressionRegistry, - definitions: { - [_: string]: Definition - } + definitions: {[_: string]: Definition} ) { assert(!CompoundExpression.definitions); CompoundExpression.definitions = definitions; diff --git a/src/style-spec/expression/evaluation_context.ts b/src/style-spec/expression/evaluation_context.ts index fe7d9cf780..79a146f3b8 100644 --- a/src/style-spec/expression/evaluation_context.ts +++ b/src/style-spec/expression/evaluation_context.ts @@ -13,9 +13,7 @@ class EvaluationContext { availableImages: Array | undefined | null; canonical: CanonicalTileID | undefined | null; - _parseColorCache: { - [_: string]: Color | undefined | null - }; + _parseColorCache: {[_: string]: Color | undefined | null}; constructor() { this.globals = (null as any); diff --git a/src/style-spec/expression/expression.ts b/src/style-spec/expression/expression.ts index 5c380ed3c3..8b3d2f61fb 100644 --- a/src/style-spec/expression/expression.ts +++ b/src/style-spec/expression/expression.ts @@ -22,6 +22,4 @@ export type ExpressionRegistration = { } & { readonly parse: ExpressionParser }; -export type ExpressionRegistry = { - [_: string]: ExpressionRegistration -}; +export type ExpressionRegistry = {[_: string]: ExpressionRegistration}; diff --git a/src/style-spec/expression/index.ts b/src/style-spec/expression/index.ts index 4236deaa35..d593b32ab7 100644 --- a/src/style-spec/expression/index.ts +++ b/src/style-spec/expression/index.ts @@ -29,9 +29,7 @@ import type {CanonicalTileID} from '../../source/tile_id'; export type Feature = { readonly type: 1 | 2 | 3 | "Unknown" | "Point" | "MultiPoint" | "LineString" | "MultiLineString" | "Polygon" | "MultiPolygon", readonly id?: any, - readonly properties: { - [_: string]: any - }, + readonly properties: {[_: string]: any}, readonly patterns?: { [_: string]: { "min": string, @@ -42,9 +40,7 @@ export type Feature = { readonly geometry?: Array> }; -export type FeatureState = { - [_: string]: any -}; +export type FeatureState = {[_: string]: any}; export type GlobalProperties = Readonly<{ zoom: number, @@ -59,12 +55,8 @@ export class StyleExpression { _evaluator: EvaluationContext; _defaultValue: Value; - _warningHistory: { - [key: string]: boolean - }; - _enumValues: { - [_: string]: any - } | undefined | null; + _warningHistory: {[key: string]: boolean}; + _enumValues: {[_: string]: any} | undefined | null; constructor(expression: Expression, propertySpec?: StylePropertySpecification | null) { this.expression = expression; diff --git a/src/style-spec/expression/scope.ts b/src/style-spec/expression/scope.ts index 0dad292b22..8228c4efe8 100644 --- a/src/style-spec/expression/scope.ts +++ b/src/style-spec/expression/scope.ts @@ -6,9 +6,7 @@ import type {Expression} from './expression'; */ class Scope { parent: Scope | undefined | null; - bindings: { - [_: string]: Expression - }; + bindings: {[_: string]: Expression}; constructor(parent?: Scope, bindings: Array<[string, Expression]> = []) { this.parent = parent; this.bindings = {}; diff --git a/src/style-spec/expression/types/formatted.ts b/src/style-spec/expression/types/formatted.ts index 4a2fd59b8f..26afb70025 100644 --- a/src/style-spec/expression/types/formatted.ts +++ b/src/style-spec/expression/types/formatted.ts @@ -55,9 +55,7 @@ export default class Formatted { continue; } serialized.push(section.text); - const options: { - [key: string]: unknown - } = {}; + const options: {[key: string]: unknown} = {}; if (section.fontStack) { options["text-font"] = ["literal", section.fontStack.split(',')]; } diff --git a/src/style-spec/feature_filter/convert.ts b/src/style-spec/feature_filter/convert.ts index daa934165b..d1b36d9bb4 100644 --- a/src/style-spec/feature_filter/convert.ts +++ b/src/style-spec/feature_filter/convert.ts @@ -2,9 +2,7 @@ import {isExpressionFilter} from './index'; import type {FilterSpecification} from '../types'; -type ExpectedTypes = { - [_: string]: "string" | "number" | "boolean" -}; +type ExpectedTypes = {[_: string]: "string" | "number" | "boolean"}; /** * Convert the given legacy filter to (the JSON representation of) an diff --git a/src/style-spec/style-spec.ts b/src/style-spec/style-spec.ts index 590ba8292a..eceec205a5 100644 --- a/src/style-spec/style-spec.ts +++ b/src/style-spec/style-spec.ts @@ -29,9 +29,7 @@ export type StylePropertySpecification = { type: "enum", 'property-type': ExpressionType, expression?: ExpressionSpecification, - values: { - [_: string]: {} - }, + values: {[_: string]: {}}, transition: boolean, default?: string } | { diff --git a/src/style-spec/types.ts b/src/style-spec/types.ts index de2337aaff..76a6b0ad2a 100644 --- a/src/style-spec/types.ts +++ b/src/style-spec/types.ts @@ -7,9 +7,7 @@ export type FormattedSpecification = string; export type ResolvedImageSpecification = string; -export type PromoteIdSpecification = { - [_: string]: string -} | string; +export type PromoteIdSpecification = {[_: string]: string} | string; export type FilterSpecification = ["has", string] | ["!has", string] | ["==", string, string | number | boolean] | ["!=", string, string | number | boolean] | [">", string, string | number | boolean] | [">=", string, string | number | boolean] | ["<", string, string | number | boolean] | ["<=", string, string | number | boolean] | Array; // Can't type in, !in, all, any, none -- https://github.com/facebook/flow/issues/2443 @@ -90,9 +88,7 @@ export type StyleSpecification = { "bearing"?: number, "pitch"?: number, "light"?: LightSpecification, - "sources": { - [_: string]: SourceSpecification - }, + "sources": {[_: string]: SourceSpecification}, "sprite"?: string, "glyphs"?: string, "transition"?: TransitionSpecification, diff --git a/src/style-spec/util/unbundle_jsonlint.ts b/src/style-spec/util/unbundle_jsonlint.ts index d8d2d1458c..43128dc9c8 100644 --- a/src/style-spec/util/unbundle_jsonlint.ts +++ b/src/style-spec/util/unbundle_jsonlint.ts @@ -11,9 +11,7 @@ export function deepUnbundle(value: unknown): unknown { if (Array.isArray(value)) { return value.map(deepUnbundle); } else if (value instanceof Object && !(value instanceof Number || value instanceof String || value instanceof Boolean)) { - const unbundledValue: { - [key: string]: unknown - } = {}; + const unbundledValue: {[key: string]: unknown} = {}; for (const key in value) { unbundledValue[key] = deepUnbundle(value[key]); } diff --git a/src/style/load_sprite.ts b/src/style/load_sprite.ts index 6bf09ca395..daaf24c847 100644 --- a/src/style/load_sprite.ts +++ b/src/style/load_sprite.ts @@ -11,9 +11,7 @@ import type {Cancelable} from '../types/cancelable'; export default function( baseURL: string, requestManager: RequestManager, - callback: Callback<{ - [_: string]: StyleImage - }> + callback: Callback<{[_: string]: StyleImage}> ): Cancelable { let json: any, image, error; const format = browser.devicePixelRatio > 1 ? '@2x' : ''; diff --git a/src/style/pauseable_placement.ts b/src/style/pauseable_placement.ts index 223f71452a..890634084d 100644 --- a/src/style/pauseable_placement.ts +++ b/src/style/pauseable_placement.ts @@ -67,13 +67,15 @@ class PauseablePlacement { _showCollisionBoxes: boolean; _inProgressLayer: LayerPlacement | undefined | null; - constructor(transform: Transform, order: Array, - forceFullPlacement: boolean, - showCollisionBoxes: boolean, - fadeDuration: number, - crossSourceCollisions: boolean, - prevPlacement?: Placement) { - + constructor( + transform: Transform, + order: Array, + forceFullPlacement: boolean, + showCollisionBoxes: boolean, + fadeDuration: number, + crossSourceCollisions: boolean, + prevPlacement?: Placement + ) { this.placement = new Placement(transform, fadeDuration, crossSourceCollisions, prevPlacement); this._currentPlacementIndex = order.length - 1; this._forceFullPlacement = forceFullPlacement; @@ -81,15 +83,15 @@ class PauseablePlacement { this._done = false; } - isDone(): boolean { + isDone() { return this._done; } - continuePlacement(order: Array, layers: { - [_: string]: StyleLayer - }, layerTiles: { - [_: string]: Array - }) { + continuePlacement( + order: Array, + layers: {[_: string]: StyleLayer}, + layerTiles: {[_: string]: Array} + ) { const startTime = browser.now(); const shouldPausePlacement = () => { diff --git a/src/style/style.ts b/src/style/style.ts index 69a4131e47..da4b8e1da4 100644 --- a/src/style/style.ts +++ b/src/style/style.ts @@ -110,35 +110,19 @@ class Style extends Evented { _request: Cancelable | undefined | null; _spriteRequest: Cancelable | undefined | null; - _layers: { - [_: string]: StyleLayer - }; - _serializedLayers: { - [_: string]: any - }; + _layers: {[_: string]: StyleLayer}; + _serializedLayers: {[_: string]: any}; _order: Array; - sourceCaches: { - [_: string]: SourceCache - }; + sourceCaches: {[_: string]: SourceCache}; zoomHistory: ZoomHistory; _loaded: boolean; _rtlTextPluginCallback: (a: any) => any; _changed: boolean; - _updatedSources: { - [_: string]: "clear" | "reload" - }; - _updatedLayers: { - [_: string]: true - }; - _removedLayers: { - [_: string]: StyleLayer - }; - _changedImages: { - [_: string]: true - }; - _updatedPaintProps: { - [layer: string]: true - }; + _updatedSources: {[_: string]: "clear" | "reload"}; + _updatedLayers: {[_: string]: true}; + _removedLayers: {[_: string]: StyleLayer}; + _changedImages: {[_: string]: true}; + _updatedPaintProps: {[layer: string]: true}; _layerOrderChanged: boolean; _availableImages: Array; @@ -1175,11 +1159,14 @@ class Style extends Evented { return this._flattenAndSortRenderedFeatures(sourceResults); } - querySourceFeatures(sourceID: string, params?: { - sourceLayer: string | undefined | null, - filter: Array | undefined | null, - validate?: boolean - } | null) { + querySourceFeatures( + sourceID: string, + params?: { + sourceLayer: string | undefined | null, + filter: Array | undefined | null, + validate?: boolean + } | null + ) { if (params && params.filter) { this._validate(validateStyle.filter, 'querySourceFeatures.filter', params.filter, null, params); } @@ -1369,15 +1356,16 @@ class Style extends Evented { // Callbacks from web workers - getImages(mapId: string, params: { - icons: Array, - source: string, - tileID: OverscaledTileID, - type: string - }, callback: Callback<{ - [_: string]: StyleImage - }>) { - + getImages( + mapId: string, + params: { + icons: Array, + source: string, + tileID: OverscaledTileID, + type: string + }, + callback: Callback<{[_: string]: StyleImage}> + ) { this.imageManager.getImages(params.icons, callback); // Apply queued image changes before setting the tile's dependencies so that the tile @@ -1396,15 +1384,11 @@ class Style extends Evented { } } - getGlyphs(mapId: string, params: { - stacks: { - [_: string]: Array - } - }, callback: Callback<{ - [_: string]: { - [_: number]: StyleGlyph | undefined | null - } - }>) { + getGlyphs( + mapId: string, + params: {stacks: {[_: string]: Array}}, + callback: Callback<{[_: string]: {[_: number]: StyleGlyph | undefined | null}}> + ) { this.glyphManager.getGlyphs(params.stacks, callback); } diff --git a/src/style/style_layer_index.ts b/src/style/style_layer_index.ts index d1dd941c0e..c97a0dd8e4 100644 --- a/src/style/style_layer_index.ts +++ b/src/style/style_layer_index.ts @@ -8,9 +8,7 @@ import groupByLayout from '../style-spec/group_by_layout'; import type {TypedStyleLayer} from './style_layer/typed_style_layer'; import type {LayerSpecification} from '../style-spec/types'; -export type LayerConfigs = { - [_: string]: LayerSpecification -}; +export type LayerConfigs = {[_: string]: LayerSpecification}; export type Family = Array; class StyleLayerIndex { @@ -19,14 +17,10 @@ class StyleLayerIndex { [sourceLayer: string]: Array> } }; - keyCache: { - [source: string]: string - }; + keyCache: {[source: string]: string}; _layerConfigs: LayerConfigs; - _layers: { - [_: string]: StyleLayer - }; + _layers: {[_: string]: StyleLayer}; constructor(layerConfigs?: Array | null) { this.keyCache = {}; diff --git a/src/symbol/cross_tile_symbol_index.ts b/src/symbol/cross_tile_symbol_index.ts index 7c536037b8..ba9c987798 100644 --- a/src/symbol/cross_tile_symbol_index.ts +++ b/src/symbol/cross_tile_symbol_index.ts @@ -252,14 +252,10 @@ class CrossTileSymbolLayerIndex { } class CrossTileSymbolIndex { - layerIndexes: { - [layerId: string]: CrossTileSymbolLayerIndex - }; + layerIndexes: {[layerId: string]: CrossTileSymbolLayerIndex}; crossTileIDs: CrossTileIDs; maxBucketInstanceId: number; - bucketsInCurrentPlacement: { - [_: number]: boolean - }; + bucketsInCurrentPlacement: {[_: number]: boolean}; constructor() { this.layerIndexes = {}; diff --git a/src/symbol/mergelines.ts b/src/symbol/mergelines.ts index 62f2d44b3b..262ca391a3 100644 --- a/src/symbol/mergelines.ts +++ b/src/symbol/mergelines.ts @@ -1,12 +1,8 @@ import type {SymbolFeature} from '../data/bucket/symbol_bucket'; export default function(features: Array): Array { - const leftIndex: { - [_: string]: number - } = {}; - const rightIndex: { - [_: string]: number - } = {}; + const leftIndex: {[_: string]: number} = {}; + const rightIndex: {[_: string]: number} = {}; const mergedFeatures = []; let mergedIndex = 0; diff --git a/src/symbol/placement.ts b/src/symbol/placement.ts index 9fbd519c0e..6ca5d1715c 100644 --- a/src/symbol/placement.ts +++ b/src/symbol/placement.ts @@ -101,9 +101,7 @@ type CollisionGroup = { }; class CollisionGroups { - collisionGroups: { - [groupName: string]: CollisionGroup - }; + collisionGroups: {[groupName: string]: CollisionGroup}; maxGroupID: number; crossSourceCollisions: boolean; diff --git a/src/symbol/quads.ts b/src/symbol/quads.ts index 1a2af1e0dc..d880b714d1 100644 --- a/src/symbol/quads.ts +++ b/src/symbol/quads.ts @@ -226,9 +226,7 @@ export function getGlyphQuads( layer: SymbolStyleLayer, alongLine: boolean, feature: Feature, - imageMap: { - [_: string]: StyleImage - }, + imageMap: {[_: string]: StyleImage}, allowVerticalPlacement: boolean ): Array { diff --git a/src/symbol/shaping.ts b/src/symbol/shaping.ts index 128ae5007d..bd802ae3f6 100644 --- a/src/symbol/shaping.ts +++ b/src/symbol/shaping.ts @@ -252,9 +252,7 @@ function shapeText( [_: number]: GlyphPosition } }, - imagePositions: { - [_: string]: ImagePosition - }, + imagePositions: {[_: string]: ImagePosition}, defaultFontStack: string, maxWidth: number, lineHeight: number, @@ -374,9 +372,7 @@ function getGlyphAdvance( [_: number]: StyleGlyph | undefined | null } }, - imagePositions: { - [_: string]: ImagePosition - }, + imagePositions: {[_: string]: ImagePosition}, spacing: number, layoutTextSize: number ): number { @@ -400,9 +396,7 @@ function determineAverageLineWidth(logicalInput: TaggedString, [_: number]: StyleGlyph | undefined | null } }, - imagePositions: { - [_: string]: ImagePosition - }, + imagePositions: {[_: string]: ImagePosition}, layoutTextSize: number) { let totalWidth = 0; @@ -513,9 +507,7 @@ function determineLineBreaks( [_: number]: StyleGlyph | undefined | null } }, - imagePositions: { - [_: string]: ImagePosition - }, + imagePositions: {[_: string]: ImagePosition}, symbolPlacement: string, layoutTextSize: number ): Array { @@ -608,9 +600,7 @@ function shapeLines(shaping: Shaping, [_: number]: GlyphPosition } }, - imagePositions: { - [_: string]: ImagePosition - }, + imagePositions: {[_: string]: ImagePosition}, lines: Array, lineHeight: number, textAnchor: SymbolAnchor, diff --git a/src/symbol/symbol_layout.ts b/src/symbol/symbol_layout.ts index 028ddf118c..e7cc7ee742 100644 --- a/src/symbol/symbol_layout.ts +++ b/src/symbol/symbol_layout.ts @@ -157,12 +157,8 @@ export function performSymbolLayout( [x: number]: GlyphPosition } }, - imageMap: { - [_: string]: StyleImage - }, - imagePositions: { - [_: string]: ImagePosition - }, + imageMap: {[_: string]: StyleImage}, + imagePositions: {[_: string]: ImagePosition}, showCollisionBoxes: boolean, canonical: CanonicalTileID ) { @@ -364,9 +360,7 @@ function addFeature(bucket: SymbolBucket, feature: SymbolFeature, shapedTextOrientations: any, shapedIcon: PositionedIcon, - imageMap: { - [_: string]: StyleImage - }, + imageMap: {[_: string]: StyleImage}, sizes: Sizes, layoutTextSize: number, layoutIconSize: number, @@ -490,9 +484,7 @@ export {MAX_PACKED_SIZE}; function addTextVertices(bucket: SymbolBucket, anchor: Point, shapedText: Shaping, - imageMap: { - [_: string]: StyleImage - }, + imageMap: {[_: string]: StyleImage}, layer: SymbolStyleLayer, textAlongLine: boolean, feature: SymbolFeature, @@ -503,9 +495,7 @@ function addTextVertices(bucket: SymbolBucket, }, writingMode: number, placementTypes: Array<"vertical" | "center" | "left" | "right">, - placedTextSymbolIndices: { - [_: string]: number - }, + placedTextSymbolIndices: {[_: string]: number}, placedIconIndex: number, sizes: Sizes, canonical: CanonicalTileID) { @@ -578,9 +568,7 @@ function addSymbol(bucket: SymbolBucket, line: Array, shapedTextOrientations: any, shapedIcon: PositionedIcon | void, - imageMap: { - [_: string]: StyleImage - }, + imageMap: {[_: string]: StyleImage}, verticallyShapedIcon: PositionedIcon | void, layer: SymbolStyleLayer, collisionBoxArray: CollisionBoxArray, diff --git a/src/types/non-typed-modules.d.ts b/src/types/non-typed-modules.d.ts index 581d60388c..37d9d31c77 100644 --- a/src/types/non-typed-modules.d.ts +++ b/src/types/non-typed-modules.d.ts @@ -83,9 +83,7 @@ declare module "sinon" { declare global { declare interface VectorTile { - layers: { - [_: string]: VectorTileLayer - }; + layers: {[_: string]: VectorTileLayer}; } declare interface VectorTileLayer { @@ -100,9 +98,7 @@ declare global { extent: number; type: 1 | 2 | 3; id: number; - properties: { - [_: string]: string | number | boolean - }; + properties: {[_: string]: string | number | boolean}; loadGeometry(): Array>; toGeoJSON(x: number, y: number, z: number): GeoJSON.Feature; } diff --git a/src/ui/handler_manager.ts b/src/ui/handler_manager.ts index e58ab0572c..5b2c1aaeee 100644 --- a/src/ui/handler_manager.ts +++ b/src/ui/handler_manager.ts @@ -97,14 +97,10 @@ class HandlerManager { _frameId: number; _inertia: HandlerInertia; _bearingSnap: number; - _handlersById: { - [x: string]: Handler - }; + _handlersById: {[x: string]: Handler}; _updatingCamera: boolean; _changes: Array<[HandlerResult, any, any]>; - _previousActiveHandlers: { - [x: string]: Handler - }; + _previousActiveHandlers: {[x: string]: Handler}; _listeners: Array<[Window | Document | HTMLElement, string, { passive?: boolean, capture?: boolean @@ -268,9 +264,7 @@ class HandlerManager { return Boolean(isMoving(this._eventsInProgress)) || this.isZooming(); } - _blockedByActive(activeHandlers: { - [x: string]: Handler - }, allowed: Array, myName: string) { + _blockedByActive(activeHandlers: {[x: string]: Handler}, allowed: Array, myName: string) { for (const name in activeHandlers) { if (name === myName) continue; if (!allowed || allowed.indexOf(name) < 0) { @@ -447,9 +441,7 @@ class HandlerManager { } - _fireEvents(newEventsInProgress: { - [x: string]: any - }, deactivatedHandlers: any, allowEndAnimation: boolean) { + _fireEvents(newEventsInProgress: {[x: string]: any}, deactivatedHandlers: any, allowEndAnimation: boolean) { const wasMoving = isMoving(this._eventsInProgress); const nowMoving = isMoving(newEventsInProgress); diff --git a/src/ui/map.ts b/src/ui/map.ts index 777fee0756..5f37b129ce 100755 --- a/src/ui/map.ts +++ b/src/ui/map.ts @@ -280,9 +280,7 @@ class Map extends Camera { _container: HTMLElement; _canvasContainer: HTMLElement; _controlContainer: HTMLElement; - _controlPositions: { - [_: string]: HTMLElement - }; + _controlPositions: {[_: string]: HTMLElement}; _interactive: boolean | undefined | null; _showTileBoundaries: boolean | undefined | null; _showCollisionBoxes: boolean | undefined | null; diff --git a/src/util/config.ts b/src/util/config.ts index 2ae7d748b4..634ce9884b 100644 --- a/src/util/config.ts +++ b/src/util/config.ts @@ -5,9 +5,7 @@ type Config = { REQUIRE_ACCESS_TOKEN: boolean, ACCESS_TOKEN: string | undefined | null, MAX_PARALLEL_IMAGE_REQUESTS: number, - REGISTERED_PROTOCOLS: { - [x: string]: any - } + REGISTERED_PROTOCOLS: {[x: string]: any} }; const config: Config = { diff --git a/src/util/dictionary_coder.ts b/src/util/dictionary_coder.ts index 1180efbd78..f38df1e14b 100644 --- a/src/util/dictionary_coder.ts +++ b/src/util/dictionary_coder.ts @@ -1,9 +1,7 @@ import assert from 'assert'; class DictionaryCoder { - _stringToNumber: { - [_: string]: number - }; + _stringToNumber: {[_: string]: number}; _numberToString: Array; constructor(strings: Array) { diff --git a/src/util/evented.ts b/src/util/evented.ts index f3b1fb944f..b5b8d248b1 100644 --- a/src/util/evented.ts +++ b/src/util/evented.ts @@ -2,9 +2,7 @@ import {extend} from './util'; type Listener = (a: any) => any; -type Listeners = { - [_: string]: Array -}; +type Listeners = {[_: string]: Array}; function _addEventListener(type: string, listener: Listener, listenerList: Listeners) { const listenerExists = listenerList[type] && listenerList[type].indexOf(listener) !== -1; diff --git a/src/util/is_char_in_unicode_block.ts b/src/util/is_char_in_unicode_block.ts index 3c1a4b0ece..2a908a5429 100644 --- a/src/util/is_char_in_unicode_block.ts +++ b/src/util/is_char_in_unicode_block.ts @@ -1,9 +1,7 @@ // The following table comes from . // Keep it synchronized with . -type UnicodeBlockLookup = { - [key: string]: (char: number) => boolean -}; +type UnicodeBlockLookup = {[key: string]: (char: number) => boolean}; const unicodeBlockLookup: UnicodeBlockLookup = { // 'Basic Latin': (char) => char >= 0x0000 && char <= 0x007F, diff --git a/src/util/mapbox.ts b/src/util/mapbox.ts index 2b74879a12..710a5328a9 100644 --- a/src/util/mapbox.ts +++ b/src/util/mapbox.ts @@ -337,9 +337,12 @@ class TelemetryEvent { * to the values that should be saved. For this reason, the callback should be invoked prior to the call * to TelemetryEvent#saveData */ - postEvent(timestamp: number, additionalPayload: { - [_: string]: any - }, callback: (err?: Error | null) => void, customAccessToken?: string | null) { + postEvent( + timestamp: number, + additionalPayload: {[_: string]: any}, + callback: (err?: Error | null) => void, + customAccessToken?: string | null + ) { if (!config.EVENTS_URL) return; const eventsUrlObject: UrlObject = parseUrl(config.EVENTS_URL); eventsUrlObject.params.push(`access_token=${customAccessToken || config.ACCESS_TOKEN || ''}`); diff --git a/src/util/util.ts b/src/util/util.ts index 177ac4b9b0..c82524f77f 100644 --- a/src/util/util.ts +++ b/src/util/util.ts @@ -115,9 +115,7 @@ export function asyncAll( * @private */ export function values( - obj: { - [key: string]: T - } + obj: {[key: string]: T} ): Array { const result = []; for (const k in obj) { @@ -134,12 +132,8 @@ export function values( * @private */ export function keysDifference( - obj: { - [key: string]: S - }, - other: { - [key: string]: T - } + obj: {[key: string]: S}, + other: {[key: string]: T} ): Array { const difference = []; for (const i in obj) { @@ -350,9 +344,7 @@ export function arraysIntersect(a: Array, b: Array): boolean { * * @private */ -const warnOnceHistory: { - [key: string]: boolean -} = {}; +const warnOnceHistory: {[key: string]: boolean} = {}; export function warnOnce(message: string): void { if (!warnOnceHistory[message]) {