From 81170591119ee556a8fc504ed7599045cd5d80c3 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Tue, 12 Nov 2024 22:57:55 +0000 Subject: [PATCH] fix(unplugin): add declared types for `#build/app.config` --- app.config.d.ts | 6 ++++++ package.json | 4 +++- src/unplugin.ts | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) create mode 100644 app.config.d.ts diff --git a/app.config.d.ts b/app.config.d.ts new file mode 100644 index 00000000..a32d632a --- /dev/null +++ b/app.config.d.ts @@ -0,0 +1,6 @@ +declare module '#build/app.config' { + import type { AppConfigUI } from '@nuxt/ui/unplugin' + + const _default: { ui?: AppConfigUI } + export default _default +} diff --git a/package.json b/package.json index 922f797d..c03e252f 100644 --- a/package.json +++ b/package.json @@ -37,7 +37,8 @@ } }, "imports": { - "#build/ui/*": "./.nuxt/ui/*.ts" + "#build/ui/*": "./.nuxt/ui/*.ts", + "#build/app-config": "./app-config.d.ts" }, "bin": { "nuxt-ui": "./cli/index.mjs" @@ -47,6 +48,7 @@ "types": "./dist/types.d.ts", "files": [ ".nuxt/ui", + "app-config.d.ts", "dist", "cli", "vue-plugin.d.ts" diff --git a/src/unplugin.ts b/src/unplugin.ts index ad604351..d0cc9571 100644 --- a/src/unplugin.ts +++ b/src/unplugin.ts @@ -24,7 +24,7 @@ import type { DeepPartial } from './runtime/types/utils' type NeutralColor = 'slate' | 'gray' | 'zinc' | 'neutral' | 'stone' type Color = Exclude | (string & {}) -type AppConfigUI = { +export type AppConfigUI = { // TODO: add type hinting for colors from `options.theme.colors` colors?: Record & { neutral?: NeutralColor } icons?: Partial