Skip to content

Commit

Permalink
chore: add Locale type
Browse files Browse the repository at this point in the history
  • Loading branch information
SSShooter committed Aug 18, 2024
1 parent c649222 commit 5b56c90
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/i18n.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ type LangPack = {
clickTips: string
summary: string
}
export type Locale = 'cn' | 'zh_CN' | 'zh_TW' | 'en' | 'ru' | 'ja' | 'pt' | 'it' | 'es'
const cn = {
addChild: '插入子节点',
addParent: '插入父节点',
Expand All @@ -24,7 +25,7 @@ const cn = {
clickTips: '请点击目标节点',
summary: '摘要',
}
const i18n: Record<string, LangPack> = {
const i18n: Record<Locale, LangPack> = {
cn,
zh_CN: cn,
zh_TW: {
Expand Down
3 changes: 2 additions & 1 deletion src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import type { Arrow } from '../arrow'
import type { Summary, SummarySvgGroup } from '../summary'
import type SelectionArea from '@viselect/vanilla'
import type { MainLineParams, SubLineParams } from '../utils/generateBranch'
import type { Locale } from '../i18n'
export * from '../methods'

type Before = Partial<{
Expand Down Expand Up @@ -113,7 +114,7 @@ type PathString = string
export type Options = {
el: string | HTMLElement
direction?: number
locale?: string
locale?: Locale
draggable?: boolean
editable?: boolean
contextMenu?: boolean
Expand Down

0 comments on commit 5b56c90

Please sign in to comment.