|
1 |
| -import { Context, Recogniser } from '../encoding/index'; |
2 |
| -import match, { Match } from '../match'; |
| 1 | +import type { Context, Recogniser } from '.'; |
| 2 | +import match, { type EncodingName, type Match } from '../match'; |
3 | 3 |
|
4 | 4 | /**
|
5 | 5 | * This class recognizes single-byte encodings. Because the encoding scheme is so
|
@@ -120,7 +120,7 @@ class sbcs implements Recogniser {
|
120 | 120 | return [];
|
121 | 121 | }
|
122 | 122 |
|
123 |
| - name(_input: Context): string { |
| 123 | + name(_input: Context): EncodingName { |
124 | 124 | return 'sbcs';
|
125 | 125 | }
|
126 | 126 |
|
@@ -342,7 +342,7 @@ export class ISO_8859_1 extends sbcs {
|
342 | 342 | ];
|
343 | 343 | }
|
344 | 344 |
|
345 |
| - name(input: Context): string { |
| 345 | + name(input: Context): EncodingName { |
346 | 346 | return input && input.c1Bytes ? 'windows-1252' : 'ISO-8859-1';
|
347 | 347 | }
|
348 | 348 | }
|
@@ -440,7 +440,7 @@ export class ISO_8859_2 extends sbcs {
|
440 | 440 | ];
|
441 | 441 | }
|
442 | 442 |
|
443 |
| - name(det: Context): string { |
| 443 | + name(det: Context): EncodingName { |
444 | 444 | return det && det.c1Bytes ? 'windows-1250' : 'ISO-8859-2';
|
445 | 445 | }
|
446 | 446 | }
|
@@ -488,7 +488,7 @@ export class ISO_8859_5 extends sbcs {
|
488 | 488 | ];
|
489 | 489 | }
|
490 | 490 |
|
491 |
| - name() { |
| 491 | + name(): EncodingName { |
492 | 492 | return 'ISO-8859-5';
|
493 | 493 | }
|
494 | 494 |
|
@@ -540,7 +540,7 @@ export class ISO_8859_6 extends sbcs {
|
540 | 540 | ];
|
541 | 541 | }
|
542 | 542 |
|
543 |
| - name() { |
| 543 | + name(): EncodingName { |
544 | 544 | return 'ISO-8859-6';
|
545 | 545 | }
|
546 | 546 |
|
@@ -592,7 +592,7 @@ export class ISO_8859_7 extends sbcs {
|
592 | 592 | ];
|
593 | 593 | }
|
594 | 594 |
|
595 |
| - name(det: Context): string { |
| 595 | + name(det: Context): EncodingName { |
596 | 596 | return det && det.c1Bytes ? 'windows-1253' : 'ISO-8859-7';
|
597 | 597 | }
|
598 | 598 |
|
@@ -664,7 +664,7 @@ export class ISO_8859_8 extends sbcs {
|
664 | 664 | ];
|
665 | 665 | }
|
666 | 666 |
|
667 |
| - name(det: Context): string { |
| 667 | + name(det: Context): EncodingName { |
668 | 668 | return det && det.c1Bytes ? 'windows-1255' : 'ISO-8859-8';
|
669 | 669 | }
|
670 | 670 |
|
@@ -716,7 +716,7 @@ export class ISO_8859_9 extends sbcs {
|
716 | 716 | ];
|
717 | 717 | }
|
718 | 718 |
|
719 |
| - name(det: Context): string { |
| 719 | + name(det: Context): EncodingName { |
720 | 720 | return det && det.c1Bytes ? 'windows-1254' : 'ISO-8859-9';
|
721 | 721 | }
|
722 | 722 |
|
@@ -768,7 +768,7 @@ export class windows_1251 extends sbcs {
|
768 | 768 | ];
|
769 | 769 | }
|
770 | 770 |
|
771 |
| - name() { |
| 771 | + name(): EncodingName { |
772 | 772 | return 'windows-1251';
|
773 | 773 | }
|
774 | 774 |
|
@@ -820,7 +820,7 @@ export class windows_1256 extends sbcs {
|
820 | 820 | ];
|
821 | 821 | }
|
822 | 822 |
|
823 |
| - name() { |
| 823 | + name(): EncodingName { |
824 | 824 | return 'windows-1256';
|
825 | 825 | }
|
826 | 826 |
|
@@ -872,7 +872,7 @@ export class KOI8_R extends sbcs {
|
872 | 872 | ];
|
873 | 873 | }
|
874 | 874 |
|
875 |
| - name() { |
| 875 | + name(): EncodingName { |
876 | 876 | return 'KOI8-R';
|
877 | 877 | }
|
878 | 878 |
|
|
0 commit comments