Skip to content

Commit

Permalink
feat(core): add PresetFactoryAwaitable type to definePreset (#4349)
Browse files Browse the repository at this point in the history
  • Loading branch information
zyyv authored Dec 23, 2024
1 parent d5f016d commit 26145cd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/core/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { ContentOptions, FilterPattern, Preset, PresetFactory, PresetOrFactoryAwaitable, ResolvedConfig, Rule, Shortcut, ToArray, UserConfig, UserConfigDefaults, UserShortcuts } from './types'
import type { ContentOptions, FilterPattern, Preset, PresetFactory, PresetFactoryAwaitable, PresetOrFactoryAwaitable, ResolvedConfig, Rule, Shortcut, ToArray, UserConfig, UserConfigDefaults, UserShortcuts } from './types'
import { DEFAULT_LAYERS } from './constants'
import { extractorSplit } from './extractors'
import { clone, isStaticRule, mergeDeep, normalizeVariant, toArray, uniq, uniqueBy } from './utils'
Expand Down Expand Up @@ -293,6 +293,7 @@ function flatternFilterPattern(pattern?: FilterPattern): Array<string | RegExp>
}

export function definePreset<Options extends object | undefined = undefined, Theme extends object = object>(preset: PresetFactory<Theme, Options>): PresetFactory<Theme, Options>
export function definePreset<Options extends object | undefined = undefined, Theme extends object = object>(preset: PresetFactoryAwaitable<Theme, Options>): PresetFactoryAwaitable<Theme, Options>
export function definePreset<Theme extends object = object>(preset: Preset<Theme>): Preset<Theme>
export function definePreset(preset: any) {
return preset
Expand Down

0 comments on commit 26145cd

Please sign in to comment.