mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 20:40:20 +00:00
Merge pull request #23491 from davidmpaz/stickem
Add type definitions for jquery-stickem package
This commit is contained in:
Vendored
+53
@@ -0,0 +1,53 @@
|
||||
// Type definitions for jquery.stickem.js 1.4
|
||||
// Project: https://github.com/davist11/jQuery-Stickem
|
||||
// Definitions by: David Paz <https://github.com/davidmpaz>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="jquery"/>
|
||||
|
||||
interface StickemSettings {
|
||||
/**
|
||||
* selector for element to make sticky
|
||||
*/
|
||||
item?: string;
|
||||
|
||||
/**
|
||||
* selector for content container, sizes matched with `item`
|
||||
*/
|
||||
container?: string;
|
||||
|
||||
/**
|
||||
* css class used to apply
|
||||
*/
|
||||
stickClass?: string;
|
||||
|
||||
/**
|
||||
* css class used to apply when ending sticky
|
||||
*/
|
||||
endStickClass?: string;
|
||||
|
||||
/**
|
||||
* offset to use for the sticky element in the parent element
|
||||
*/
|
||||
offset?: number | string;
|
||||
|
||||
/**
|
||||
* where to place sticky element
|
||||
*/
|
||||
start?: number | string;
|
||||
|
||||
/**
|
||||
* Callback to execute when in stick state
|
||||
*/
|
||||
onStick?: () => void;
|
||||
|
||||
/**
|
||||
* Callback to execute when getting out of stick state
|
||||
*/
|
||||
onUnstick?: () => void;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
stickem(settings?: StickemSettings): JQuery;
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
// without options
|
||||
$('div').stickem();
|
||||
|
||||
jQuery('div').stickem();
|
||||
|
||||
// with options
|
||||
$('div').stickem({item:
|
||||
'.stickem',
|
||||
container: '.stickem-container',
|
||||
stickClass: 'stickit',
|
||||
endStickClass: 'stickit-end'
|
||||
});
|
||||
|
||||
jQuery('div').stickem({
|
||||
item: '.stickem',
|
||||
container: '.stickem-container',
|
||||
stickClass: 'stickit',
|
||||
endStickClass: 'stickit-end'
|
||||
});
|
||||
@@ -0,0 +1,25 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6",
|
||||
"dom"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true,
|
||||
"esModuleInterop": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"jquery.stickem-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
{
|
||||
"extends": "dtslint/dt.json"
|
||||
}
|
||||
Reference in New Issue
Block a user