Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Hammer.js #39

Merged
merged 3 commits into from
Feb 4, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
81 changes: 43 additions & 38 deletions deck.gl__core/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,8 @@ declare module '@deck.gl/core/lib/layer-state' {
declare module '@deck.gl/core/lib/layer' {
import AttributeManager from '@deck.gl/core/lib/attribute-manager';
import Component from '@deck.gl/core/lifecycle/component';
import { PickInfo } from '@deck.gl/core/lib/deck';
import * as hammerjs from 'hammerjs';
export interface TransitionTiming {
duration?: number;
easing?: (t: number) => number;
Expand All @@ -649,15 +651,18 @@ declare module '@deck.gl/core/lib/layer' {
lightsStrength?: number[],
numberOfLights?: number
}
export interface LayerInputHandler {
(o: PickInfo, e: HammerInput): void;
}
export interface LayerProps {
coordinateSystem?: number;
id?: string;
transitions?: { [attributeGetter: string]: TransitionTiming };
pickable?: boolean;
autoHighlight?: boolean;
highlightColor?: number[];
onClick?: (o) => void;
onHover?: (o) => void;
onClick?: LayerInputHandler;
onHover?: LayerInputHandler;
lightSettings?: LightSettings;
}
export default class Layer extends Component {
Expand Down Expand Up @@ -832,10 +837,10 @@ declare module '@deck.gl/core/lib/pick-layers' {
deviceRadius: any;
deviceRect: any;
}): {
pickedColor: any;
pickedLayer: any;
pickedObjectIndex: any;
};
pickedColor: any;
pickedLayer: any;
pickedObjectIndex: any;
};

}
declare module '@deck.gl/core/utils/flatten' {
Expand Down Expand Up @@ -876,10 +881,10 @@ declare module '@deck.gl/core/utils/math-utils' {
viewMatrix: any;
viewMatrixInverse: any;
}): {
eye: any[];
direction: any[];
up: any[];
};
eye: any[];
direction: any[];
up: any[];
};
export function mod(value: any, divisor: any): any;

}
Expand Down Expand Up @@ -1038,9 +1043,9 @@ declare module '@deck.gl/core/lib/layer-manager' {
oldLayers: any;
newLayers: any;
}): {
error: any;
generatedLayers: any[];
};
error: any;
generatedLayers: any[];
};
_updateSublayersRecursively({ newLayers, oldLayerMap, generatedLayers }: {
newLayers: any;
oldLayerMap: any;
Expand Down Expand Up @@ -1090,11 +1095,11 @@ declare module '@deck.gl/core/views/view' {
width: any;
height: any;
}): {
x: any;
y: any;
width: any;
height: any;
};
x: any;
y: any;
width: any;
height: any;
};
_getControllerProps(defaultOpts: any): any;
_getViewport(props: any): any;
_parseDimensions({ x, y, width, height }: {
Expand Down Expand Up @@ -1523,9 +1528,9 @@ declare module '@deck.gl/core/controllers/map-controller' {
startBearing: any;
startPitch: any;
}): {
pitch: any;
bearing: any;
};
pitch: any;
bearing: any;
};
}
export default class MapController extends Controller {
constructor(props: any);
Expand Down Expand Up @@ -2131,18 +2136,18 @@ declare module '@deck.gl/core/experimental/utils/gpu-grid-aggregation/gpu-grid-a
maxData: any;
pixelIndex: any;
}): {
cellCount: any;
cellWeight: any;
totalCount: any;
maxCellWieght: any;
};
cellCount: any;
cellWeight: any;
totalCount: any;
maxCellWieght: any;
};
static getCellData({ countsData, size }: {
countsData: any;
size?: number;
}): {
cellCounts: any[];
cellWeights: any[];
};
cellCounts: any[];
cellWeights: any[];
};
constructor(gl: any, opts?: {});
delete(): void;
run(opts?: {}): {};
Expand Down Expand Up @@ -2186,15 +2191,15 @@ declare module '@deck.gl/core/experimental/utils/gpu-grid-aggregation/grid-aggre
viewport?: any;
boundingBox?: any;
}): {
countsBuffer: any;
maxCountBuffer: any;
countsData: any;
maxCountData: any;
gridSize: number[];
gridOrigin: any[];
cellSize: any[];
boundingBox: any;
};
countsBuffer: any;
maxCountBuffer: any;
countsData: any;
maxCountData: any;
gridSize: number[];
gridOrigin: any[];
cellSize: any[];
boundingBox: any;
};
export function alignToCell(inValue: any, cellSize: any): number;

}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
"typescript": "^2.9.2"
},
"dependencies": {
"@types/hammerjs": "^2.0.36",
"@types/react": "*",
"deck.gl": "^6.3.2",
"fs-extra": "^7.0.0",
"indefinitely-typed": "^1.0.2",
"luma.gl": "^6.3.2"
Expand Down
2 changes: 2 additions & 0 deletions scripts/convert.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ function genProcess(obj) {
}
}

console.log('make sure you have deck.gl installed with: "npm install deck.gl" ')

var list = [

Expand All @@ -67,3 +68,4 @@ var list = [
];

list.forEach(genProcess);

3 changes: 1 addition & 2 deletions test/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ import {
import {
CubeGeometry,
fp64,
GL,
Model
} from 'luma.gl';
} from 'luma.gl';