@@ -1763,8 +1763,8 @@ declare namespace CTDOM {
17631763
17641764 export interface HTMLAttributes < T > extends AriaAttributes , DOMAttributes < T > {
17651765 // CT extensions
1766- "onClick" ?: CellLike < HandlerEvent < unknown > > ;
1767- "onChange" ?: CellLike < HandlerEvent < unknown > > ;
1766+ "onClick" ?: EventHandler < unknown > ;
1767+ "onChange" ?: EventHandler < unknown > ;
17681768 "children" ?: RenderNode | undefined ;
17691769 // Allow React-isms
17701770 "key" ?: number ;
@@ -2825,10 +2825,12 @@ interface CTThemeDef {
28252825
28262826type CTThemeInput = Partial < CTThemeDef > & Record < string , unknown > ;
28272827
2828- type HandlerEvent < T > = {
2828+ type CTEvent < T > = {
28292829 detail : T ;
28302830} ;
28312831
2832+ type EventHandler < T > = CellLike < CTEvent < T > > | ( ( event ?: CTEvent < T > ) => void ) ;
2833+
28322834// `Charm` is not a recipe type.
28332835type Charm = any ;
28342836
@@ -2889,16 +2891,16 @@ interface CTPlaidLinkElement extends CTHTMLElement {}
28892891
28902892interface CTDraggableAttributes < T > extends CTHTMLAttributes < T > {
28912893 "key" ?: number ;
2892- "x" ?: CellLike < HandlerEvent < any > > ;
2893- "y" ?: CellLike < HandlerEvent < any > > ;
2894+ "x" ?: CellLike < CTEvent < any > > ;
2895+ "y" ?: CellLike < CTEvent < any > > ;
28942896 "hidden" ?: Booleanish ;
2895- "onpositionchange" ?: CellLike < HandlerEvent < any > > ;
2897+ "onpositionchange" ?: EventHandler < any > ;
28962898}
28972899
28982900interface CTCanvasAttributes < T > extends CTHTMLAttributes < T > {
28992901 "width" ?: string | number ;
29002902 "height" ?: string | number ;
2901- "onct-canvas-click" ?: CellLike < HandlerEvent < any > > ;
2903+ "onct-canvas-click" ?: EventHandler < any > ;
29022904}
29032905
29042906interface CTPlaidLinkAttributes < T > extends CTHTMLAttributes < T > {
@@ -2944,7 +2946,7 @@ interface CTAttachmentsBarAttributes<T> extends CTHTMLAttributes<T> {
29442946
29452947interface CTTagsAttributes < T > extends CTHTMLAttributes < T > {
29462948 "tags" ?: string [ ] ;
2947- "onct-change" ?: CellLike < HandlerEvent < any > > ;
2949+ "onct-change" ?: EventHandler < any > ;
29482950}
29492951
29502952interface CTToolbarAttributes < T > extends CTHTMLAttributes < T > {
@@ -3017,7 +3019,7 @@ interface CTSendMessageAttributes<T> extends CTHTMLAttributes<T> {
30173019 "value" ?: any ;
30183020 "placeholder" ?: string ;
30193021 "appearance" ?: "rounded" ;
3020- "onmessagesend" ?: CellLike < HandlerEvent < { message : string } > > ;
3022+ "onmessagesend" ?: EventHandler < { message : string } > ;
30213023 "inline" ?: Booleanish ;
30223024}
30233025
@@ -3031,7 +3033,7 @@ interface CTScrollAttributes<T> extends CTHTMLAttributes<T> {
30313033interface CTOutlinerAttributes < T > extends CTHTMLAttributes < T > {
30323034 "$value" : CellLike < { root : OutlinerNode } > ;
30333035 "$mentionable" ?: CellLike < Charm [ ] > ;
3034- "oncharm-link-click" ?: CellLike < HandlerEvent < { charm : Cell < Charm > } > > ;
3036+ "oncharm-link-click" ?: EventHandler < { charm : Cell < Charm > } > ;
30353037}
30363038
30373039interface CTChatMessageAttributes < T > extends CTHTMLAttributes < T > {
@@ -3075,7 +3077,7 @@ interface CTListAttributes<T> extends CTHTMLAttributes<T> {
30753077 /** setting this hides the 'add item' form built into the list */
30763078 "readonly" ?: boolean ;
30773079 "title" ?: string ;
3078- "onct-remove-item" ?: CellLike < HandlerEvent < { item : CtListItem } > > ;
3080+ "onct-remove-item" ?: EventHandler < { item : CtListItem } > ;
30793081}
30803082
30813083interface CTListItemAttributes < T > extends CTHTMLAttributes < T > {
@@ -3150,17 +3152,15 @@ interface CTCheckboxAttributes<T> extends CTHTMLAttributes<T> {
31503152 "indeterminate" ?: boolean ;
31513153 "name" ?: string ;
31523154 "value" ?: string ;
3153- "onct-change" ?: CellLike < HandlerEvent < any > > ;
3155+ "onct-change" ?: EventHandler < any > ;
31543156}
31553157
31563158interface CTSelectAttributes < T > extends CTHTMLAttributes < T > {
31573159 "$value" : CellLike < any | any [ ] > ;
31583160 "items" : { label : string ; value : any } [ ] ;
31593161 "multiple" ?: boolean ;
3160- "onct-change" ?: CellLike <
3161- HandlerEvent <
3162- { items : { label : string ; value : any } [ ] ; value : any | any [ ] }
3163- >
3162+ "onct-change" ?: EventHandler <
3163+ { items : { label : string ; value : any } [ ] ; value : any | any [ ] }
31643164 > ;
31653165}
31663166
0 commit comments