Explain how to type plugin options

This commit is contained in:
Andrey Sitnik
2026-07-29 14:06:29 +00:00
parent 14f8d11a0c
commit c5e0bbb118
+5 -1
View File
@@ -108,7 +108,11 @@ In TypeScript, type the creator as `PluginCreator` so `postcss = true` is valid:
```ts
import type { PluginCreator } from 'postcss'
const plugin: PluginCreator<object> = (opts = {}) => {
export interface PluginNameOptions {
// Types for plugin options
}
const plugin: PluginCreator<PluginNameOptions> = (opts = {}) => {
return {
postcssPlugin: 'PLUGIN NAME'
// Plugin listeners