mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-07-04 17:20:09 +00:00
Add types for jquery-awesome-cursor (#23311)
This commit is contained in:
committed by
Sheetal Nandi
parent
0b755d302f
commit
00aad235f1
34
types/jquery-awesome-cursor/index.d.ts
vendored
Normal file
34
types/jquery-awesome-cursor/index.d.ts
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
// Type definitions for jquery-awesome-cursor 0.3
|
||||
// Project: https://jwarby.github.io/jquery-awesome-cursor
|
||||
// Definitions by: Zsolt Kovács <https://github.com/zskovacs>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.3
|
||||
|
||||
/// <reference types="jquery" />
|
||||
declare namespace JQueryAwesomeCursor {
|
||||
type flip = "horizontal" | "vertical" | "both";
|
||||
type cssHandler = (name: string) => void;
|
||||
|
||||
interface Options {
|
||||
color?: string;
|
||||
size?: number;
|
||||
hotspot?: number[] | string;
|
||||
flip?: flip;
|
||||
rotate?: number;
|
||||
outline?: string;
|
||||
font?: Font;
|
||||
}
|
||||
|
||||
interface Font {
|
||||
family: string;
|
||||
cssClass: string | cssHandler;
|
||||
}
|
||||
}
|
||||
|
||||
interface JQueryStatic {
|
||||
awesomeCursor(icon: string, options?: JQueryAwesomeCursor.Options): JQuery;
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
awesomeCursor(icon: string, options?: JQueryAwesomeCursor.Options): JQuery;
|
||||
}
|
||||
64
types/jquery-awesome-cursor/jquery-awesome-cursor-tests.ts
Normal file
64
types/jquery-awesome-cursor/jquery-awesome-cursor-tests.ts
Normal file
@@ -0,0 +1,64 @@
|
||||
// Default
|
||||
jQuery.awesomeCursor('pencil');
|
||||
|
||||
// Color
|
||||
jQuery.awesomeCursor('pencil', {
|
||||
color: '#ff0000'
|
||||
});
|
||||
|
||||
// Size
|
||||
jQuery.awesomeCursor('pencil', {
|
||||
size: 32
|
||||
});
|
||||
|
||||
// Hotspot
|
||||
jQuery.awesomeCursor('pencil', {
|
||||
hotspot: [0, 17]
|
||||
});
|
||||
jQuery.awesomeCursor('pencil', {
|
||||
hotspot: 'bottom left'
|
||||
});
|
||||
|
||||
// Flip
|
||||
jQuery.awesomeCursor('pencil', {
|
||||
flip: 'horizontal'
|
||||
});
|
||||
jQuery.awesomeCursor('pencil', {
|
||||
flip: 'vertical'
|
||||
});
|
||||
jQuery.awesomeCursor('pencil', {
|
||||
flip: 'both'
|
||||
});
|
||||
|
||||
// Rotate
|
||||
jQuery.awesomeCursor('pencil', {
|
||||
rotate: 45
|
||||
});
|
||||
|
||||
// Outline
|
||||
jQuery.awesomeCursor('pencil', {
|
||||
outline: 'red'
|
||||
});
|
||||
|
||||
// Different font
|
||||
jQuery.awesomeCursor('brush', {
|
||||
font: {
|
||||
family: 'typicons',
|
||||
cssClass: 'typcn typcn-%s'
|
||||
}
|
||||
});
|
||||
jQuery.awesomeCursor('brush', {
|
||||
font: {
|
||||
family: 'typicons',
|
||||
cssClass: (name) => {
|
||||
return 'typcn typcn-' + name;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// Mixed
|
||||
jQuery.awesomeCursor('long-arrow-left', {
|
||||
color: 'red',
|
||||
hotspot: 'top left',
|
||||
rotate: 45,
|
||||
});
|
||||
23
types/jquery-awesome-cursor/tsconfig.json
Normal file
23
types/jquery-awesome-cursor/tsconfig.json
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"jquery-awesome-cursor-tests.ts"
|
||||
]
|
||||
}
|
||||
1
types/jquery-awesome-cursor/tslint.json
Normal file
1
types/jquery-awesome-cursor/tslint.json
Normal file
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user