@pandacss/types 0.0.0-dev-20240205145159 → 0.0.0-dev-20240205164423

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/hooks.d.ts +57 -37
  2. package/package.json +2 -2
package/dist/hooks.d.ts CHANGED
@@ -4,48 +4,12 @@ import type { HooksApiInterface } from './hooks-api'
4
4
  import type { LoggerInterface } from './logger'
5
5
  import type { ParserResultInterface } from './parser'
6
6
 
7
- type MaybeAsyncReturn<T = void> = Promise<T> | T
8
-
9
- interface TokenCssVarOptions {
10
- fallback?: string
11
- prefix?: string
12
- hash?: boolean
13
- }
14
-
15
- interface TokenCssVar {
16
- var: `--${string}`
17
- ref: string
18
- }
19
-
20
- export interface TokenConfigureOptions {
21
- formatTokenName?: (path: string[]) => string
22
- formatCssVar?: (path: string[], options: TokenCssVarOptions) => TokenCssVar
23
- }
24
-
25
- export interface TokenCreatedHookArgs {
26
- configure(opts: TokenConfigureOptions): void
27
- }
28
-
29
- export interface UtilityConfigureOptions {
30
- toHash?(path: string[], toHash: (str: string) => string): string
31
- }
32
-
33
- export interface UtilityCreatedHookArgs {
34
- configure(opts: UtilityConfigureOptions): void
35
- }
36
-
37
- export interface ConfigResolvedHookArgs {
38
- config: LoadConfigResult['config']
39
- path: string
40
- dependencies: string[]
41
- }
42
-
43
7
  export interface PandaHooks {
44
8
  /**
45
9
  * Called when the config is resolved, after all the presets are loaded and merged.
46
10
  * This is the first hook called, you can use it to tweak the config before the context is created.
47
11
  */
48
- 'config:resolved': (args: ConfigResolvedHookArgs) => MaybeAsyncReturn
12
+ 'config:resolved': (args: ConfigResolvedHookArgs) => MaybeAsyncReturn<void | ConfigResolvedHookArgs['config']>
49
13
  /**
50
14
  * Called when the token engine has been created
51
15
  */
@@ -92,3 +56,59 @@ export interface PandaHooks {
92
56
  content: string
93
57
  }) => string | void
94
58
  }
59
+
60
+ type MaybeAsyncReturn<T = void> = Promise<T> | T
61
+
62
+ interface TokenCssVarOptions {
63
+ fallback?: string
64
+ prefix?: string
65
+ hash?: boolean
66
+ }
67
+
68
+ interface TokenCssVar {
69
+ var: `--${string}`
70
+ ref: string
71
+ }
72
+
73
+ export interface TokenConfigureOptions {
74
+ formatTokenName?: (path: string[]) => string
75
+ formatCssVar?: (path: string[], options: TokenCssVarOptions) => TokenCssVar
76
+ }
77
+
78
+ export interface TokenCreatedHookArgs {
79
+ configure(opts: TokenConfigureOptions): void
80
+ }
81
+
82
+ export interface UtilityConfigureOptions {
83
+ toHash?(path: string[], toHash: (str: string) => string): string
84
+ }
85
+
86
+ export interface UtilityCreatedHookArgs {
87
+ configure(opts: UtilityConfigureOptions): void
88
+ }
89
+
90
+ interface ConfigResolvedHookUtils {
91
+ omit: <T, K extends keyof T | (string & {})>(obj: T, paths: K[]) => Omit<T, K>
92
+ traverse: TraverseFn
93
+ }
94
+
95
+ export interface ConfigResolvedHookArgs {
96
+ config: LoadConfigResult['config']
97
+ path: string
98
+ dependencies: string[]
99
+ utils: ConfigResolvedHookUtils
100
+ }
101
+
102
+ type CallbackFn = (args: CallbackItem) => void
103
+ type CallbackItem = { value: any; path: string; depth: number; parent: any[] | Record<string, unknown>; key: string }
104
+
105
+ interface TraverseFn {
106
+ (
107
+ obj: any,
108
+ callback: CallbackFn,
109
+ options?: {
110
+ separator: string
111
+ maxDepth?: number | undefined
112
+ },
113
+ ): void
114
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pandacss/types",
3
- "version": "0.0.0-dev-20240205145159",
3
+ "version": "0.0.0-dev-20240205164423",
4
4
  "description": "The types for css panda",
5
5
  "main": "dist/index.d.ts",
6
6
  "author": "Segun Adebayo <joseshegs@gmail.com>",
@@ -30,7 +30,7 @@
30
30
  "microdiff": "^1.3.2",
31
31
  "ncp": "^2.0.0",
32
32
  "pkg-types": "1.0.3",
33
- "@pandacss/extractor": "0.0.0-dev-20240205145159"
33
+ "@pandacss/extractor": "0.0.0-dev-20240205164423"
34
34
  },
35
35
  "scripts": {
36
36
  "dev": "tsx scripts/watch.ts",