@@ -27,11 +27,11 @@ export type Effect<S> =
2727
2828export type EventFunction < S > = ( state : S , evt : Event ) => Patch < S > ;
2929
30- export type Props < S > = Partial <
30+ export interface Props < S > extends Partial <
3131 Omit < HTMLElement ,
3232 keyof ( DocumentFragment & ElementCSSInlineStyle & GlobalEventHandlers ) > &
3333 { [ K in keyof EventsMap ] : EventFunction < S > | Patch < S > } // all on* events
34- > & {
34+ > {
3535 [ _ : string ] : unknown ,
3636 xmlns ?: string | null ,
3737 class ?: ClassProp ,
@@ -60,27 +60,29 @@ export type StyleProp =
6060 | string
6161 | "" | null | undefined ; // no style
6262
63- export type EventsMap =
64- & { [ K in keyof HTMLElementEventMap as `on${K } `] : HTMLElementEventMap [ K ] }
65- & { [ K in keyof WindowEventMap as `on${K } `] : WindowEventMap [ K ] }
66- & { [ K in keyof SVGElementEventMap as `on${K } `] : SVGElementEventMap [ K ] }
67- & { onsearch : Event } ;
63+ type EventsMapBase =
64+ & { [ K in keyof HTMLElementEventMap as `on${K } `] : HTMLElementEventMap [ K ] }
65+ & { [ K in keyof WindowEventMap as `on${K } `] : WindowEventMap [ K ] }
66+ & { [ K in keyof SVGElementEventMap as `on${K } `] : SVGElementEventMap [ K ] } ;
67+
68+ export interface EventsMap extends EventsMapBase { }
6869
6970export type PropertyValue < S > =
7071 | string | boolean | null | undefined | void
7172 | StyleProp | ClassProp
7273 | Patch < S > ;
7374
7475export type Dispatch < S > = ( action : Patch < S > ) => void ;
75- export type PatchableState < S = object > = S & { patch : Dispatch < S > } ;
76+ export interface Patchable < S = object > { patch : Dispatch < S > ; }
77+ export type PatchableState < S = object > = S & Patchable < S > ;
7678
7779export const globals = {
7880 currentViewTransition : < ViewTransition | null | undefined > undefined ,
7981 requestAnimationFrame : ! ! window . requestAnimationFrame ? window . requestAnimationFrame . bind ( window ) : ( ( cb : ( ) => void ) => cb ( ) ) ,
8082 startViewTransition : ! ! document . startViewTransition ? document . startViewTransition . bind ( document ) : null ,
8183} ;
8284
83- export type ContainerNode < S = PatchableState > = HTMLElement & {
85+ export interface ContainerNode < S = PatchableState > extends HTMLElement {
8486 /** the `_vode` property is added to the container in `app()`.
8587 * it contains all necessary stuff for the vode app to function.
8688 * remove the container node to clear vodes resources */
0 commit comments