Skip to content

Commit

Permalink
🏷️ Fix type issues
Browse files Browse the repository at this point in the history
  • Loading branch information
siguici committed Aug 11, 2024
1 parent 887d588 commit 62fb311
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 deletions.
11 changes: 7 additions & 4 deletions packages/ui/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import type { PluginCreator, PluginCreatorWithOptions } from "plugwind.js";
import * as Plugger from "./plugger";
import type { ClassName } from "./styles";

Expand All @@ -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<UIOptions> = Plugger.plugUI();
export const UIColors: PluginCreator = Plugger.plugColors();
export const UILinks: PluginCreatorWithOptions<LinkOptions> =
Plugger.plugLinks();
export const UIEdges: PluginCreatorWithOptions<EdgeOptions> =
Plugger.plugEdges();

export default UI;
16 changes: 12 additions & 4 deletions packages/ui/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import type { DeclarationBlock } from "plugwind.js";
import type { DarkModeConfig, PluginAPI } from "tailwindcss/types/config";
import type {
ComponentList,
DarkMode,
PropertyName,
PropertyValue,
RuleSet,
StyleCallback,
StyleCallbacks,
StyleValues,
UtilityList,
Expand Down Expand Up @@ -62,19 +64,25 @@ export abstract class Plugin<T> implements PluginContract<T> {
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));
}

Expand Down

0 comments on commit 62fb311

Please sign in to comment.