text-input-guard 0.1.3 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -156,6 +156,30 @@ type GuardContext = {
156
156
  * - IME変換中かどうか
157
157
  */
158
158
  composing: boolean;
159
+ /**
160
+ * - 直前の入力操作種別(insertText / insertFromPaste / insertCompositionText 等)
161
+ */
162
+ inputType: string | null;
163
+ /**
164
+ * - 挿入前の全文字列(置換範囲は除去済み)
165
+ */
166
+ beforeText: string;
167
+ /**
168
+ * - 挿入位置/置換開始位置(selectionStart)
169
+ */
170
+ replaceStart: number;
171
+ /**
172
+ * - 置換終了位置(selectionEnd)
173
+ */
174
+ replaceEnd: number;
175
+ /**
176
+ * - 挿入された文字列
177
+ */
178
+ insertedText: string;
179
+ /**
180
+ * - 挿入後の全文字列(後で代入する)
181
+ */
182
+ afterText: string;
159
183
  /**
160
184
  * - エラーを登録する関数
161
185
  */
@@ -232,35 +256,539 @@ type AttachOptions = {
232
256
  separateValue?: SeparateValueOptions;
233
257
  };
234
258
  /**
235
- * selection(カーソル/選択範囲)の退避情報
259
+ * revert要求(入力を巻き戻す指示)
260
+ */
261
+ type RevertRequest = {
262
+ /**
263
+ * - ルール名や理由(例: "digits.int_overflow")
264
+ */
265
+ reason: string;
266
+ /**
267
+ * - デバッグ用の詳細
268
+ */
269
+ detail?: any;
270
+ };
271
+
272
+ /**
273
+ * numeric ルールのオプション
274
+ * @typedef {Object} NumericRuleOptions
275
+ * @property {boolean} [allowFullWidth=true] - 全角数字/記号を許可して半角へ正規化する
276
+ * @property {boolean} [allowMinus=false] - マイナス記号を許可する(先頭のみ)
277
+ * @property {boolean} [allowDecimal=false] - 小数点を許可する(1つだけ)
278
+ * @property {boolean} [allowEmpty=true] - 空文字を許可するか
236
279
  */
237
- type SelectionState = {
280
+ /**
281
+ * 数値入力向けルールを生成する
282
+ * - normalize.char: 全角→半角、記号統一、不要文字の除去
283
+ * - normalize.structure: 「-は先頭のみ」「.は1つだけ」など構造を整える
284
+ * - fix: 確定時(blur)に「-」「.」「-.」や末尾の「.」を空/削除にする
285
+ *
286
+ * @param {NumericRuleOptions} [options]
287
+ * @returns {import("../text-input-guard.js").Rule}
288
+ */
289
+ declare function numeric(options?: NumericRuleOptions): Rule;
290
+ declare namespace numeric {
291
+ /**
292
+ * datasetから numeric ルールを生成する
293
+ * - data-tig-rules-numeric が無ければ null
294
+ * - オプションは data-tig-rules-numeric-xxx から読む
295
+ *
296
+ * 対応する data 属性(dataset 名)
297
+ * - data-tig-rules-numeric -> dataset.tigRulesNumeric
298
+ * - data-tig-rules-numeric-allow-full-width -> dataset.tigRulesNumericAllowFullWidth
299
+ * - data-tig-rules-numeric-allow-minus -> dataset.tigRulesNumericAllowMinus
300
+ * - data-tig-rules-numeric-allow-decimal -> dataset.tigRulesNumericAllowDecimal
301
+ * - data-tig-rules-numeric-allow-empty -> dataset.tigRulesNumericAllowEmpty
302
+ *
303
+ * @param {DOMStringMap} dataset
304
+ * @param {HTMLInputElement|HTMLTextAreaElement} _el
305
+ * @returns {import("../text-input-guard.js").Rule|null}
306
+ */
307
+ function fromDataset(dataset: DOMStringMap, _el: HTMLInputElement | HTMLTextAreaElement): Rule | null;
308
+ }
309
+ /**
310
+ * numeric ルールのオプション
311
+ */
312
+ type NumericRuleOptions = {
238
313
  /**
239
- * - selectionStart
314
+ * - 全角数字/記号を許可して半角へ正規化する
240
315
  */
241
- start: number | null;
316
+ allowFullWidth?: boolean;
242
317
  /**
243
- * - selectionEnd
318
+ * - マイナス記号を許可する(先頭のみ)
244
319
  */
245
- end: number | null;
320
+ allowMinus?: boolean;
246
321
  /**
247
- * - selectionDirection
322
+ * - 小数点を許可する(1つだけ)
248
323
  */
249
- direction: "forward" | "backward" | "none" | null;
324
+ allowDecimal?: boolean;
325
+ /**
326
+ * - 空文字を許可するか
327
+ */
328
+ allowEmpty?: boolean;
250
329
  };
330
+
251
331
  /**
252
- * revert要求(入力を巻き戻す指示)
332
+ * digits ルールを生成する
333
+ * @param {DigitsRuleOptions} [options]
334
+ * @returns {import("../text-input-guard.js").Rule}
253
335
  */
254
- type RevertRequest = {
336
+ declare function digits(options?: DigitsRuleOptions): Rule;
337
+ declare namespace digits {
338
+ /**
339
+ * datasetから digits ルールを生成する
340
+ * - data-tig-rules-digits が無ければ null
341
+ * - オプションは data-tig-rules-digits-xxx から読む
342
+ *
343
+ * 対応する data 属性(dataset 名)
344
+ * - data-tig-rules-digits -> dataset.tigRulesDigits
345
+ * - data-tig-rules-digits-int -> dataset.tigRulesDigitsInt
346
+ * - data-tig-rules-digits-frac -> dataset.tigRulesDigitsFrac
347
+ * - data-tig-rules-digits-count-leading-zeros -> dataset.tigRulesDigitsCountLeadingZeros
348
+ * - data-tig-rules-digits-fix-int-on-blur -> dataset.tigRulesDigitsFixIntOnBlur
349
+ * - data-tig-rules-digits-fix-frac-on-blur -> dataset.tigRulesDigitsFixFracOnBlur
350
+ * - data-tig-rules-digits-overflow-input-int -> dataset.tigRulesDigitsOverflowInputInt
351
+ * - data-tig-rules-digits-overflow-input-frac -> dataset.tigRulesDigitsOverflowInputFrac
352
+ * - data-tig-rules-digits-force-frac-on-blur -> dataset.tigRulesDigitsForceFracOnBlur
353
+ *
354
+ * @param {DOMStringMap} dataset
355
+ * @param {HTMLInputElement|HTMLTextAreaElement} _el
356
+ * @returns {import("../text-input-guard.js").Rule|null}
357
+ */
358
+ function fromDataset(dataset: DOMStringMap, _el: HTMLInputElement | HTMLTextAreaElement): Rule | null;
359
+ }
360
+ /**
361
+ * digits ルールのオプション
362
+ */
363
+ type DigitsRuleOptions = {
255
364
  /**
256
- * - ルール名や理由(例: "digits.int_overflow")
365
+ * - 整数部の最大桁数(省略可)
257
366
  */
258
- reason: string;
367
+ int?: number;
259
368
  /**
260
- * - デバッグ用の詳細
369
+ * - 小数部の最大桁数(省略可)
261
370
  */
262
- detail?: any;
371
+ frac?: number;
372
+ /**
373
+ * - 整数部の先頭ゼロを桁数に含める
374
+ */
375
+ countLeadingZeros?: boolean;
376
+ /**
377
+ * - blur時の整数部補正
378
+ */
379
+ fixIntOnBlur?: "none" | "truncateLeft" | "truncateRight" | "clamp";
380
+ /**
381
+ * - blur時の小数部補正
382
+ */
383
+ fixFracOnBlur?: "none" | "truncate" | "round";
384
+ /**
385
+ * - 入力中:整数部が最大桁を超える入力をブロックする
386
+ */
387
+ overflowInputInt?: "none" | "block";
388
+ /**
389
+ * - 入力中:小数部が最大桁を超える入力をブロックする
390
+ */
391
+ overflowInputFrac?: "none" | "block";
392
+ /**
393
+ * - blur時に小数部を必ず表示(frac桁まで0埋め)
394
+ */
395
+ forceFracOnBlur?: boolean;
263
396
  };
264
397
 
265
- export { attach, attachAll };
266
- export type { AttachOptions, ElementKind, Guard, GuardContext, GuardGroup, PhaseName, RevertRequest, Rule, SelectionState, SeparateValueOptions, SetValueInput, SetValueMode, TigError };
398
+ /**
399
+ * The script is part of TextInputGuard.
400
+ *
401
+ * AUTHOR:
402
+ * natade-jp (https://github.com/natade-jp)
403
+ *
404
+ * LICENSE:
405
+ * The MIT license https://opensource.org/licenses/MIT
406
+ */
407
+ /**
408
+ * カンマ付与ルール
409
+ * - blur時のみ整数部に3桁区切りカンマを付与する
410
+ * @returns {import("../text-input-guard.js").Rule}
411
+ */
412
+ declare function comma(): Rule;
413
+ declare namespace comma {
414
+ /**
415
+ * datasetから comma ルールを生成する
416
+ * - data-tig-rules-comma が無ければ null
417
+ *
418
+ * 対応する data 属性(dataset 名)
419
+ * - data-tig-rules-comma -> dataset.tigRulesComma
420
+ *
421
+ * @param {DOMStringMap} dataset
422
+ * @param {HTMLInputElement|HTMLTextAreaElement} _el
423
+ * @returns {import("../text-input-guard.js").Rule|null}
424
+ */
425
+ function fromDataset(dataset: DOMStringMap, _el: HTMLInputElement | HTMLTextAreaElement): Rule | null;
426
+ }
427
+
428
+ /**
429
+ * kana ルールのオプション
430
+ * @typedef {Object} KanaRuleOptions
431
+ * @property {"katakana-full"|"katakana-half"|"hiragana"} [target="katakana-full"] - 統一先
432
+ * @property {boolean} [nfkc=true] - 事前に Unicode NFKC 正規化を行う(合体文字などを正規化)
433
+ */
434
+ /**
435
+ * kana ルールを生成する
436
+ * @param {KanaRuleOptions} [options]
437
+ * @returns {import("../text-input-guard.js").Rule}
438
+ */
439
+ declare function kana(options?: KanaRuleOptions): Rule;
440
+ declare namespace kana {
441
+ /**
442
+ * datasetから kana ルールを生成する
443
+ * - data-tig-rules-kana が無ければ null
444
+ * - オプションは data-tig-rules-kana-xxx から読む
445
+ *
446
+ * 対応する data 属性(dataset 名)
447
+ * - data-tig-rules-kana -> dataset.tigRulesKana
448
+ * - data-tig-rules-kana-target -> dataset.tigRulesKanaTarget
449
+ * - data-tig-rules-kana-nfkc -> dataset.tigRulesKanaNfkc
450
+ *
451
+ * @param {DOMStringMap} dataset
452
+ * @param {HTMLInputElement|HTMLTextAreaElement} _el
453
+ * @returns {import("../text-input-guard.js").Rule|null}
454
+ */
455
+ function fromDataset(dataset: DOMStringMap, _el: HTMLInputElement | HTMLTextAreaElement): Rule | null;
456
+ }
457
+ /**
458
+ * kana ルールのオプション
459
+ */
460
+ type KanaRuleOptions = {
461
+ /**
462
+ * - 統一先
463
+ */
464
+ target?: "katakana-full" | "katakana-half" | "hiragana";
465
+ /**
466
+ * - 事前に Unicode NFKC 正規化を行う(合体文字などを正規化)
467
+ */
468
+ nfkc?: boolean;
469
+ };
470
+
471
+ /**
472
+ * ascii ルールのオプション
473
+ * @typedef {Object} AsciiRuleOptions
474
+ * @property {"none"|"upper"|"lower"} [case] - 英字の大文字/小文字統一
475
+ */
476
+ /**
477
+ * ascii ルールを生成する
478
+ * - 全角英数字・記号・全角スペースを半角へ正規化する
479
+ * - 必要に応じて英字を大文字/小文字へ統一
480
+ *
481
+ * @param {AsciiRuleOptions} [options]
482
+ * @returns {import("../text-input-guard.js").Rule}
483
+ */
484
+ declare function ascii(options?: AsciiRuleOptions): Rule;
485
+ declare namespace ascii {
486
+ /**
487
+ * datasetから ascii ルールを生成する
488
+ *
489
+ * 対応する data 属性
490
+ * - data-tig-rules-ascii
491
+ * - data-tig-rules-ascii-case ("none" | "upper" | "lower")
492
+ *
493
+ * @param {DOMStringMap} dataset
494
+ * @param {HTMLInputElement|HTMLTextAreaElement} _el
495
+ * @returns {import("../text-input-guard.js").Rule|null}
496
+ */
497
+ function fromDataset(dataset: DOMStringMap, _el: HTMLInputElement | HTMLTextAreaElement): Rule | null;
498
+ }
499
+ /**
500
+ * ascii ルールのオプション
501
+ */
502
+ type AsciiRuleOptions = {
503
+ /**
504
+ * - 英字の大文字/小文字統一
505
+ */
506
+ case?: "none" | "upper" | "lower";
507
+ };
508
+
509
+ /**
510
+ * filter ルールを生成する
511
+ * - mode="drop": 不要文字を落とすだけ
512
+ * - mode="error": 文字は落とさず validate でエラーを積む
513
+ *
514
+ * @param {FilterRuleOptions} [options]
515
+ * @returns {import("../text-input-guard.js").Rule}
516
+ */
517
+ declare function filter(options?: FilterRuleOptions): Rule;
518
+ declare namespace filter {
519
+ /**
520
+ * datasetから filter ルールを生成する
521
+ * - data-tig-rules-filter が無ければ null
522
+ *
523
+ * 対応する data 属性(dataset 名)
524
+ * - data-tig-rules-filter -> dataset.tigRulesFilter
525
+ * - data-tig-rules-filter-mode -> dataset.tigRulesFilterMode ("drop"|"error")
526
+ * - data-tig-rules-filter-category -> dataset.tigRulesFilterCategory ("a,b,c")
527
+ * - data-tig-rules-filter-allow -> dataset.tigRulesFilterAllow
528
+ * - data-tig-rules-filter-allow-flags -> dataset.tigRulesFilterAllowFlags
529
+ * - data-tig-rules-filter-deny -> dataset.tigRulesFilterDeny
530
+ * - data-tig-rules-filter-deny-flags -> dataset.tigRulesFilterDenyFlags
531
+ *
532
+ * @param {DOMStringMap} dataset
533
+ * @param {HTMLInputElement|HTMLTextAreaElement} _el
534
+ * @returns {import("../text-input-guard.js").Rule|null}
535
+ */
536
+ function fromDataset(dataset: DOMStringMap, _el: HTMLInputElement | HTMLTextAreaElement): Rule | null;
537
+ }
538
+ /**
539
+ * filter ルールのカテゴリ名
540
+ *
541
+ * - "digits" : ASCII 数字 (0-9)
542
+ * - "alpha-upper" : ASCII 英字大文字 (A-Z)
543
+ * - "alpha-lower" : ASCII 英字小文字 (a-z)
544
+ * - "ascii" : ASCII 可視文字 + スペース含む (U+0020–U+007E)
545
+ * - "hiragana" : ひらがな (U+3040–U+309F)
546
+ * - "katakana-full" : 全角カタカナ (U+30A0–U+30FF)
547
+ * - "katakana-half" : 半角カタカナ (U+FF65–U+FF9F)
548
+ * - "bmp-only" : BMP のみ許可(U+0000–U+FFFF、サロゲートペア、補助平面禁止)
549
+ * - "sjis-only" : 正規 Shift_JIS(JIS X 0208 + 1バイト領域)のみ許可
550
+ * - "cp932-only" : Windows-31J (CP932) でエンコード可能な文字のみ許可
551
+ * - "single-codepoint-only" : 単一コードポイントのみ許可(結合文字や異体字セレクタを含まない)
552
+ */
553
+ type FilterCategory = "digits" | "alpha-upper" | "alpha-lower" | "ascii" | "hiragana" | "katakana-full" | "katakana-half" | "bmp-only" | "sjis-only" | "cp932-only" | "single-codepoint-only";
554
+ /**
555
+ * filter ルールの動作モード
556
+ */
557
+ type FilterMode = "drop" | "error";
558
+ /**
559
+ * filter ルールのオプション
560
+ * - category は和集合で扱う(複数指定OK)
561
+ * - allow は追加許可(和集合)
562
+ * - deny は除外(差集合)
563
+ *
564
+ * allowed = (category の和集合 ∪ allow) − deny
565
+ */
566
+ type FilterRuleOptions = {
567
+ /**
568
+ * - drop: 不要文字を削除 / error: 削除せずエラーを積む
569
+ */
570
+ mode?: FilterMode;
571
+ /**
572
+ * - カテゴリ(配列)
573
+ */
574
+ category?: FilterCategory[];
575
+ /**
576
+ * - 追加で許可する正規表現(1文字にマッチさせる想定)
577
+ */
578
+ allow?: RegExp | string;
579
+ /**
580
+ * - allow が文字列のときの flags("iu" など。g/y は無視)
581
+ */
582
+ allowFlags?: string;
583
+ /**
584
+ * - 除外する正規表現(1文字にマッチさせる想定)
585
+ */
586
+ deny?: RegExp | string;
587
+ /**
588
+ * - deny が文字列のときの flags("iu" など。g/y は無視)
589
+ */
590
+ denyFlags?: string;
591
+ };
592
+
593
+ /**
594
+ * length ルールを生成する
595
+ * @param {LengthRuleOptions} [options]
596
+ * @returns {import("../text-input-guard.js").Rule}
597
+ */
598
+ declare function length(options?: LengthRuleOptions): Rule;
599
+ declare namespace length {
600
+ /**
601
+ * datasetから length ルールを生成する
602
+ * - data-tig-rules-length が無ければ null
603
+ * - オプションは data-tig-rules-length-xxx から読む
604
+ *
605
+ * 対応する data 属性(dataset 名)
606
+ * - data-tig-rules-length -> dataset.tigRulesLength
607
+ * - data-tig-rules-length-max -> dataset.tigRulesLengthMax
608
+ * - data-tig-rules-length-overflow-input -> dataset.tigRulesLengthOverflowInput
609
+ * - data-tig-rules-length-unit -> dataset.tigRulesLengthUnit
610
+ *
611
+ * @param {DOMStringMap} dataset
612
+ * @param {HTMLInputElement|HTMLTextAreaElement} _el
613
+ * @returns {import("../text-input-guard.js").Rule|null}
614
+ */
615
+ function fromDataset(dataset: DOMStringMap, _el: HTMLInputElement | HTMLTextAreaElement): Rule | null;
616
+ }
617
+ /**
618
+ * length ルールのオプション
619
+ */
620
+ type LengthRuleOptions = {
621
+ /**
622
+ * - 最大長(グラフェム数)。未指定なら制限なし
623
+ */
624
+ max?: number;
625
+ /**
626
+ * - 入力中に最大長を超えたときの挙動
627
+ */
628
+ overflowInput?: "block" | "error";
629
+ /**
630
+ * - 長さの単位
631
+ *
632
+ * block : 最大長を超える部分を切る
633
+ * error : エラーを積むだけ(値は変更しない)
634
+ */
635
+ unit?: "grapheme" | "utf-16" | "utf-32";
636
+ };
637
+
638
+ /**
639
+ * The script is part of TextInputGuard.
640
+ *
641
+ * AUTHOR:
642
+ * natade-jp (https://github.com/natade-jp)
643
+ *
644
+ * LICENSE:
645
+ * The MIT license https://opensource.org/licenses/MIT
646
+ */
647
+ /**
648
+ * prefix ルールのオプション
649
+ * @typedef {Object} PrefixRuleOptions
650
+ * @property {string} text - 先頭に付ける文字列
651
+ * @property {boolean} [showWhenEmpty=false] - 値が空でも表示するか
652
+ */
653
+ /**
654
+ * 先頭装飾(prefix)ルール
655
+ * - 表示用として先頭に文字列を付与する
656
+ * - 手動入力された同文字列は normalizeStructure で除去する
657
+ *
658
+ * @param {PrefixRuleOptions} options
659
+ * @returns {import("../text-input-guard.js").Rule}
660
+ */
661
+ declare function prefix(options: PrefixRuleOptions): Rule;
662
+ declare namespace prefix {
663
+ /**
664
+ * datasetから prefix ルールを生成する
665
+ * - data-tig-rules-prefix が無ければ null
666
+ *
667
+ * 対応する data 属性(dataset 名)
668
+ * - data-tig-rules-prefix -> dataset.tigRulesPrefix
669
+ * - data-tig-rules-prefix-text -> dataset.tigRulesPrefixText
670
+ * - data-tig-rules-prefix-show-when-empty -> dataset.tigRulesPrefixShowWhenEmpty
671
+ *
672
+ * @param {DOMStringMap} dataset
673
+ * @param {HTMLInputElement|HTMLTextAreaElement} _el
674
+ * @returns {import("../text-input-guard.js").Rule|null}
675
+ */
676
+ function fromDataset(dataset: DOMStringMap, _el: HTMLInputElement | HTMLTextAreaElement): Rule | null;
677
+ }
678
+ /**
679
+ * prefix ルールのオプション
680
+ */
681
+ type PrefixRuleOptions = {
682
+ /**
683
+ * - 先頭に付ける文字列
684
+ */
685
+ text: string;
686
+ /**
687
+ * - 値が空でも表示するか
688
+ */
689
+ showWhenEmpty?: boolean;
690
+ };
691
+
692
+ /**
693
+ * The script is part of TextInputGuard.
694
+ *
695
+ * AUTHOR:
696
+ * natade-jp (https://github.com/natade-jp)
697
+ *
698
+ * LICENSE:
699
+ * The MIT license https://opensource.org/licenses/MIT
700
+ */
701
+ /**
702
+ * suffix ルールのオプション
703
+ * @typedef {Object} SuffixRuleOptions
704
+ * @property {string} text - 末尾に付ける文字列
705
+ * @property {boolean} [showWhenEmpty=false] - 値が空でも表示するか
706
+ */
707
+ /**
708
+ * 末尾装飾(suffix)ルール
709
+ * - 表示用として末尾に文字列を付与する
710
+ * - 手動入力された同文字列は normalizeStructure で除去する
711
+ *
712
+ * @param {SuffixRuleOptions} options
713
+ * @returns {import("../text-input-guard.js").Rule}
714
+ */
715
+ declare function suffix(options: SuffixRuleOptions): Rule;
716
+ declare namespace suffix {
717
+ /**
718
+ * datasetから suffix ルールを生成する
719
+ * - data-tig-rules-suffix が無ければ null
720
+ *
721
+ * 対応する data 属性(dataset 名)
722
+ * - data-tig-rules-suffix -> dataset.tigRulesSuffix
723
+ * - data-tig-rules-suffix-text -> dataset.tigRulesSuffixText
724
+ * - data-tig-rules-suffix-show-when-empty -> dataset.tigRulesSuffixShowWhenEmpty
725
+ *
726
+ * @param {DOMStringMap} dataset
727
+ * @param {HTMLInputElement|HTMLTextAreaElement} _el
728
+ * @returns {import("../text-input-guard.js").Rule|null}
729
+ */
730
+ function fromDataset(dataset: DOMStringMap, _el: HTMLInputElement | HTMLTextAreaElement): Rule | null;
731
+ }
732
+ /**
733
+ * suffix ルールのオプション
734
+ */
735
+ type SuffixRuleOptions = {
736
+ /**
737
+ * - 末尾に付ける文字列
738
+ */
739
+ text: string;
740
+ /**
741
+ * - 値が空でも表示するか
742
+ */
743
+ showWhenEmpty?: boolean;
744
+ };
745
+
746
+ /**
747
+ * The script is part of TextInputGuard.
748
+ *
749
+ * AUTHOR:
750
+ * natade-jp (https://github.com/natade-jp)
751
+ *
752
+ * LICENSE:
753
+ * The MIT license https://opensource.org/licenses/MIT
754
+ */
755
+ /**
756
+ * トリムするルール
757
+ * @returns {import("../text-input-guard.js").Rule}
758
+ */
759
+ declare function trim(): Rule;
760
+ declare namespace trim {
761
+ /**
762
+ * datasetから trim ルールを生成する
763
+ * - data-tig-rules-trim が無ければ null
764
+ *
765
+ * 対応する data 属性(dataset 名)
766
+ * - data-tig-rules-trim -> dataset.tigRulesTrim
767
+ *
768
+ * @param {DOMStringMap} dataset
769
+ * @param {HTMLInputElement|HTMLTextAreaElement} _el
770
+ * @returns {import("../text-input-guard.js").Rule|null}
771
+ */
772
+ function fromDataset(dataset: DOMStringMap, _el: HTMLInputElement | HTMLTextAreaElement): Rule | null;
773
+ }
774
+
775
+ declare function autoAttach(root?: Document | DocumentFragment | ShadowRoot | Element): GuardGroup;
776
+ declare namespace rules {
777
+ export { numeric };
778
+ export { digits };
779
+ export { comma };
780
+ export { kana };
781
+ export { ascii };
782
+ export { filter };
783
+ export { length };
784
+ export { prefix };
785
+ export { suffix };
786
+ export { trim };
787
+ }
788
+ /**
789
+ * バージョン(ビルド時に置換したいならここを差し替える)
790
+ * 例: rollup replace で "__VERSION__" を package.json の version に置換
791
+ */
792
+ declare const version: any;
793
+
794
+ export { ascii, attach, attachAll, autoAttach, comma, digits, filter, kana, length, numeric, prefix, rules, suffix, trim, version };