mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2025-10-16 12:05:41 +00:00
Types for JQuery Pin
This commit is contained in:
parent
2e3cfeee51
commit
ceb4511524
22
types/jquery.pin/index.d.ts
vendored
Normal file
22
types/jquery.pin/index.d.ts
vendored
Normal file
@ -0,0 +1,22 @@
|
||||
// Type definitions for JQuery Pin 1.0
|
||||
// Project: https://github.com/webpop/jquery.pin
|
||||
// Definitions by: Anderson Friaça <https://github.com/AndersonFriaca>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="jquery" />
|
||||
|
||||
export interface Options {
|
||||
minWidth?: number;
|
||||
activeClass?: string;
|
||||
containerSelector?: string;
|
||||
padding?: {
|
||||
top?: number;
|
||||
bottom?: number;
|
||||
};
|
||||
}
|
||||
declare global {
|
||||
interface JQuery {
|
||||
pin(options?: Options): JQuery;
|
||||
}
|
||||
}
|
||||
17
types/jquery.pin/jquery.pin-tests.ts
Normal file
17
types/jquery.pin/jquery.pin-tests.ts
Normal file
@ -0,0 +1,17 @@
|
||||
import { Options } from "jquery.pin";
|
||||
|
||||
// basic usage
|
||||
$(".pinned").pin();
|
||||
|
||||
// with options
|
||||
const options: Options = {
|
||||
activeClass: 'active',
|
||||
minWidth: 940,
|
||||
containerSelector: '.container',
|
||||
padding: {
|
||||
top: 10,
|
||||
bottom: 10
|
||||
}
|
||||
};
|
||||
|
||||
$(".pinned").pin(options);
|
||||
25
types/jquery.pin/tsconfig.json
Normal file
25
types/jquery.pin/tsconfig.json
Normal file
@ -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.pin-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/jquery.pin/tslint.json
Normal file
1
types/jquery.pin/tslint.json
Normal file
@ -0,0 +1 @@
|
||||
{"extends": "dtslint/dt.json"}
|
||||
Loading…
Reference in New Issue
Block a user