|
| 1 | +// Type definitions for jQuery.jsignature v2 |
| 2 | +// Project: https://github.com/willowsystems/jSignature |
| 3 | +// Definitions by: Patrick Magee <https://github.com/pjmagee> |
| 4 | +// Definitions: https://github.com/borisyankov/DefinitelyTyped |
| 5 | +// Project by: Willow Systems Corp |
| 6 | + |
| 7 | +/// <reference path='../jquery/jquery.d.ts'/> |
| 8 | + |
| 9 | +interface JQuery { |
| 10 | + |
| 11 | + /** |
| 12 | + * inits the jSignature widget |
| 13 | + */ |
| 14 | + jSignature(): JQuery; |
| 15 | + |
| 16 | + /** |
| 17 | + * Arguments vary per command. When provided, command is expected to be a string with a command for jSignature. Commands supported at this time: init, reset, getData, setData, listPlugins |
| 18 | + * @summary |
| 19 | + * init is the default, assumed action. init takes one argument - a settings Object. You can omit the command and just pass the settings object in upon init. Returns (in a traditional jQuery chainable way) jQuery object ref to the element onto which the plugin was applied. |
| 20 | + * clear (also aliased as reset) clears the signature pad, data store (and puts back signature line and other decor). Returns (in a traditional jQuery chainable way) jQuery object ref to the element onto which the plugin was applied. |
| 21 | + * getData takes an argument - the name of the data format. Returns a data object appropriate for the data format. |
| 22 | + * setData (also aliased as importData) takes two arguments - data object, (optional) data format name. When data object is a string formatted in data-url pattern you don't need to specify the data dormat name. The data format name (mime) will be implied from the data-url prefix. Returns (in a traditional jQuery chainable way) jQuery object ref to the element onto which the plugin was applied. |
| 23 | + * listPlugins takes an argument - a string denoting the category (Only export, import supported at this time) of plugins to list. Returns an array of strings. |
| 24 | + * |
| 25 | + * @param command the command used to perform an action on the jSignature canvas |
| 26 | + * @see http://willowsystems.github.io/jSignature/#/about/ |
| 27 | + * |
| 28 | + */ |
| 29 | + jSignature(command: string): any; |
| 30 | + |
| 31 | + /** |
| 32 | + * Arguments vary per command. When provided, command is expected to be a string with a command for jSignature. Commands supported at this time: init, reset, getData, setData, listPlugins |
| 33 | + * @summary |
| 34 | + * init is the default, assumed action. init takes one argument - a settings Object. You can omit the command and just pass the settings object in upon init. Returns (in a traditional jQuery chainable way) jQuery object ref to the element onto which the plugin was applied. |
| 35 | + * clear (also aliased as reset) clears the signature pad, data store (and puts back signature line and other decor). Returns (in a traditional jQuery chainable way) jQuery object ref to the element onto which the plugin was applied. |
| 36 | + * getData takes an argument - the name of the data format. Returns a data object appropriate for the data format. |
| 37 | + * setData (also aliased as importData) takes two arguments - data object, (optional) data format name. When data object is a string formatted in data-url pattern you don't need to specify the data dormat name. The data format name (mime) will be implied from the data-url prefix. Returns (in a traditional jQuery chainable way) jQuery object ref to the element onto which the plugin was applied. |
| 38 | + * listPlugins takes an argument - a string denoting the category (Only export, import supported at this time) of plugins to list. Returns an array of strings. |
| 39 | + * |
| 40 | + * @param command the command used to perform an action on the jSignature canvas |
| 41 | + * @param arg the argument used with the specified command |
| 42 | + * @see http://willowsystems.github.io/jSignature/#/about/ |
| 43 | + * |
| 44 | + */ |
| 45 | + jSignature(command: string, ...arg: string[]): any; |
| 46 | +} |
0 commit comments