Skip to content
This repository has been archived by the owner on Apr 25, 2018. It is now read-only.

Commit

Permalink
feat: Simplify api
Browse files Browse the repository at this point in the history
Update all dependencies
Conform generic types for typescript 2.8
BREAKING CHANGE
  • Loading branch information
stoffeastrom committed Apr 4, 2018
1 parent 23436ca commit 0f59379
Show file tree
Hide file tree
Showing 83 changed files with 4,954 additions and 1,796 deletions.
4,587 changes: 3,262 additions & 1,325 deletions package-lock.json

Large diffs are not rendered by default.

33 changes: 16 additions & 17 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,7 @@
"amd-bundled": "npm run compile -- --module amd --outFile dist/oribella-framework.js",
"system": "npm run compile -- --module system --outDir dist/system",
"es2015": "npm run compile -- --module es2015 --outDir dist/es2015 --target es2015",
"build": "npm-run-all -n clean --parallel commonjs amd amd-bundled system es2015",
"typings": "typings install"
"build": "npm-run-all -n clean --parallel commonjs amd amd-bundled system es2015"
},
"author": "Christoffer Åström",
"license": "MIT",
Expand All @@ -45,28 +44,28 @@
}
},
"dependencies": {
"tslib": "^1.5.0"
"tslib": "^1.9.0"
},
"devDependencies": {
"@types/chai": "^4.0.1",
"@types/jsdom": "^11.0.1",
"@types/chai": "^4.1.2",
"@types/jsdom": "^11.0.4",
"@types/mocha": "^5.0.0",
"@types/node": "^9.3.0",
"@types/sinon": "^4.0.0",
"@types/sinon-chai": "^2.7.28",
"chai": "^4.0.2",
"@types/node": "^9.6.2",
"@types/sinon": "^4.3.0",
"@types/sinon-chai": "^2.7.29",
"chai": "^4.1.2",
"coveralls": "^3.0.0",
"jsdom": "^11.1.0",
"jsdom": "^11.7.0",
"mocha": "^5.0.0",
"npm-run-all": "^4.0.1",
"nyc": "^11.0.3",
"rimraf": "^2.5.4",
"sinon": "^5.0.0",
"npm-run-all": "^4.1.2",
"nyc": "^11.6.0",
"rimraf": "^2.6.2",
"sinon": "^4.5.0",
"sinon-chai": "^3.0.0",
"ts-node": "^5.0.0",
"tslint": "^5.5.0",
"typescript": "2.6.2",
"typings": "^2.1.0"
"tslint": "^5.9.1",
"tslint-config-airbnb": "^5.8.0",
"typescript": "^2.8.1"
},
"nyc": {
"include": [
Expand Down
59 changes: 59 additions & 0 deletions src/engine.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import { Registry } from './registry';
import { Gesture, GestureFactory } from './gesture';
import { ListenerFactory, Listener } from './listener';
import { Flow } from './flow';
import { Options, OptionsFactory, Data, DataFactory, Pointers, PointerDataMap, PointerData } from './utils';
import { ListenerHandle, DefaultListenerHandle } from './listener-handle';
export interface PointersDelta {
all: number;
changed: number;
}
export interface ExecStrategyState {
evt: Event;
gestures: Gesture[];
gesture: Gesture;
pointers: Pointers;
pointersDelta: PointersDelta;
}
export declare type ExecStrategy = (state: ExecStrategyState) => number;
export declare class Engine {
element: Element | Document;
registry: Registry;
flows: Flow[];
activeFlow: Flow | null;
handles: DefaultListenerHandle[];
gestures: Gesture[];
composedGestures: Gesture[];
constructor(element: Element | Document, registry?: Registry);
registerGesture<G extends Gesture<O, D, L>, O extends Options, D extends Data, L extends Listener<O, D>>(GestureClass: GestureFactory<G, O, D, L>, GestureOptions?: OptionsFactory, GestureListener?: ListenerFactory<O, D>, GestureData?: DataFactory): void;
registerFlow(flow: Flow): void;
registerListener<G extends Gesture<O, D, L>, O extends Options, D extends Data, L extends Listener<O, D>>(GestureClass: GestureFactory<G, O, D, L>, element: Element, listener: L): () => void;
activate(): (() => void)[][];
canActivateFlow(flow: Flow): boolean;
getPointersDelta(evt: Event, pointers: Pointers, configuredPointers: number, configuredWhich: number[] | number): PointersDelta;
removeGesture(gesture: Gesture, ...arr: Gesture[][]): void;
evaluateStrategyReturnFlag(gesture: Gesture, flag: number): void;
whileGestures(evt: Event, gestures: Gesture[], pointers: Pointers, execStrategy: ExecStrategy): void;
addPointerId(gesture: Gesture, pointerId: number): void;
removePointerIds(map: PointerDataMap, gesture: Gesture, changed: number[]): void;
getPointerIds(gesture: Gesture): number[];
getRemovedPointers(gesture: Gesture): PointerData[];
getPointer(map: PointerDataMap, pointerId: number): PointerData;
getPointers(map: PointerDataMap, pointerIds: number[]): PointerData[];
isLockedPointers(gesture: Gesture, map: PointerDataMap): boolean;
startStrategy(state: ExecStrategyState): number;
updateStrategy(state: ExecStrategyState): number;
endStrategy(state: ExecStrategyState): number;
cancelStrategy(state: ExecStrategyState): number;
onStart(flow: Flow, evt: Event, pointers: Pointers): boolean;
onUpdate(flow: Flow, evt: Event, pointers: Pointers): void;
onEnd(flow: Flow, evt: Event, pointers: Pointers): void;
onCancel(flow: Flow, evt: Event, pointers: Pointers): void;
onStop(): void;
addGesture<G extends Gesture<O, D, L>, O extends Options, D extends Data, L extends Listener<O, D>>(GestureClass: GestureFactory<G, O, D, L>, element: Element, handle: ListenerHandle<G, O, D, L>, evt: Event): Gesture;
composeGesture<G extends Gesture<O, D, L>, O extends Options, D extends Data, L extends Listener<O, D>>(GestureClass: GestureFactory<G, O, D, L>, element: Element, handle: ListenerHandle<G, O, D, L>, evt: Event): Gesture;
matchesHandle<G extends Gesture<O, D, L>, O extends Options, D extends Data, L extends Listener<O, D>>(element: Element, handle: ListenerHandle<G, O, D, L>): boolean;
matchHandle<G extends Gesture<O, D, L>, O extends Options, D extends Data, L extends Listener<O, D>>(GestureClass: GestureFactory<G, O, D, L>, element: Element, handle: ListenerHandle<G, O, D, L>, evt: Event): Gesture | undefined;
matchHandles(element: Element, gestures: Gesture[], evt: Event): Gesture[];
match(target: Node, evt: Event): Gesture[];
}
284 changes: 284 additions & 0 deletions src/engine.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 0f59379

Please sign in to comment.