@@ -225,16 +225,19 @@ declare function Watch(keys?: string | string[], immediate?: boolean): (target:
225225 */
226226declare const classes : ( input : unknown , smart ?: boolean ) => string ;
227227
228+ interface HTMLPlusElements {
229+ }
230+ type BreakpointConfig = {
231+ type : 'container' | 'media' ;
232+ min ?: number ;
233+ max ?: number ;
234+ } ;
228235/**
229236 * TODO
230237 */
231- interface Config {
238+ type Config < Namespace extends string , Breakpoints extends string > = {
232239 breakpoints ?: {
233- [ key : string ] : {
234- type : 'container' | 'media' ;
235- min ?: number ;
236- max ?: number ;
237- } ;
240+ [ key in Breakpoints ] : BreakpointConfig ;
238241 } ;
239242 event ?: {
240243 resolver ?: ( parameters : unknown ) => CustomEvent | undefined ;
@@ -243,26 +246,24 @@ interface Config {
243246 [ key : string ] : unknown ;
244247 } ;
245248 elements ?: {
246- [ key : string ] : {
249+ [ K in keyof HTMLPlusElements as K extends `${ Namespace } -${ string } ` ? K : never ] ? : {
247250 properties ?: {
248- [ key : string ] : {
249- default ?: unknown ;
251+ [ Prop in keyof HTMLPlusElements [ K ] [ 'properties' ] ] ? : {
252+ default ?: HTMLPlusElements [ K ] [ 'properties' ] [ Prop ] ;
250253 } ;
251254 } ;
252255 variants ?: {
253- [ key : string ] : {
254- properties : {
255- [ key : string ] : unknown ;
256- } ;
256+ [ M in HTMLPlusElements [ K ] [ 'properties' ] [ 'variant' ] ] ?: {
257+ properties ?: Partial < HTMLPlusElements [ K ] [ 'properties' ] > ;
257258 } ;
258259 } ;
259260 } ;
260261 } ;
261- }
262+ } ;
262263/**
263264 * TODO
264265 */
265- interface ConfigOptions {
266+ type ConfigOptions = {
266267 /**
267268 * TODO
268269 */
@@ -271,23 +272,23 @@ interface ConfigOptions {
271272 * TODO
272273 */
273274 override ?: boolean ;
274- }
275+ } ;
275276/**
276277 * TODO
277278 */
278- declare const getConfig : ( namespace : string ) => Config ;
279+ declare const getConfig : < N extends string , B extends string > ( namespace : N ) => Config < N , B > ;
279280/**
280281 * TODO
281282 */
282- declare const getConfigCreator : ( namespace : string ) => ( ) => Config ;
283+ declare const getConfigCreator : < N extends string , B extends string > ( namespace : N ) => ( ) => Config < N , B > ;
283284/**
284285 * TODO
285286 */
286- declare const setConfig : ( namespace : string , config : Config , options ?: ConfigOptions ) => void ;
287+ declare const setConfig : < N extends string , B extends string > ( namespace : N , config : Config < N , B > , options ?: ConfigOptions ) => void ;
287288/**
288289 * TODO
289290 */
290- declare const setConfigCreator : ( namespace : string ) => ( config : Config , options ?: ConfigOptions ) => void ;
291+ declare const setConfigCreator : < N extends string , B extends string > ( namespace : N ) => ( config : Config < N , B > , options ?: ConfigOptions ) => void ;
291292
292293type Direction = 'ltr' | 'rtl' ;
293294/**
@@ -382,4 +383,4 @@ type OverridableValue<Base, Overrides = unknown> = {
382383} ? never : Unlisted < Base > ) ;
383384
384385export { Bind , Consumer , Debounce , Direction$1 as Direction , Element$1 as Element , Event , Host , IsRTL , Listen , Method , Overrides , Property , Provider , Query , QueryAll , Slots$1 as Slots , State , Style , Variant , Watch , _internal_a_ , _internal_h_ , _internal_s_ , classes , direction , dispatch , getConfig , getConfigCreator , host , isCSSColor , isCSSUnit , isRTL , off , on , query , queryAll , setConfig , setConfigCreator , slots , toUnit } ;
385- export type { Config , ConfigOptions , EventEmitter , EventOptions , ListenOptions , OverridableValue , OverridesConfig , PropertyOptions } ;
386+ export type { Config , ConfigOptions , EventEmitter , EventOptions , HTMLPlusElements , ListenOptions , OverridableValue , OverridesConfig , PropertyOptions } ;
0 commit comments