mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
fixed filenames
This commit is contained in:
parent
c0554493a4
commit
1a9abb7158
37
jquery-knob/jquery-knob-tests.ts
Normal file
37
jquery-knob/jquery-knob-tests.ts
Normal file
@ -0,0 +1,37 @@
|
||||
/// <reference path="jquery-knob.d.ts"/>
|
||||
|
||||
// create from html attrs
|
||||
$('<input type="text" name="knob" value="50" data-min="0" data-max="100">').knob();
|
||||
|
||||
// create with object
|
||||
$('<input type="text" name="knob-2">').knob({
|
||||
min: 0,
|
||||
max: 100,
|
||||
angleArc: 270
|
||||
});
|
||||
|
||||
// hooks
|
||||
var hookKnob = $('<input type="text" name="knob-2">').knob({
|
||||
release: function(value) {
|
||||
console.log(value);
|
||||
},
|
||||
change: function(value) {
|
||||
console.log(value);
|
||||
},
|
||||
draw: function() {
|
||||
console.log(this);
|
||||
},
|
||||
cancel: function() {
|
||||
console.log(this);
|
||||
},
|
||||
format: function(value) {
|
||||
console.log(value);
|
||||
}
|
||||
});
|
||||
|
||||
// trigger
|
||||
hookKnob.trigger('release');
|
||||
hookKnob.trigger('change');
|
||||
hookKnob.trigger('draw');
|
||||
hookKnob.trigger('cancel');
|
||||
hookKnob.trigger('format');
|
||||
116
jquery-knob/jquery-knob.d.ts
vendored
Normal file
116
jquery-knob/jquery-knob.d.ts
vendored
Normal file
@ -0,0 +1,116 @@
|
||||
// Type definitions for jQuery Knob 1.2.11
|
||||
// Project: http://anthonyterrien.com/knob/
|
||||
// Definitions by: Iain Buchanan <https://github.com/iain8/>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
/// <reference path="../jquery/jquery.d.ts" />
|
||||
|
||||
declare module JQueryKnob {
|
||||
export interface JQueryKnobOptions {
|
||||
/**
|
||||
* min value | default=0
|
||||
*/
|
||||
min?: number;
|
||||
/**
|
||||
* max value | default=100
|
||||
*/
|
||||
max?: number;
|
||||
/**
|
||||
* step size | default=1
|
||||
*/
|
||||
step?: number;
|
||||
/**
|
||||
* starting angle in degrees | default=0
|
||||
*/
|
||||
angleOffset?: number;
|
||||
/**
|
||||
* arc size in degrees | default=360
|
||||
*/
|
||||
angleArc?: number;
|
||||
/**
|
||||
* stop at min & max on keydown/mousewheel | default=true
|
||||
*/
|
||||
stopper?: boolean;
|
||||
/**
|
||||
* disable input and events | default=false
|
||||
*/
|
||||
readOnly?: boolean;
|
||||
/**
|
||||
* direction of progression | default=clockwise
|
||||
*/
|
||||
rotation?: string;
|
||||
/**
|
||||
* display mode "cursor", cursor size could be changed passing a
|
||||
* numeric value to the option, default width is used when passing
|
||||
* boolean value "true" | default=gauge
|
||||
*/
|
||||
cursor?: string | boolean;
|
||||
/**
|
||||
* gauge thickness
|
||||
*/
|
||||
thickness?: number;
|
||||
/**
|
||||
* gauge stroke endings | default=butt, round=rounded line endings
|
||||
*/
|
||||
lineCap?: string;
|
||||
/**
|
||||
* dial width
|
||||
*/
|
||||
width?: number;
|
||||
/**
|
||||
* default=true | false=hide input
|
||||
*/
|
||||
displayInput?: boolean;
|
||||
/**
|
||||
* default=false | true=displays the previous value with transparency
|
||||
*/
|
||||
displayPrevious?: boolean;
|
||||
/**
|
||||
* foreground color
|
||||
*/
|
||||
fgColor?: string;
|
||||
/**
|
||||
* input value (number) color
|
||||
*/
|
||||
inputColor?: string;
|
||||
/**
|
||||
* font family
|
||||
*/
|
||||
font?: string;
|
||||
/**
|
||||
* font weight
|
||||
*/
|
||||
fontWeight?: string;
|
||||
/**
|
||||
* background color
|
||||
*/
|
||||
bgColor?: string;
|
||||
/**
|
||||
* executed on release
|
||||
*/
|
||||
release?: (value: number) => void;
|
||||
/**
|
||||
* executed at each change of the value
|
||||
*/
|
||||
change?: (value: number) => void;
|
||||
/**
|
||||
* when drawing the canvas
|
||||
*/
|
||||
draw?: () => void;
|
||||
/**
|
||||
* triggered on [esc] keydown
|
||||
*/
|
||||
cancel?: () => void;
|
||||
/**
|
||||
* allows to format output (add unit %, ms...)
|
||||
*/
|
||||
format?: (value: number) => void;
|
||||
}
|
||||
}
|
||||
|
||||
interface JQuery {
|
||||
/**
|
||||
* Create a knob for the given input field, with optional options
|
||||
*/
|
||||
knob(options?: JQueryKnob.JQueryKnobOptions): JQuery;
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user