@@ -58,7 +58,7 @@ interface HTMLElementAttributes {
58
58
/**
59
59
* A reference to the element
60
60
*/
61
- ref ?: import ( 'html-tag-js/ref' ) . Ref ;
61
+ ref ?: import ( 'html-tag-js/ref' ) . RefConstructor ;
62
62
/**
63
63
* Sets content of the element.
64
64
* @example $div.content = tag('span', 'Hello World!');
@@ -560,7 +560,7 @@ declare module 'html-tag-js' {
560
560
}
561
561
562
562
declare module 'html-tag-js/ref' {
563
- interface Ref {
563
+ export interface RefConstructor {
564
564
/**
565
565
* Element reference
566
566
*/
@@ -597,17 +597,17 @@ declare module 'html-tag-js/ref' {
597
597
* @param event event name
598
598
* @param cb callback function
599
599
*/
600
- on ( event : 'ref' , cb : ( this : Ref , ref : HTMLElement ) => void ) : void ;
600
+ on ( event : 'ref' , cb : ( this : RefConstructor , ref : HTMLElement ) => void ) : void ;
601
601
/**
602
602
* Remove event listener
603
603
* @param event event name
604
604
* @param cb callback function
605
605
*/
606
- off ( event : 'ref' , cb : ( this : Ref , ref : HTMLElement ) => void ) : void ;
606
+ off ( event : 'ref' , cb : ( this : RefConstructor , ref : HTMLElement ) => void ) : void ;
607
607
/**
608
608
* Called when reference is set
609
609
*/
610
- onref : ( this : Ref , ref : HTMLElement ) => void ;
610
+ onref : ( this : RefConstructor , ref : HTMLElement ) => void ;
611
611
/**
612
612
* Get the classList
613
613
* If the element is not yet created
@@ -677,17 +677,37 @@ declare module 'html-tag-js/ref' {
677
677
content : Node | Array < Node > ;
678
678
}
679
679
680
- export default function Ref ( onref ?: ( this : Ref , element : HTMLElement ) => void ) : Ref ;
680
+ const Ref : {
681
+ ( onref ?: ( this : RefConstructor , element : HTMLElement ) => void ) : RefConstructor ;
682
+ /**
683
+ * Check if the value is object of RefConstructor
684
+ * @param value Object to check
685
+ * @returns
686
+ */
687
+ isRef : ( value : any ) => boolean ;
688
+ }
689
+
690
+ export default Ref ;
681
691
}
682
692
683
693
declare module 'html-tag-js/reactive' {
684
- interface Reactive < T = string > extends Text {
694
+ export interface ReactiveConstructor < T = string > extends Text {
685
695
value : T ;
686
- onChange : ( this : Reactive < T > , value : T ) => void ;
696
+ onChange : ( this : ReactiveConstructor < T > , value : T ) => void ;
687
697
toString : ( ) => string ;
688
698
}
689
699
690
- export default function Reactive < T = any > ( initialValue ?: T ) : Reactive < T > ;
700
+ const Reactive : {
701
+ < T = string > ( value : T ) : ReactiveConstructor < T > ;
702
+ /**
703
+ * Check if the value is object of ReactiveConstructor
704
+ * @param value Object to check
705
+ * @returns
706
+ */
707
+ isReactive : ( value : any ) => boolean ;
708
+ } ;
709
+
710
+ export default Reactive ;
691
711
}
692
712
693
713
declare namespace JSX {
0 commit comments