Added declarations form 'drag-timetable'.

This commit is contained in:
Kan Cheung
2017-09-15 12:03:57 +08:00
parent 2673835592
commit f4fb59fad0
4 changed files with 75 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
import DragTimetable = require("drag-timetable");
var 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(function(task: any) {
console.log('task moved: ' + task.id);
});
instance.setClickCallback(function(task: any) {
console.log('task clicked: ' + task.id);
});

37
types/drag-timetable/index.d.ts vendored Normal file
View File

@@ -0,0 +1,37 @@
// Type definitions for drag-timetable 1.0.10
// 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: Function) :void;
setClickCallback(clickCallback: Function) :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;
}

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"
]
}

View File

@@ -0,0 +1 @@
{ "extends": "dtslint/dt.json" }