diff --git a/siema/index.d.ts b/siema/index.d.ts new file mode 100644 index 0000000000..7f9fed8cf5 --- /dev/null +++ b/siema/index.d.ts @@ -0,0 +1,28 @@ +// Type definitions for siema +// Project: https://github.com/pawelgrzybek/siema +// Definitions by: Irmantas Zenkus +// 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; +} diff --git a/siema/siema-tests.ts b/siema/siema-tests.ts new file mode 100644 index 0000000000..b576e8dac6 --- /dev/null +++ b/siema/siema-tests.ts @@ -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; diff --git a/siema/tsconfig.json b/siema/tsconfig.json new file mode 100644 index 0000000000..b7b76fb08a --- /dev/null +++ b/siema/tsconfig.json @@ -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" + ] +}