AttributeValue:
string
|number
|boolean
|undefined
ConfigValidator<
T
>:{ [K in keyof T]?: WritableWithDefaultOptions<T[K]> }
• T extends object
ContextWidget<
W
>:Pick
<W
,"actions"
|"api"
|"directives"
|"state$"
|"stores"
>
• W extends Widget
Directive<
T
,U
>: (node
,args
) =>void
|object
• T = void
• U extends SSRHTMLElement
= SSRHTMLElement
• node: U
• args: T
void
| object
DirectiveAndParam<
T
,U
>: [Directive
<T
,U
>,T
]
• T
• U extends SSRHTMLElement
= SSRHTMLElement
DirectivesAndOptParam<
T
,U
>: { [K in keyof T]: Directive<void, U> | DirectiveAndParam<T[K], U> }
• T extends any
[]
• U extends SSRHTMLElement
= SSRHTMLElement
Extends<
T
,U
>:T
extendsU
?1
:0
• T
• U
const
INVALID_VALUE: typeofINVALID_VALUE
IsSlotContent<
T
>:Extends
<T
,SlotContent
<any
>> |Extends
<SlotContent
<any
>,T
> extends1
?T
:0
• T
NormalizeValue<
T
>: (value
) =>T
| typeofINVALID_VALUE
• T
• value: T
T
| typeof INVALID_VALUE
• U extends object
optional
config:ReadableSignal
<Partial
<U
>> |ValuesOrReadableSignals
<Partial
<U
>>
Either a store of objects containing, for each property, the default value, or an object containing, for each property, either a store containing the default value or the default value itself.
optional
props:ValuesOrWritableSignals
<U
>
Object containing, for each property, either its initial value, or a store that will contain the value at any time. When the value of a property is undefined or invalid, the value from the config is used.
SlotContent<
Props
>:CoreSlotContent
<Props
> |SlotSvelteComponent
<Props
> | typeofuseSvelteSlot
• Props extends object
= object
SlotsPresent<
Props
>: { [K in keyof Props as IsSlotContent<Props[K]> extends SlotContent<any> ? K extends "children" ? "default" : K extends `slot${infer U}` ? Uncapitalize<U> : K : never]?: boolean }
• Props extends object
SlotSvelteComponent<
Props
>:ComponentType
<Accordion
<Props
,any
,Props
extendsWidgetSlotContext
<infer U> ?WidgetPropsSlots
<WidgetProps
<U
>> :any
>>
• Props extends object
= object
Subset of HTMLElement that is available in a server side rendering context.
classList:
Pick
<DOMTokenList
,"remove"
|"add"
|"toggle"
>
Object allowing to manipulate the classes of the element.
style:
Partial
<Record
<StyleKey
,StyleValue
>>
Object allowing to manipulate the style of the element.
removeAttribute(
qualifiedName
):void
Removes element's first attribute whose qualified name is qualifiedName.
• qualifiedName: string
void
setAttribute(
qualifiedName
,value
):void
Sets the value of element's first attribute whose qualified name is qualifiedName to value.
• qualifiedName: string
• value: string
void
StyleKey:
Exclude
<keyofCSSStyleDeclaration
,"length"
|"item"
|"parentRule"
|"getPropertyValue"
|"getPropertyPriority"
|"setProperty"
|"removeProperty"
| *typeof*Symbol.iterator
|number
|"cssText"
>
StyleValue:
string
|undefined
|null
toSlotContextWidget<
W
>(w
):ContextWidget
<W
>
Extract actions, api, directives, state and stores from the widget to be passed to slots as context.
• W extends Widget
<object
, object
, object
, object
, object
>
• w: W
the widget
the slot context
const
useSvelteSlot: typeofuseSvelteSlot
ValuesOrReadableSignals<
T
>: { [K in keyof T]?: ReadableSignal<T[K] | undefined> | T[K] }
• T extends object
ValuesOrWritableSignals<
T
>: { [K in keyof T]?: WritableSignal<T[K] | undefined> | T[K] }
• T extends object
• Props extends object
= object
• State extends object
= object
• Api extends object
= object
• Actions extends object
= object
• Directives extends object
= object
actions:
Actions
all the handlers that should be connected to user interactions i.e. click, keyboard and touch interactions. typically, the handlers are event listeners that call api functions to affect the widget state
api:
Api
all the api functions to interact with the widget
directives:
Directives
directives to be used on html elements in the template of the widget or in the slots
state$:
ReadableSignal
<State
>
the reactive state of the widget, combining all the values served by the stores
stores: { [K in string | number | symbol as `${K & string}$`]: ReadableSignal<State[K]> }
the different stores of the widget, all reactive
patch(
parameters
):void
Modify the parameter values, and recalculate the stores accordingly
• parameters: Partial
<Props
>
void
WidgetFactory<
W
>: (props
?) =>W
• W extends Widget
• props?: PropsConfig
<WidgetProps
<W
>>
W
WidgetProps<
T
>:T
extendsobject
?U
:never
• T extends object
WidgetPropsSlots<
Props
>: { [K in keyof Props as IsSlotContent<Props[K]> extends SlotContent<any> ? K extends "children" ? "default" : K extends `slot${infer U}` ? Uncapitalize<U> : K : never]: Props[K] extends SlotContent<infer U> ? U : never }
• Props extends object
• W extends Widget
state:
WidgetState
<W
>
the state of the widget
widget:
ContextWidget
<W
>
the widget
WidgetState<
T
>:T
extendsobject
?U
:never
• T extends object
• T
optional
equal: (a
,b
) =>boolean
the equal function, allowing to compare two values. used to check if a previous and current values are equals.
• a: T
• b: T
boolean
optional
normalizeValue:NormalizeValue
<T
>
the normalize value function. should return the invalidValue symbol when the provided value is invalid