Merge pull request #27939 from NotWoods/remove-interactjs

Removes interactjs types
This commit is contained in:
Ron Buckton
2018-08-08 13:28:54 -07:00
committed by GitHub
5 changed files with 6 additions and 472 deletions

View File

@@ -678,6 +678,12 @@
"sourceRepoURL": "https://github.com/facebook/immutable-js",
"asOfVersion": "3.8.7"
},
{
"libraryName": "interactjs",
"typingsPackageName": "interact.js",
"sourceRepoURL": "https://github.com/taye/interact.js",
"asOfVersion": "1.3.0"
},
{
"libraryName": "inversify",
"typingsPackageName": "inversify",

View File

@@ -1,259 +0,0 @@
// Type definitions for Interacting for interact.js v1.0.25
// Project: https://github.com/taye/interact.js
// Definitions by: Douglas Eichelberger <https://github.com/dduugg>, Adi Dahiya <https://github.com/adidahiya>, Tom Hasner <https://github.com/thasner>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// API documentation: http://interactjs.io/docs
declare namespace Interact {
interface Interactable {
// returns Element or string
accept(): any;
accept(newValue: Element): Interactable;
accept(newValue: string): Interactable;
actionChecker(): Function;
actionChecker(checker: Function): Interactable;
// returns boolean or {[key: string]: any}
autoScroll(): any;
autoScroll(options: boolean): Interactable;
autoScroll(options: {[key: string]: any}): Interactable;
context(): Node;
defaultActionChecker(event: any): string;
deltaSource(): string;
// returns Interactable if newValue is "page" or "client", otherwise returns string
deltaSource(newValue: String): Interactable;
draggable(): boolean;
draggable(options: boolean): Interactable;
draggable(options: {[key: string]: any}): Interactable;
dropCheck(event: MouseEvent): boolean;
dropCheck(event: TouchEvent): boolean;
dropChecker(): Function;
dropChecker(checker: Function): Interactable;
// returns boolean or {[key: string]: any}
dropzone(): any;
dropzone(options: boolean): Interactable;
dropzone(options: {[key: string]: any}): Interactable;
// return HTMLElement or SVGElement
element(): Element;
fire(iEvent: InteractEvent): Interactable;
// returns boolean or {[key: string]: any}
gesturable(): any;
gesturable(options: boolean): Interactable;
gesturable(options: {[key: string]: any}): Interactable;
getRect(): ClientRect;
// returns Element or string
ignoreFrom(): any;
ignoreFrom(newValue: string): Interactable;
ignoreFrom(newValue: Element): Interactable;
// returns boolean or {[key: string]: any}
inertia(): any;
inertia(options: boolean): Interactable;
inertia(options: {[key: string]: any}): Interactable;
off(eventType: string, listener: Function, useCapture?: boolean): Interactable;
on(eventType: string, listener: Function, useCapture?: boolean): Interactable;
origin(): Point;
origin(newValue: HTMLElement): Interactable;
origin(newValue: SVGElement): Interactable;
origin(newValue: Point): Interactable;
preventDefault(newValue: boolean | string): Interactable;
rectChecker(): Function;
rectChecker(newValue: Function): Interactable;
resizable(): Interactable;
resizable(options: boolean): Interactable;
resizable(options: {[key: string]: any}): Interactable;
restrict(): Restrict;
restrict(newValue: Restrict): Interactable;
set(options: {[key: string]: any}): Interactable;
// returns boolean or {[key: string]: any}
snap(): any;
snap(options: boolean): Interactable;
snap(options: {[key: string]: any}): Interactable;
squareResize(): boolean;
squareResize(newValue: boolean): Interactable;
styleCursor(): boolean;
styleCursor(newValue: boolean): Interactable;
unset(): InteractStatic;
validateSetting(context: string, option: string, value: any): any;
}
interface Coordinates {
clientX: number;
clientY: number;
pageX: number;
pageY: number;
timeStamp: number;
}
interface Debug {
target: any;
dragging: any;
resizing: any;
gesturing: any;
prepared: any;
prevCoords: Coordinates;
downCoords: Coordinates;
pointerIds: any[];
pointerMoves: any[];
addPointer: any;
removePointer: any;
recordPointers: any;
inertia: InertiaStatus;
downTime: any;
downEvent: any;
prevEvent: any;
Interactable: any;
IOptions: any;
interactables: any;
dropzones: any;
pointerIsDown: any;
defaultOptions: any;
defaultActionChecker: any;
actions: any;
dragMove: any;
resizeMove: any;
gestureMove: any;
pointerUp: any;
pointerDown: any;
pointerMove: any;
pointerHover: any;
events: any;
globalEvents: any;
delegatedEvents: any;
}
interface InertiaStatus {
active: boolean;
target: any;
targetElement: any;
startEvent: any;
pointerUp: any
xe: number;
ye: number;
duration: number;
t0: number;
vx0: number;
vys: number;
lambda_v0: number;
one_ve_v0: number;
i: any;
}
interface Point {
x: number;
y: number;
}
// value types are either ClientRect or Element
interface Restrict {
drag?: any;
gesture?: any;
resize?: any;
elementRect?: {[direction: string]: number};
}
interface InteractEvent {
altKey: boolean;
axes: string;
button: number
clientX0: number;
clientX: number
clientY0: number;
clientY: number
ctrlKey: boolean
dt: number;
duration: number;
dx: number;
dy: number;
metaKey: boolean;
pageX: number;
pageY: number;
shiftKey: boolean;
speed: number;
t0: number;
target: any;
timeStamp: number;
type: string;
velocityX: number;
velocityY: number;
x0: number;
y0: number;
}
interface TouchEvent {
pageX: number;
pageY: number;
type: string;
}
interface InteractStatic {
(element: HTMLElement): Interactable;
(element: SVGElement): Interactable;
(element: string): Interactable;
(element: string, options: {context: Element}): Interactable;
// returns boolean or {[key: string]: any}
autoScroll(): any;
autoScroll(options: boolean): InteractStatic;
autoScroll(options: {[key: string]: any}): InteractStatic;
currentAction(): string
debug(): Debug;
deltaSource(): string;
// "page" and "client" are the valid parameters
deltaSource(newValue: string): InteractStatic;
dynamicDrop(): boolean;
dynamicDrop(newValue: boolean): InteractStatic;
enableDragging(): boolean;
enableDragging(newValue: boolean): InteractStatic;
enableGesturing(): boolean;
enableGesturing(newValue: boolean): InteractStatic;
enableResizing(): boolean;
enableResizing(newValue: boolean): InteractStatic;
// returns boolean or {[key: string]: any}
inertia(): any;
inertia(options: boolean): InteractStatic;
inertia(options: {[key: string]: any}): InteractStatic;
isSet(element: Element): boolean;
margin(): number;
margin(newvalue: number): InteractStatic;
off(type: string, listener: Function, useCapture?: boolean): InteractStatic;
on(type: string, listener: Function, useCapture?: boolean): InteractStatic;
restrict(): Restrict;
restrict(newValue: Restrict): InteractStatic;
simulate(action: string, element: Element, pointerEvent?: any): InteractStatic;
// returns boolean or {[key: string]: any}
snap(): any;
snap(options: boolean): InteractStatic;
snap(options: {[key: string]: any}): InteractStatic;
stop(event: Event): InteractStatic;
styleCursor(): boolean;
styleCursor(newValue: boolean): InteractStatic;
supportsTouch(): boolean
}
}
declare var interact: Interact.InteractStatic;
// CommonJS module name until version 1.2.6 is "interact.js"
declare module "interact.js" {
export = interact;
}
// CommonJS module name from version 1.2.7 onward is "interactjs"
declare module "interactjs" {
export = interact;
}
// AMD module name is "interact"
declare module "interact" {
export = interact;
}

View File

@@ -1,110 +0,0 @@
import interact = require("interact.js");
var button: HTMLElement = document.createElement("BUTTON");
var rectangle: ClientRect = {
left: 100,
width: 100,
right: 100,
top: 100,
bottom: 100,
height: 100
};
let context = document.createElement("a");
let interactable = interact(".foo", {context: context});
interactable = interact(button);
interactable.draggable();
interactable.draggable(true);
interactable.draggable({
onstart: (event: Interact.InteractEvent) => {},
onmove : (event: Interact.InteractEvent) => {},
onend : (event: Interact.InteractEvent) => {}
});
interactable.dropzone();
interactable.dropzone(true);
interactable.dropChecker(() => {});
interactable.accept();
interactable.accept("button");
interactable.accept(button);
interactable.resizable();
interactable.resizable(true);
interactable.squareResize();
interactable.squareResize(true);
interactable.gesturable();
interactable.gesturable(true);
interactable.gesturable({
onmove: () => {}
});
interactable.autoScroll();
interactable.autoScroll(true);
interactable.snap();
interactable.snap(true);
interactable.inertia();
interactable.inertia({
resistance: 1
});
interactable.inertia(true);
interactable.actionChecker();
interactable.actionChecker((event: MouseEvent, defaultAction: string, interactable2: Interact.Interactable) => defaultAction);
var rect: ClientRect = interactable.getRect();
interactable.rectChecker();
interactable.styleCursor();
interactable.origin();
interactable.origin({x: 0, y: 0});
interactable.origin(button);
interactable.deltaSource();
interactable.deltaSource("client");
interactable.restrict();
interactable.restrict({
"drag": button,
"resize": button,
"gesture": button
});
interactable.context();
interactable.ignoreFrom();
interactable.ignoreFrom("button");
interactable.ignoreFrom(button);
interactable.validateSetting("restrict", "drag", button);
interactable.element();
interactable.on("click", () => {}, true);
interactable.off("click", () => {}, true);
interactable.unset();
interact.isSet(button);
interact.on("click", () => {}, true);
interact.off("click", () => {}, true);
interact.enableDragging();
interact.enableDragging(true);
interact.enableResizing();
interact.enableResizing(true);
interact.enableGesturing();
interact.enableGesturing(true);
interact.debug();
interact.margin();
interact.margin(10);
interact.styleCursor();
interact.styleCursor(true);
interact.autoScroll(true);
interact.autoScroll();
interact.snap();
interact.snap(true);
interact.snap({
mode: "grid"
});
interact.inertia();
interact.inertia(true);
interact.supportsTouch();
interact.currentAction();
interact.dynamicDrop();
interact.dynamicDrop(true);
interact.deltaSource();
interact.deltaSource("page");
interact.restrict({
"drag": rectangle,
"resize": rectangle,
"gesture": rectangle,
"elementRect": { top: 0, left: 0, bottom: 1, right: 1 }
});

View File

@@ -1,24 +0,0 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictFunctionTypes": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"interact.js-tests.ts"
]
}

View File

@@ -1,79 +0,0 @@
{
"extends": "dtslint/dt.json",
"rules": {
"adjacent-overload-signatures": false,
"array-type": false,
"arrow-return-shorthand": false,
"ban-types": false,
"callable-types": false,
"comment-format": false,
"dt-header": false,
"eofline": false,
"export-just-namespace": false,
"import-spacing": false,
"interface-name": false,
"interface-over-type-literal": false,
"jsdoc-format": false,
"max-line-length": false,
"member-access": false,
"new-parens": false,
"no-any-union": false,
"no-boolean-literal-compare": false,
"no-conditional-assignment": false,
"no-consecutive-blank-lines": false,
"no-construct": false,
"no-declare-current-package": false,
"no-duplicate-imports": false,
"no-duplicate-variable": false,
"no-empty-interface": false,
"no-for-in-array": false,
"no-inferrable-types": false,
"no-internal-module": false,
"no-irregular-whitespace": false,
"no-mergeable-namespace": false,
"no-misused-new": false,
"no-namespace": false,
"no-object-literal-type-assertion": false,
"no-padding": false,
"no-redundant-jsdoc": false,
"no-redundant-jsdoc-2": false,
"no-redundant-undefined": false,
"no-reference-import": false,
"no-relative-import-in-test": false,
"no-self-import": false,
"no-single-declare-module": false,
"no-string-throw": false,
"no-unnecessary-callback-wrapper": false,
"no-unnecessary-class": false,
"no-unnecessary-generics": false,
"no-unnecessary-qualifier": false,
"no-unnecessary-type-assertion": false,
"no-useless-files": false,
"no-var-keyword": false,
"no-var-requires": false,
"no-void-expression": false,
"no-trailing-whitespace": false,
"object-literal-key-quotes": false,
"object-literal-shorthand": false,
"one-line": false,
"one-variable-per-declaration": false,
"only-arrow-functions": false,
"prefer-conditional-expression": false,
"prefer-const": false,
"prefer-declare-function": false,
"prefer-for-of": false,
"prefer-method-signature": false,
"prefer-template": false,
"radix": false,
"semicolon": false,
"space-before-function-paren": false,
"space-within-parens": false,
"strict-export-declare-modifiers": false,
"trim-file": false,
"triple-equals": false,
"typedef-whitespace": false,
"unified-signatures": false,
"void-return": false,
"whitespace": false
}
}