Skip to content

Commit 0c9a41f

Browse files
authored
chore(types): loose color type for text component (vue-terminal#6)
1 parent d941f3d commit 0c9a41f

File tree

1 file changed

+5
-4
lines changed
  • packages/core/src/components

1 file changed

+5
-4
lines changed

packages/core/src/components/Text.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import {
66
defineComponent,
77
onUpdated,
88
} from '@vue/runtime-core'
9+
import type { LiteralUnion } from '../utils'
910
import type { Styles } from '../renderer/styles'
1011
import { scheduleUpdateSymbol } from '../injectionSymbols'
1112
import { colorize } from '../renderer/textColor'
@@ -17,8 +18,8 @@ export const defaultStyle: Styles = {
1718
}
1819

1920
export interface TuiTextProps {
20-
color?: ForegroundColor
21-
bgColor?: ForegroundColor
21+
color?: LiteralUnion<ForegroundColor, string>
22+
bgColor?: LiteralUnion<ForegroundColor, string>
2223
dimmed?: boolean
2324
bold?: boolean
2425
italic?: boolean
@@ -32,8 +33,8 @@ export const TuiText = defineComponent({
3233
name: 'TuiText',
3334

3435
props: {
35-
color: String as PropType<ForegroundColor>,
36-
bgColor: String as PropType<ForegroundColor>,
36+
color: String as PropType<LiteralUnion<ForegroundColor, string>>,
37+
bgColor: String as PropType<LiteralUnion<ForegroundColor, string>>,
3738
dimmed: Boolean,
3839
bold: Boolean,
3940
italic: Boolean,

0 commit comments

Comments
 (0)