diff --git a/bench/benchmarks/layout.js b/bench/benchmarks/layout.js index f0b982fec9e..fd2c82364aa 100644 --- a/bench/benchmarks/layout.js +++ b/bench/benchmarks/layout.js @@ -18,6 +18,8 @@ const { normalizeTileURL } = require('../../src/util/mapbox'); +import type {TileJSON} from '../../src/types/tilejson'; + // Note: this class is extended in turn by the LayoutDDS benchmark. module.exports = class Layout extends Benchmark { glyphs: Object; diff --git a/src/source/load_tilejson.js b/src/source/load_tilejson.js index 5b9f4d9bec6..7472a20d27e 100644 --- a/src/source/load_tilejson.js +++ b/src/source/load_tilejson.js @@ -7,6 +7,7 @@ const normalizeURL = require('../util/mapbox').normalizeSourceURL; import type {RequestTransformFunction} from '../ui/map'; import type {Callback} from '../types/callback'; +import type {TileJSON} from '../types/tilejson'; module.exports = function(options: any, requestTransformFn: RequestTransformFunction, callback: Callback) { const loaded = function(err, tileJSON: any) { diff --git a/flow-typed/tilejson.js b/src/types/tilejson.js similarity index 91% rename from flow-typed/tilejson.js rename to src/types/tilejson.js index 03f779e1d0a..328f378e2a9 100644 --- a/flow-typed/tilejson.js +++ b/src/types/tilejson.js @@ -1,4 +1,6 @@ -declare type TileJSON = {| +// @flow + +export type TileJSON = {| tilejson: '2.2.0' | '2.1.0' | '2.0.1' | '2.0.0' | '1.0.0', name?: string, description?: string,