Skip to content

Commit

Permalink
Make content optional for presets in TypeScript types (#11730)
Browse files Browse the repository at this point in the history
* Update config.d.ts, Make array members partial in Config

Instead of `Partial<Array<Thing>>` have `Array<Partial<Thing>>`

* simplify types further

* update changelog

---------

Co-authored-by: Robin Malfait <[email protected]>
  • Loading branch information
wimbarelds and RobinMalfait authored Aug 1, 2023
1 parent a93c61f commit 0f0d060
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improve normalisation of `calc()`-like functions ([#11686](https://github.com/tailwindlabs/tailwindcss/pull/11686))
- Skip `calc()` normalisation in nested `theme()` calls ([#11705](https://github.com/tailwindlabs/tailwindcss/pull/11705))
- Fix incorrectly generated CSS when using square brackets inside arbitrary properties ([#11709](https://github.com/tailwindlabs/tailwindcss/pull/11709))
- Make `content` optional for presets in TypeScript types ([#11730](https://github.com/tailwindlabs/tailwindcss/pull/11730))

### Added

Expand Down
12 changes: 6 additions & 6 deletions types/config.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@ type PrefixConfig = string
type SeparatorConfig = string

// Safelist related config
type SafelistConfig = (string | { pattern: RegExp; variants?: string[] })[]
type SafelistConfig = string | { pattern: RegExp; variants?: string[] }

// Blocklist related config
type BlocklistConfig = string[]
type BlocklistConfig = string

// Presets related config
type PresetsConfig = Config[]
type PresetsConfig = Partial<Config>

// Future related config
type FutureConfigValues =
Expand Down Expand Up @@ -353,9 +353,9 @@ interface OptionalConfig {
important: Partial<ImportantConfig>
prefix: Partial<PrefixConfig>
separator: Partial<SeparatorConfig>
safelist: Partial<SafelistConfig>
blocklist: Partial<BlocklistConfig>
presets: Partial<PresetsConfig>
safelist: Array<SafelistConfig>
blocklist: Array<BlocklistConfig>
presets: Array<PresetsConfig>
future: Partial<FutureConfig>
experimental: Partial<ExperimentalConfig>
darkMode: Partial<DarkModeConfig>
Expand Down

0 comments on commit 0f0d060

Please sign in to comment.