Wrote it as an external module

This commit is contained in:
Jason Wu
2017-07-02 11:47:34 -05:00
parent e076754cc7
commit 1bdaeb9cbf
2 changed files with 22 additions and 30 deletions
+21 -29
View File
@@ -4,43 +4,35 @@
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
// export = Backbone;
// export as namespace Backbone;
export interface Position {
x: number;
y: number;
}
declare module 'draggabilly' {
interface Position {
x: number;
y: number;
}
export interface DraggabillyOptions {
axis?: 'x' | 'y';
containment?: Element | string | boolean;
grid?: [number, number];
handle?: string;
}
export interface DraggabillyOptions {
axis?: 'x' | 'y';
containment?: Element | string | boolean;
grid?: [number, number];
handle?: string;
}
export type DraggabillyEventName = 'dragStart' | 'dragMove' | 'dragEnd' | 'pointerDown' | 'pointerMove' | 'pointerUp'
| 'staticClick';
export type DraggabillyEventName = 'dragStart' | 'dragMove' | 'dragEnd' | 'pointerDown' | 'pointerMove' | 'pointerUp'
| 'staticClick';
export default class Draggabilly {
position: Position;
export default class Draggabilly {
position: Position;
constructor(element: Element | string, options?: DraggabillyOptions);
constructor(element: Element | string, options?: DraggabillyOptions);
on(eventName: DraggabillyEventName, listener: (event: Event, pointer: MouseEvent | Touch, moveVector: Position) => void): Draggabilly;
on(eventName: DraggabillyEventName,
listener: (event: Event, pointer: MouseEvent | Touch, moveVector: Position) => void): void;
off(eventName: DraggabillyEventName, listener: (event: Event, pointer: MouseEvent | Touch, moveVector: Position) => void): Draggabilly;
off(eventName: DraggabillyEventName,
listener: (event: Event, pointer: MouseEvent | Touch, moveVector: Position) => void): void;
once(eventName: DraggabillyEventName, listener: (event: Event, pointer: MouseEvent | Touch, moveVector?: Position) => void): Draggabilly;
once(eventName: DraggabillyEventName,
listener: (event: Event, pointer: MouseEvent | Touch, moveVector?: Position) => void): void;
enable(): void;
enable(): void;
disable(): void;
disable(): void;
destroy(): void;
}
destroy(): void;
}
+1 -1
View File
@@ -7,7 +7,7 @@
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"