mirror of
https://github.com/tailwindlabs/tailwindcss.git
synced 2025-12-08 21:36:08 +00:00
Improve return value of resolveConfig, unwrap ResolvableTo (#9972)
* improve return value of `resolveConfig`, unwrap `ResolvableTo` * update changelog
This commit is contained in:
parent
cac5a28c41
commit
4f92e2ff5e
@ -19,6 +19,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||
- Fix `foo-[abc]/[def]` not being handled correctly ([#9866](https://github.com/tailwindlabs/tailwindcss/pull/9866))
|
||||
- Add container queries plugin to standalone CLI ([#9865](https://github.com/tailwindlabs/tailwindcss/pull/9865))
|
||||
- Support renaming of output files by `PostCSS` plugin. ([#9944](https://github.com/tailwindlabs/tailwindcss/pull/9944))
|
||||
- Improve return value of `resolveConfig`, unwrap `ResolvableTo` ([#9972](https://github.com/tailwindlabs/tailwindcss/pull/9972))
|
||||
|
||||
## [3.2.4] - 2022-11-11
|
||||
|
||||
|
||||
13
resolveConfig.d.ts
vendored
13
resolveConfig.d.ts
vendored
@ -1,3 +1,12 @@
|
||||
import type { Config } from './types/config'
|
||||
declare function resolveConfig(config: Config): Config
|
||||
import type { Config, ResolvableTo } from './types/config'
|
||||
|
||||
type UnwrapResolvables<T> = {
|
||||
[K in keyof T]: T[K] extends ResolvableTo<infer R> ? R : T[K]
|
||||
}
|
||||
|
||||
type ResolvedConfig<T extends Config> = Omit<T, 'theme'> & {
|
||||
theme: UnwrapResolvables<T['theme']>
|
||||
}
|
||||
|
||||
declare function resolveConfig<T extends Config>(config: T): ResolvedConfig<T>
|
||||
export = resolveConfig
|
||||
|
||||
2
types/config.d.ts
vendored
2
types/config.d.ts
vendored
@ -11,7 +11,7 @@ type KeyValuePair<K extends keyof any = string, V = string> = Record<K, V>
|
||||
interface RecursiveKeyValuePair<K extends keyof any = string, V = string> {
|
||||
[key: string]: V | RecursiveKeyValuePair<K, V>
|
||||
}
|
||||
type ResolvableTo<T> = T | ((utils: PluginUtils) => T)
|
||||
export type ResolvableTo<T> = T | ((utils: PluginUtils) => T)
|
||||
type CSSRuleObject = RecursiveKeyValuePair<string, null | string | string[]>
|
||||
|
||||
interface PluginUtils {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user