@@ -170,14 +170,25 @@ export const gale = <T extends string>(
170170 return Object . assign ( useStyleEngine , { extend : makeComponentLevelStyleEngine } ) ;
171171} ;
172172
173- type GaleKeys < T extends string > = T | GaleBuiltinKey ;
174- interface GaleEngine < T extends string > extends GaleHook < T > {
173+ /**
174+ * Engine function created by {@link gale}
175+ *
176+ * Can either be used as a hook to get the `m` function, or use `.extend()`
177+ * to extend the styles for component-specific hook.
178+ */
179+ export interface GaleEngine < T extends string > extends GaleHook < T > {
180+ /** Extend the styles to get a component-specific hook */
175181 extend : < K extends string > ( componentStyles : Record < K , GriffelStyle > ) => GaleHook < K | T > ;
176182}
177- type GaleHook < T extends string > = ( ) => GaleFn < T > ;
178- type GaleFn < T extends string > = < K extends string > ( classes : GaleString < K , T > ) => string ;
183+ /** Wrapper to concatenate built-in style keys with project-specific style keys */
184+ export type GaleKeys < T extends string > = T | GaleBuiltinKey ;
185+ /** Hook to be called inside a component to get the `m` function. See {@link gale} */
186+ export type GaleHook < T extends string > = ( ) => GaleFn < T > ;
187+ /** The `m` function that turns a style string into class names */
188+ export type GaleFn < T extends string > = < K extends string > ( classes : GaleString < K , T > ) => string ;
179189
180- type GaleString < K extends string , T extends string > = K extends T
190+ /** Type-safe, space-separated style idents */
191+ export type GaleString < K extends string , T extends string > = K extends T
181192 ? K
182193 : K extends `${infer U } ${infer N } `
183194 ? U extends T
0 commit comments