Add 'jump.js' module (#14129)

This commit is contained in:
Linda_pp 2017-01-20 14:50:30 +09:00 committed by Mohamed Hegazy
parent ab1f759aa1
commit db23448a5d
4 changed files with 53 additions and 0 deletions

16
jump.js/index.d.ts vendored Normal file
View File

@ -0,0 +1,16 @@
// Type definitions for jump.js 1.0
// Project: https://github.com/callmecavs/jump.js
// Definitions by: rhysd <https://rhysd.github.io>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
declare type TransitionFunc = (t: number, b: number, c: number, d: number) => number;
declare interface JumpOptions {
duration?: number;
offset?: number;
callback?: () => void;
easing?: TransitionFunc;
a11y?: boolean;
}
declare type Jump = (target: string | Element | number, opts?: JumpOptions) => void;
declare const jump: Jump;
export = jump;

16
jump.js/jump.js-tests.ts Normal file
View File

@ -0,0 +1,16 @@
import jump = require('jump.js');
const node = document.querySelector('.target');
jump(node);
jump('.target');
jump('.target', {
duration: 1000,
});
jump('.target', {
duration: 200,
offset: 10
});
jump(100);
jump(-100, {
callback: () => { console.log('Done!') }
});

20
jump.js/tsconfig.json Normal file
View File

@ -0,0 +1,20 @@
{
"compilerOptions": {
"module": "commonjs",
"target": "es6",
"noImplicitAny": true,
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"typeRoots": [
"../"
],
"types": [],
"noEmit": true,
"forceConsistentCasingInFileNames": true
},
"files": [
"index.d.ts",
"jump.js-tests.ts"
]
}

1
jump.js/tslint.json Normal file
View File

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