Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve types of the
tailwindcss/plugin
(#8400)
* improve types of the `tailwindcss/plugin` This also exposes/types the `plugin.withOptions` as described here: https://tailwindcss.com/docs/plugins#exposing-options * update changelog
- Loading branch information
1 parent
8164185
commit 83b4811
Showing
3 changed files
with
16 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,11 @@ | ||
import type { Config, PluginCreator } from './types/config' | ||
declare function createPlugin( | ||
plugin: PluginCreator, | ||
config?: Config | ||
): { handler: PluginCreator; config?: Config } | ||
export = createPlugin | ||
type Plugin = { | ||
withOptions<T>( | ||
plugin: (options: T) => PluginCreator, | ||
config?: (options: T) => Config | ||
): { (options: T): { handler: PluginCreator; config?: Config }; __isOptionsFunction: true } | ||
(plugin: PluginCreator, config?: Config): { handler: PluginCreator; config?: Config } | ||
} | ||
|
||
declare const plugin: Plugin | ||
export = plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters