From 228324ecbee755ee2e18c0ed46c0b1f944ddd097 Mon Sep 17 00:00:00 2001 From: Inesh Bose <56732164+ineshbose@users.noreply.github.com> Date: Wed, 20 Dec 2023 23:03:49 +0000 Subject: [PATCH] fix(types): allow ResolvedTWConfig in templates --- src/templates.ts | 4 ++-- src/types.ts | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/templates.ts b/src/templates.ts index 9cd4cd44..3eab52bc 100644 --- a/src/templates.ts +++ b/src/templates.ts @@ -1,7 +1,7 @@ import { dirname, join } from 'pathe' import { useNuxt, addTemplate } from '@nuxt/kit' import { isJSObject, NON_ALPHANUMERIC_RE } from './utils' -import type { ExposeConfig, TWConfig } from './types' +import type { ExposeConfig, ResolvedTwConfig, TWConfig } from './types' /** * Creates MJS exports for properties of the config @@ -10,7 +10,7 @@ import type { ExposeConfig, TWConfig } from './types' * @param maxLevel maximum level of depth * @param nuxt nuxt app */ -export default function createTemplates (resolvedConfig: Partial, config: ExposeConfig, nuxt = useNuxt()) { +export default function createTemplates (resolvedConfig: Partial | ResolvedTwConfig, config: ExposeConfig, nuxt = useNuxt()) { const dtsContent: Array = [] const populateMap = (obj: any, path: string[] = [], level = 1) => { diff --git a/src/types.ts b/src/types.ts index a9d0bd5d..0b824ddc 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,4 +1,5 @@ export type TWConfig = import('tailwindcss').Config; +export type ResolvedTwConfig = ReturnType export type Arrayable = T | Array; export type InjectPosition = 'first' | 'last' | number | { after: string };