mirror of
https://github.com/kotaindah55/extended-markdown-syntax.git
synced 2026-07-22 05:38:06 +00:00
style: use Record instead of using index signature
This commit is contained in:
parent
5d3c4af06b
commit
96038c809b
2 changed files with 4 additions and 4 deletions
|
|
@ -3,7 +3,7 @@ import { MainFormat, Token } from "src/types";
|
|||
import { ParserState } from "src/editor-mode/parser";
|
||||
|
||||
export class TokenQueue {
|
||||
open: { [F in MainFormat]: Token | null } = {
|
||||
open: Record<MainFormat, Token | null> = {
|
||||
[Format.INSERTION]: null,
|
||||
[Format.SPOILER]: null,
|
||||
[Format.SUPERSCRIPT]: null,
|
||||
|
|
@ -14,14 +14,14 @@ export class TokenQueue {
|
|||
* Content token is generated and pushed automatically
|
||||
* as its opening delimiter enter the queue.
|
||||
*/
|
||||
content: { [F in MainFormat]: Token | null } = {
|
||||
content: Record<MainFormat, Token | null> = {
|
||||
[Format.INSERTION]: null,
|
||||
[Format.SPOILER]: null,
|
||||
[Format.SUPERSCRIPT]: null,
|
||||
[Format.SUBSCRIPT]: null,
|
||||
[Format.HIGHLIGHT]: null,
|
||||
};
|
||||
close: { [F in MainFormat]: Token | null } = {
|
||||
close: Record<MainFormat, Token | null> = {
|
||||
[Format.INSERTION]: null,
|
||||
[Format.SPOILER]: null,
|
||||
[Format.SUPERSCRIPT]: null,
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
import { Format } from "src/enums";
|
||||
import { MainFormat } from "src/types";
|
||||
|
||||
export const FormatRules: { [P in MainFormat]: {char: string, length: number, exactLen: boolean, allowSpace: boolean, getEl: () => Element} } = {
|
||||
export const FormatRules: Record<MainFormat, { char: string, length: number, exactLen: boolean, allowSpace: boolean, getEl: () => Element }> = {
|
||||
[Format.INSERTION]: {
|
||||
char: "+",
|
||||
length: 2,
|
||||
|
|
|
|||
Loading…
Reference in a new issue