001package react4j; 002 003import jsinterop.annotations.JsOverlay; 004import jsinterop.annotations.JsPackage; 005import jsinterop.annotations.JsType; 006import jsinterop.base.Js; 007 008/** 009 * Union type representing possible output of render method. 010 */ 011@JsType( isNative = true, name = "?", namespace = JsPackage.GLOBAL ) 012public interface ReactNode 013{ 014 @JsOverlay 015 static ReactNode of( final byte value ) 016 { 017 return Js.uncheckedCast( Js.asAny( value ) ); 018 } 019 020 @JsOverlay 021 static ReactNode of( final short value ) 022 { 023 return Js.uncheckedCast( Js.asAny( value ) ); 024 } 025 026 @JsOverlay 027 static ReactNode of( final int value ) 028 { 029 return Js.uncheckedCast( Js.asAny( value ) ); 030 } 031 032 @JsOverlay 033 static ReactNode of( final long value ) 034 { 035 return of( Long.toString( value ) ); 036 } 037 038 @JsOverlay 039 static ReactNode of( final float value ) 040 { 041 return Js.uncheckedCast( Js.asAny( value ) ); 042 } 043 044 @JsOverlay 045 static ReactNode of( final double value ) 046 { 047 return Js.uncheckedCast( Js.asAny( value ) ); 048 } 049 050 @JsOverlay 051 static ReactNode of( final String string ) 052 { 053 return Js.uncheckedCast( string ); 054 } 055 056 @JsOverlay 057 static ReactNode of( final ReactNode... elements ) 058 { 059 return Js.uncheckedCast( elements ); 060 } 061}