Skip to content

Commit

Permalink
Remove Transferable type as a global and put it in the types folder.
Browse files Browse the repository at this point in the history
  • Loading branch information
vicapow authored and jfirebaugh committed Nov 21, 2017
1 parent dc5fbc4 commit 72ccc6a
Show file tree
Hide file tree
Showing 15 changed files with 18 additions and 1 deletion.
1 change: 0 additions & 1 deletion flow-typed/transferable.js

This file was deleted.

1 change: 1 addition & 0 deletions src/data/bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type CollisionBoxArray from '../symbol/collision_box';
import type Style from '../style/style';
import type StyleLayer from '../style/style_layer';
import type FeatureIndex from './feature_index';
import type {Transferable} from '../types/transferable';

export type BucketParameters = {
index: number,
Expand Down
1 change: 1 addition & 0 deletions src/data/bucket/circle_bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import type {ProgramInterface} from '../program_configuration';
import type StyleLayer from '../../style/style_layer';
import type {StructArray} from '../../util/struct_array';
import type Point from '@mapbox/point-geometry';
import type {Transferable} from '../../types/transferable';

const circleInterface = {
layoutAttributes: [
Expand Down
1 change: 1 addition & 0 deletions src/data/bucket/fill_bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import type {ProgramInterface} from '../program_configuration';
import type StyleLayer from '../../style/style_layer';
import type {StructArray} from '../../util/struct_array';
import type Point from '@mapbox/point-geometry';
import type {Transferable} from '../../types/transferable';

const fillInterface = {
layoutAttributes: [
Expand Down
1 change: 1 addition & 0 deletions src/data/bucket/fill_extrusion_bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import type {ProgramInterface} from '../program_configuration';
import type StyleLayer from '../../style/style_layer';
import type {StructArray} from '../../util/struct_array';
import type Point from '@mapbox/point-geometry';
import type {Transferable} from '../../types/transferable';

const fillExtrusionInterface = {
layoutAttributes: [
Expand Down
1 change: 1 addition & 0 deletions src/data/bucket/line_bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import type LineStyleLayer from '../../style/style_layer/line_style_layer';
import type Point from '@mapbox/point-geometry';
import type {Segment} from '../segment';
import type {StructArray} from '../../util/struct_array';
import type {Transferable} from '../../types/transferable';

// NOTE ON EXTRUDE SCALE:
// scale the extrusion vector so that the normal length is this value.
Expand Down
1 change: 1 addition & 0 deletions src/data/bucket/symbol_bucket.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ import type SymbolStyleLayer from '../../style/style_layer/symbol_style_layer';
import type {SymbolQuad} from '../../symbol/quads';
import type {SizeData} from '../../symbol/symbol_size';
import type {PossiblyEvaluatedPropertyValue} from '../../style/properties';
import type {Transferable} from '../../types/transferable';

export type SingleCollisionBox = {
x1: number;
Expand Down
1 change: 1 addition & 0 deletions src/data/feature_index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import type CollisionIndex from '../symbol/collision_index';
import type StyleLayer from '../style/style_layer';
import type {SerializedStructArray} from '../util/struct_array';
import type {FeatureFilter} from '../style-spec/feature_filter';
import type {Transferable} from '../types/transferable';

const FeatureIndexArray = createStructArrayType({
members: [
Expand Down
1 change: 1 addition & 0 deletions src/data/program_configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import type {ViewType, StructArray, SerializedStructArray, StructArrayTypeParame
import type Program from '../render/program';
import type {Feature, SourceExpression, CompositeExpression} from '../style-spec/expression';
import type {PossiblyEvaluated, PossiblyEvaluatedPropertyValue} from '../style/properties';
import type {Transferable} from '../types/transferable';

type LayoutAttribute = {
name: string,
Expand Down
1 change: 1 addition & 0 deletions src/source/worker_source.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import type {SerializedFeatureIndex} from '../data/feature_index';
import type {SerializedStructArray} from '../util/struct_array';
import type {RequestParameters} from '../util/ajax';
import type {RGBAImage, AlphaImage} from '../util/image';
import type {Transferable} from '../types/transferable';

export type TileParameters = {
source: string,
Expand Down
1 change: 1 addition & 0 deletions src/source/worker_tile.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import type {
WorkerTileParameters,
WorkerTileCallback,
} from '../source/worker_source';
import type {Transferable} from '../types/transferable';

class WorkerTile {
coord: TileCoord;
Expand Down
3 changes: 3 additions & 0 deletions src/types/transferable.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// @flow

export type Transferable = ArrayBuffer | MessagePort | ImageBitmap;
2 changes: 2 additions & 0 deletions src/util/actor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

const util = require('./util');

import type {Transferable} from '../types/transferable';

/**
* An implementation of the [Actor design pattern](http://en.wikipedia.org/wiki/Actor_model)
* that maintains the relationship between asynchronous tasks and the objects
Expand Down
1 change: 1 addition & 0 deletions src/util/dispatcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ const util = require('./util');
const Actor = require('./actor');

import type WorkerPool from './worker_pool';
import type {Transferable} from '../types/transferable';

/**
* Responsible for sending messages from a {@link Source} to an associated
Expand Down
2 changes: 2 additions & 0 deletions src/util/struct_array.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

const assert = require('assert');

import type {Transferable} from '../types/transferable';

module.exports = createStructArrayType;

const viewTypes = {
Expand Down

0 comments on commit 72ccc6a

Please sign in to comment.