Merge pull request #19772 from chinkan/drag-timetable

Added declarations for 'drag-timetable'
This commit is contained in:
Arthur Ozga
2017-09-15 10:19:53 -07:00
committed by GitHub
4 changed files with 74 additions and 0 deletions
@@ -0,0 +1,14 @@
import DragTimetable = require("drag-timetable");
const instance = DragTimetable.create(document.getElementById("timetable_container"), { hourStart: 0, hourEnd: 24 });
instance.addTask({id: 1, start: 9, end: 11, text: 'Task 1 - Get this stuff done!'}, true);
instance.addTask({id: 2, start: 12, end: 13, text: 'Task 2 - Get that stuff done!'}, true);
instance.setMoveCallback((task: any) => {
console.log('task moved: ' + task.id);
});
instance.setClickCallback((task: any) => {
console.log('task clicked: ' + task.id);
});
+36
View File
@@ -0,0 +1,36 @@
// Type definitions for drag-timetable 1.0
// Project: https://github.com/DJAndries/drag-timetable
// Definitions by: chinkan <https://github.com/chinkan>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
/** Declaration file generated by dts-gen */
export function create(container: HTMLElement | null, options: any): TimetableInstance;
export namespace create {
const prototype: {
};
}
export class TimetableInstance {
constructor(contextObj: any);
setMoveCallback(moveCallback: (task: any) => void): void;
setClickCallback(clickCallback: (task: any) => void): void;
addTask(task: any, isAddingToTimetable: boolean): HTMLDivElement;
removeTask(taskId: any): void;
getTask(taskId: any): any;
}
export class TimetableTask {
constructor(task: any, taskAreaSize: any);
updateTaskUI(): void;
getTimeElement(): HTMLDivElement;
}
+23
View File
@@ -0,0 +1,23 @@
{
"compilerOptions": {
"module": "commonjs",
"lib": [
"es6",
"dom"
],
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"drag-timetable-tests.ts"
]
}
+1
View File
@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }