Files
adf-codec/src/adf/mark-attributes.ts
T
2026-08-27 22:16:27 +02:00

20 lines
544 B
TypeScript

import type { AttributeVocabulary } from './attribute-vocabulary.ts'
export const markAttributes = {
border: { color: 'string', size: 'number' },
code: {},
em: {},
link: { href: 'string', title: 'string' },
strike: {},
strong: {},
subsup: { type: 'string' },
textColor: { color: 'string' },
underline: {},
} satisfies Readonly<Record<string, AttributeVocabulary>>
export type MarkType = keyof typeof markAttributes
export function isMarkType(type: string): type is MarkType {
return Object.hasOwn(markAttributes, type)
}