Skip to content

Commit

Permalink
fix(types): allow ResolvedTWConfig in templates
Browse files Browse the repository at this point in the history
  • Loading branch information
ineshbose committed Dec 20, 2023
1 parent 89c689c commit 228324e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions 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
Expand All @@ -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<TWConfig>, config: ExposeConfig, nuxt = useNuxt()) {
export default function createTemplates (resolvedConfig: Partial<TWConfig> | ResolvedTwConfig, config: ExposeConfig, nuxt = useNuxt()) {
const dtsContent: Array<string> = []

const populateMap = (obj: any, path: string[] = [], level = 1) => {
Expand Down
1 change: 1 addition & 0 deletions src/types.ts
@@ -1,4 +1,5 @@
export type TWConfig = import('tailwindcss').Config;
export type ResolvedTwConfig = ReturnType<typeof import('tailwindcss/resolveConfig')>
export type Arrayable<T> = T | Array<T>;
export type InjectPosition = 'first' | 'last' | number | { after: string };

Expand Down

0 comments on commit 228324e

Please sign in to comment.