Type definitions for siema

This commit is contained in:
Irmantas Zenkus
2017-01-05 10:07:08 +02:00
parent d20a983f78
commit 7655929542
3 changed files with 65 additions and 0 deletions
+28
View File
@@ -0,0 +1,28 @@
// Type definitions for siema
// Project: https://github.com/pawelgrzybek/siema
// Definitions by: Irmantas Zenkus <https://github.com/Irmiz>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare module 'siema' {
interface SiemaOptions {
selector?: string;
duration?: number;
easing?: string;
perPage?: number;
startIndex?: number;
draggable?: boolean;
threshold?: number;
loop?: boolean;
}
class Siema {
public currentSlide: number;
constructor(options?: SiemaOptions);
public next(): void;
public prev(): void;
public goTo(index: number): void;
}
export = Siema;
}
+17
View File
@@ -0,0 +1,17 @@
import Siema = require('siema');
const siema = new Siema({
selector: '.siema',
duration: 200,
easing: 'ease-out',
perPage: 1,
startIndex: 0,
draggable: true,
threshold: 20,
loop: false,
});
siema.next();
siema.prev();
siema.goTo(0);
siema.currentSlide;
+20
View File
@@ -0,0 +1,20 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": false,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"siema-tests.ts"
]
}