File tree Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Expand file tree Collapse file tree 3 files changed +16
-6
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
2424- Error when registering an invalid custom variant ([ #8345 ] ( https://github.com/tailwindlabs/tailwindcss/pull/8345 ) )
2525- Create tailwind.config.cjs file in ESM package when running init ([ #8363 ] ( https://github.com/tailwindlabs/tailwindcss/pull/8363 ) )
2626- Fix ` matchVariants ` that use at-rules and placeholders ([ #8392 ] ( https://github.com/tailwindlabs/tailwindcss/pull/8392 ) )
27+ - Improve types of the ` tailwindcss/plugin ` ([ #8400 ] ( https://github.com/tailwindlabs/tailwindcss/pull/8400 ) )
2728
2829### Changed
2930
Original file line number Diff line number Diff line change 11import type { Config , PluginCreator } from './types/config'
2- declare function createPlugin (
3- plugin : PluginCreator ,
4- config ?: Config
5- ) : { handler : PluginCreator ; config ?: Config }
6- export = createPlugin
2+ type Plugin = {
3+ withOptions < T > (
4+ plugin : ( options : T ) => PluginCreator ,
5+ config ?: ( options : T ) => Config
6+ ) : { ( options : T ) : { handler : PluginCreator ; config ?: Config } ; __isOptionsFunction : true }
7+ ( plugin : PluginCreator , config ?: Config ) : { handler : PluginCreator ; config ?: Config }
8+ }
9+
10+ declare const plugin : Plugin
11+ export = plugin
Original file line number Diff line number Diff line change @@ -297,7 +297,11 @@ export interface PluginAPI {
297297 e : ( className : string ) => string
298298}
299299export type PluginCreator = ( api : PluginAPI ) => void
300- export type PluginsConfig = ( PluginCreator | { handler : PluginCreator ; config ?: Config } ) [ ]
300+ export type PluginsConfig = (
301+ | PluginCreator
302+ | { handler : PluginCreator ; config ?: Config }
303+ | { ( options : any ) : { handler : PluginCreator ; config ?: Config } ; __isOptionsFunction : true }
304+ ) [ ]
301305
302306// Top level config related
303307interface RequiredConfig {
You can’t perform that action at this time.
0 commit comments