mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-11 12:30:18 +00:00
Bug fix: It should be possible to create an Inputmask instance without any arguments to support the data-inputmask attribute.
This commit is contained in:
Vendored
+3
-3
@@ -637,7 +637,7 @@ declare namespace Inputmask {
|
||||
*
|
||||
* @param opts Mask options.
|
||||
*/
|
||||
(opts: Options): Instance;
|
||||
(opts?: Options): Instance;
|
||||
|
||||
/**
|
||||
* Creates a new Inputmask instance.
|
||||
@@ -651,7 +651,7 @@ declare namespace Inputmask {
|
||||
*
|
||||
* @param opts Mask options.
|
||||
*/
|
||||
new (opts: Options): Instance;
|
||||
new (opts?: Options): Instance;
|
||||
|
||||
/**
|
||||
* Extends the default inputmask options.
|
||||
@@ -778,7 +778,7 @@ declare global {
|
||||
*
|
||||
* @param opts Mask options.
|
||||
*/
|
||||
inputmask(opts: Inputmask.Options): Inputmask.Instance;
|
||||
inputmask(opts?: Inputmask.Options): Inputmask.Instance;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -78,6 +78,10 @@ Inputmask("9", { repeat: 10 }).mask("selector");
|
||||
Inputmask({ regex: "\\d*" }).mask("selector");
|
||||
Inputmask({ regex: String.raw`\d*` }).mask("selector");
|
||||
|
||||
let inputElement!: HTMLInputElement;
|
||||
Inputmask().mask(inputElement);
|
||||
Inputmask().mask([inputElement, inputElement]);
|
||||
|
||||
Inputmask.extendDefaults({
|
||||
autoUnmask: true
|
||||
});
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
$("#testmask").inputmask("remove");
|
||||
|
||||
$(":input").inputmask();
|
||||
|
||||
let value: string = $("#testmask").inputmask("unmaskedvalue");
|
||||
|
||||
$("#testmask").inputmask({
|
||||
|
||||
@@ -80,6 +80,10 @@ Inputmask("9", { repeat: 10 }).mask("selector");
|
||||
Inputmask({ regex: "\\d*" }).mask("selector");
|
||||
Inputmask({ regex: String.raw`\d*` }).mask("selector");
|
||||
|
||||
let inputElement!: HTMLInputElement;
|
||||
Inputmask().mask(inputElement);
|
||||
Inputmask().mask([inputElement, inputElement]);
|
||||
|
||||
Inputmask.extendDefaults({
|
||||
autoUnmask: true
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user