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
2 people authored and thecrypticace committed Oct 23, 2023
1 parent 808c1f0 commit 38fd41e
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 @@ -16,6 +16,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))

## [3.3.3] - 2023-07-13

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 @@ -352,9 +352,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 38fd41e

Please sign in to comment.