mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Types for JQuery Gray
This commit is contained in:
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
// Type definitions for JQuery Gray 1.6
|
||||
// Project: https://github.com/karlhorky/gray
|
||||
// Definitions by: Anderson Friaça <https://github.com/AndersonFriaca>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="jquery" />
|
||||
|
||||
export type Classes = Partial<{
|
||||
fade: string;
|
||||
}>;
|
||||
|
||||
export type Options = Partial<{
|
||||
fade: boolean;
|
||||
classes: Classes;
|
||||
}>;
|
||||
|
||||
declare global {
|
||||
interface JQuery {
|
||||
gray(options?: Options): JQuery;
|
||||
toggleClass(className: 'grayscale-off'): JQuery;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
import { Options } from "jquery-gray";
|
||||
|
||||
// basic usage
|
||||
$('.images').gray();
|
||||
|
||||
$('.images').toggleClass('grayscale-off');
|
||||
|
||||
// with options
|
||||
const options: Options = {
|
||||
fade: true,
|
||||
classes: {
|
||||
fade: 'grayscale-fade'
|
||||
}
|
||||
};
|
||||
|
||||
$('.images').gray(options);
|
||||
@@ -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-gray-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{"extends": "dtslint/dt.json"}
|
||||
Reference in New Issue
Block a user