Types for JQuery Pin

This commit is contained in:
AndersonFriaca 2018-03-23 22:13:48 -04:00
parent 2e3cfeee51
commit ceb4511524
4 changed files with 65 additions and 0 deletions

22
types/jquery.pin/index.d.ts vendored Normal file
View 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;
}
}

View 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);

View 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"
]
}

View File

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