From ace8fc1c004fa1154bc09fb33089272f23413aeb Mon Sep 17 00:00:00 2001 From: Benjamin Canac Date: Wed, 25 Oct 2023 12:17:13 +0200 Subject: [PATCH] fix(types): take user app config into account Fixes #858 --- src/runtime/types/avatar.d.ts | 3 ++- src/runtime/types/badge.d.ts | 7 ++++--- src/runtime/types/button.d.ts | 7 ++++--- src/runtime/types/form.d.ts | 2 +- 4 files changed, 11 insertions(+), 8 deletions(-) diff --git a/src/runtime/types/avatar.d.ts b/src/runtime/types/avatar.d.ts index a0c9d9ed..333e5744 100644 --- a/src/runtime/types/avatar.d.ts +++ b/src/runtime/types/avatar.d.ts @@ -1,7 +1,8 @@ import { avatar } from '../ui.config' import colors from '#ui-colors' +import type { AppConfig } from 'nuxt/schema' -export type AvatarSize = keyof typeof avatar.size +export type AvatarSize = keyof typeof avatar.size | keyof AppConfig['ui']['avatar']['size'] export type AvatarChipColor = 'gray' | typeof colors[number] export type AvatarChipPosition = keyof typeof avatar.chip.position diff --git a/src/runtime/types/badge.d.ts b/src/runtime/types/badge.d.ts index 5bfc5c29..9d5060bf 100644 --- a/src/runtime/types/badge.d.ts +++ b/src/runtime/types/badge.d.ts @@ -1,10 +1,11 @@ import { badge } from '../ui.config' import type { NestedKeyOf } from '.' import colors from '#ui-colors' +import type { AppConfig } from 'nuxt/schema' -export type BadgeSize = keyof typeof badge.size -export type BadgeColor = keyof typeof badge.color | typeof colors[number] -export type BadgeVariant = keyof typeof badge.variant | NestedKeyOf +export type BadgeSize = keyof typeof badge.size | keyof AppConfig['ui']['badge']['size'] +export type BadgeColor = keyof typeof badge.color | keyof AppConfig['ui']['badge']['color'] | typeof colors[number] +export type BadgeVariant = keyof typeof badge.variant | keyof AppConfig['ui']['badge']['variant'] | NestedKeyOf | NestedKeyOf export interface Badge { label?: string diff --git a/src/runtime/types/button.d.ts b/src/runtime/types/button.d.ts index 65ac2f67..a636ddfe 100644 --- a/src/runtime/types/button.d.ts +++ b/src/runtime/types/button.d.ts @@ -2,10 +2,11 @@ import type { Link } from './link' import { button } from '../ui.config' import type { NestedKeyOf } from '.' import colors from '#ui-colors' +import type { AppConfig } from 'nuxt/schema' -export type ButtonSize = keyof typeof button.size -export type ButtonColor = keyof typeof button.color | typeof colors[number] -export type ButtonVariant = keyof typeof button.variant | NestedKeyOf +export type ButtonSize = keyof typeof button.size | keyof AppConfig['ui']['button']['size'] +export type ButtonColor = keyof typeof button.color | keyof AppConfig['ui']['button']['color'] | typeof colors[number] +export type ButtonVariant = keyof typeof button.variant | keyof AppConfig['ui']['button']['variant'] | NestedKeyOf | NestedKeyOf export interface Button extends Link { type?: string diff --git a/src/runtime/types/form.d.ts b/src/runtime/types/form.d.ts index c9cc4055..c3e1507f 100644 --- a/src/runtime/types/form.d.ts +++ b/src/runtime/types/form.d.ts @@ -1,4 +1,4 @@ -import { Ref } from 'vue' +import type { Ref } from 'vue' export interface FormError { path: T