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
24
24
- Error when registering an invalid custom variant ([ #8345 ] ( https://github.com/tailwindlabs/tailwindcss/pull/8345 ) )
25
25
- Create tailwind.config.cjs file in ESM package when running init ([ #8363 ] ( https://github.com/tailwindlabs/tailwindcss/pull/8363 ) )
26
26
- 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 ) )
27
28
28
29
### Changed
29
30
Original file line number Diff line number Diff line change 1
1
import 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 {
297
297
e : ( className : string ) => string
298
298
}
299
299
export 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
+ ) [ ]
301
305
302
306
// Top level config related
303
307
interface RequiredConfig {
You can’t perform that action at this time.
0 commit comments