mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 10:56:53 +00:00
Add 'jump.js' module (#14129)
This commit is contained in:
parent
ab1f759aa1
commit
db23448a5d
16
jump.js/index.d.ts
vendored
Normal file
16
jump.js/index.d.ts
vendored
Normal 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
16
jump.js/jump.js-tests.ts
Normal 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
20
jump.js/tsconfig.json
Normal 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
1
jump.js/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{ "extends": "../tslint.json" }
|
||||
Loading…
Reference in New Issue
Block a user