diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.ts index d304e18..8d6b3b6 100644 --- a/packages/ui/src/index.ts +++ b/packages/ui/src/index.ts @@ -1,3 +1,4 @@ +import type { PluginCreator, PluginCreatorWithOptions } from "plugwind.js"; import * as Plugger from "./plugger"; import type { ClassName } from "./styles"; @@ -23,9 +24,11 @@ export type DarkMode = [DarkModeStrategy, DarkModeQuery]; export * from "./styles"; export * from "./colors"; -export const UI = Plugger.plugUI(); -export const UIColors = Plugger.plugColors(); -export const UILinks = Plugger.plugLinks(); -export const UIEdges = Plugger.plugEdges(); +export const UI: PluginCreatorWithOptions = Plugger.plugUI(); +export const UIColors: PluginCreator = Plugger.plugColors(); +export const UILinks: PluginCreatorWithOptions = + Plugger.plugLinks(); +export const UIEdges: PluginCreatorWithOptions = + Plugger.plugEdges(); export default UI; diff --git a/packages/ui/src/plugin.ts b/packages/ui/src/plugin.ts index f879cd3..56e5260 100644 --- a/packages/ui/src/plugin.ts +++ b/packages/ui/src/plugin.ts @@ -1,3 +1,4 @@ +import type { DeclarationBlock } from "plugwind.js"; import type { DarkModeConfig, PluginAPI } from "tailwindcss/types/config"; import type { ComponentList, @@ -5,6 +6,7 @@ import type { PropertyName, PropertyValue, RuleSet, + StyleCallback, StyleCallbacks, StyleValues, UtilityList, @@ -62,19 +64,25 @@ export abstract class Plugin implements PluginContract { return properties; } - protected stylizeUtility(utility: UtilityName, value: PropertyValue) { + protected stylizeUtility( + utility: UtilityName, + value: PropertyValue, + ): DeclarationBlock { return stylize_property(this.getPropertyOf(utility), value); } - protected stylizeUtilityCallback(utility: UtilityName) { + protected stylizeUtilityCallback(utility: UtilityName): StyleCallback { return stylize_property_callback(this.getPropertyOf(utility)); } - protected stylizeUtilities(utilities: UtilityName[], value: PropertyValue) { + protected stylizeUtilities( + utilities: UtilityName[], + value: PropertyValue, + ): DeclarationBlock { return stylize_properties(this.getPropertiesOf(utilities), value); } - protected stylizeUtilitiesCallback(utilities: UtilityName[]) { + protected stylizeUtilitiesCallback(utilities: UtilityName[]): StyleCallback { return stylize_properties_callback(this.getPropertiesOf(utilities)); }