Skip to content

Commit

Permalink
v1.4.0-alpha.28+sha.e624c4d
Browse files Browse the repository at this point in the history
  • Loading branch information
taye committed Feb 8, 2019
1 parent e624c4d commit b9e238e
Show file tree
Hide file tree
Showing 133 changed files with 2,782 additions and 910 deletions.
2 changes: 1 addition & 1 deletion lerna.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.4.0-alpha.27",
"version": "1.4.0-alpha.28",
"packages": [
".",
"packages/*"
Expand Down
10 changes: 5 additions & 5 deletions package-lock.json

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

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@interactjs/_dev",
"private": "true",
"version": "1.4.0-alpha.27+sha.12b8f8f",
"version": "1.4.0-alpha.28+sha.e624c4d",
"bin": {
"_dev": "scripts/_dev",
"@build": "scripts/build.js",
Expand Down
46 changes: 3 additions & 43 deletions packages/actions/drag.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ declare module '@interactjs/core/scope' {
}
}
export declare type DragEvent = Interact.InteractEvent<ActionName.Drag>;
export declare type DraggableMethod = (options?: Interact.OrBoolean<Interact.DraggableOptions> | boolean) => Interact.Interactable | Interact.DropzoneOptions;
export declare type DraggableMethod = Interact.ActionMethod<Interact.DraggableOptions>;
declare function install(scope: Scope): void;
declare function beforeMove({ interaction }: {
interaction: any;
Expand All @@ -27,52 +27,12 @@ declare function move({ iEvent, interaction }: {
iEvent: any;
interaction: any;
}): void;
/**
* ```js
* interact(element).draggable({
* onstart: function (event) {},
* onmove : function (event) {},
* onend : function (event) {},
*
* // the axis in which the first movement must be
* // for the drag sequence to start
* // 'xy' by default - any direction
* startAxis: 'x' || 'y' || 'xy',
*
* // 'xy' by default - don't restrict to one axis (move in any direction)
* // 'x' or 'y' to restrict movement to either axis
* // 'start' to restrict movement to the axis the drag started in
* lockAxis: 'x' || 'y' || 'xy' || 'start',
*
* // max number of drags that can happen concurrently
* // with elements of this Interactable. Infinity by default
* max: Infinity,
*
* // max number of drags that can target the same element+Interactable
* // 1 by default
* maxPerElement: 2
* });
*
* var isDraggable = interact('element').draggable(); // true
* ```
*
* Get or set whether drag actions can be performed on the target
*
* @alias Interactable.prototype.draggable
*
* @param {boolean | object} [options] true/false or An object with event
* listeners to be fired on drag events (object makes the Interactable
* draggable)
* @return {boolean | Interactable} boolean indicating if this can be the
* target of drag events, or this Interctable
*/
declare function draggable(this: Interact.Interactable, options?: Interact.DraggableOptions | boolean): import("@interactjs/core/Interactable").Interactable | import("../types").DraggableOptions;
declare const drag: {
install: typeof install;
draggable: typeof draggable;
draggable: import("../types/types").ActionMethod<import("../types/types").DraggableOptions>;
beforeMove: typeof beforeMove;
move: typeof move;
defaults: import("../types").DropzoneOptions;
defaults: import("../types/types").DropzoneOptions;
checker(_pointer: any, _event: any, interactable: any): {
name: string;
axis: any;
Expand Down
8 changes: 4 additions & 4 deletions packages/actions/drag.js

Large diffs are not rendered by default.

19 changes: 17 additions & 2 deletions packages/actions/drop/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import Interactable from '@interactjs/core/Interactable';
import InteractEvent from '@interactjs/core/InteractEvent';
import { Scope } from '@interactjs/core/scope';
export declare type DropzoneMethod = (options?: Interact.DropzoneOptions | boolean) => Interact.Interactable | Interact.DropzoneOptions;
Expand All @@ -10,7 +11,21 @@ declare module '@interactjs/core/Interactable' {
declare module '@interactjs/core/Interaction' {
interface Interaction {
dropStatus?: {
[key: string]: any;
cur: {
dropzone: Interactable;
element: Element;
};
prev: {
dropzone: Interactable;
element: Element;
};
rejected: boolean;
events: any;
activeDrops: Array<{
dropzone: Interactable;
Element: Element;
rect: Interact.Rect;
}>;
};
}
}
Expand Down Expand Up @@ -51,6 +66,6 @@ declare const drop: {
getDrop: typeof getDrop;
getDropEvents: typeof getDropEvents;
fireDropEvents: typeof fireDropEvents;
defaults: import("../../types").DropzoneOptions;
defaults: import("../../types/types").DropzoneOptions;
};
export default drop;
34 changes: 16 additions & 18 deletions packages/actions/drop/index.js

Large diffs are not rendered by default.

28 changes: 26 additions & 2 deletions packages/actions/gesture.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
import { ActionName, Scope } from '@interactjs/core/scope';
export declare type GesturableMethod = (options?: Interact.GesturableOptions | boolean) => Interact.Interactable | Interact.GesturableOptions;
export declare type GesturableMethod = Interact.ActionMethod<Interact.GesturableOptions>;
declare module '@interactjs/core/Interaction' {
interface Interaction {
gesture?: {
startAngle: number;
startDistance: number;
prevScale: number;
prevAngle: number;
prevDistance: number;
};
}
}
declare module '@interactjs/core/Interactable' {
interface Interactable {
gesturable: GesturableMethod;
Expand All @@ -18,7 +29,20 @@ declare module '@interactjs/core/scope' {
Gesture = "gesture"
}
}
export declare type GestureEvent = Interact.InteractEvent<ActionName.Gesture>;
export interface GestureEvent extends Interact.InteractEvent<ActionName.Gesture> {
distance: number;
angle: number;
da: number;
scale: number;
ds: number;
box: Interact.Rect;
touches: Interact.PointerType[];
}
export interface GestureSignalArg extends Interact.SignalArg {
iEvent: GestureEvent;
interaction: Interact.Interaction<ActionName.Gesture>;
event: Interact.PointerEventType | GestureEvent;
}
declare function install(scope: Scope): void;
declare const gesture: {
install: typeof install;
Expand Down
Loading

0 comments on commit b9e238e

Please sign in to comment.