Skip to main content

@tairu/jsx

Tairu JSX, exposing Tile components and a parser to convert the JSX elements to the JSON format.

Installation

npm install @tairu/jsx

Type Aliases

ActionElement

ActionElement: OpenActionElement | SignActionElement | SubmitActionElement


BoxElement

BoxElement: ReactElement<BoxProps, typeof Box>


BoxProps

BoxProps: object

Type declaration

children?

optional children: ReactNode | BoxV0 | TextV0 | (BoxV0 | TextV0)[]

style?

optional style: BoxStyleV0


ImageElement

ImageElement: ReactElement<ImageProps, typeof Image>


ImageProps

ImageProps: object

Type declaration

alt

alt: string

height

height: number

src

src: string

width

width: number


OpenActionElement

OpenActionElement: ReactElement<OpenActionProps, typeof OpenAction>


OpenActionProps

OpenActionProps: object

Type declaration

label

label: string

uri

uri: string


OptionElement

OptionElement: ReactElement<OptionProps, typeof Option>


OptionProps

OptionProps: InputOptionV0


OptionsInputElement

OptionsInputElement: ReactElement<OptionsInputProps, typeof OptionsInput>


OptionsInputProps

OptionsInputProps: object

Type declaration

children

children: OptionElement | OptionElement[]

multiple?

optional multiple: boolean


SignActionElement

SignActionElement: ReactElement<SignActionProps, typeof SignAction>


SignActionProps

SignActionProps: object

Type declaration

label

label: string

payload?

optional payload: Record<string, unknown>

state?

optional state: Record<string, unknown>


SubmitActionElement

SubmitActionElement: ReactElement<SubmitActionProps, typeof SubmitAction>


SubmitActionProps

SubmitActionProps: object

Type declaration

label

label: string

state?

optional state: Record<string, unknown>


TextElement

TextElement: ReactElement<TextProps, typeof Text>


TextInputElement

TextInputElement: ReactElement<TextInputProps, typeof TextInput>


TextInputProps

TextInputProps: object

Type declaration

defaultValue?

optional defaultValue: string

label

label: string

placeholder?

optional placeholder: string

secure?

optional secure: boolean


TextProps

TextProps: object

Type declaration

children

children: ReactNode | TextV0 | TextV0[]

style?

optional style: TextStyleV0


TileActionsProp

TileActionsProp: ActionV0 | ActionElement | (ActionV0 | ActionElement)[]


TileElement

TileElement: ReactElement<TileProps, typeof Tile>


TileInputProp

TileInputProp: InputV0 | OptionsInputElement | TextInputElement


TileProps

TileProps: BoxProps & TileMetaV0 & object

Type declaration

actions?

optional actions: TileActionsProp

input?

optional input: TileInputProp


ValidTileInput

ValidTileInput: ReactElement | TileV0

Functions

Box()

Box(props): ReactElement<BoxProps, string | JSXElementConstructor<any>>

Parameters

props: BoxProps

Returns

ReactElement<BoxProps, string | JSXElementConstructor<any>>


Image()

Image(props): ReactElement<ImageProps, string | JSXElementConstructor<any>>

Parameters

props: ImageProps

Returns

ReactElement<ImageProps, string | JSXElementConstructor<any>>


OpenAction()

OpenAction(props): ReactElement<OpenActionProps, string | JSXElementConstructor<any>>

Parameters

props: OpenActionProps

Returns

ReactElement<OpenActionProps, string | JSXElementConstructor<any>>


Option()

Option(props): ReactElement<object, string | JSXElementConstructor<any>>

Parameters

props

props.label: string

props.value: string | number | boolean

Returns

ReactElement<object, string | JSXElementConstructor<any>>

label

readonly label: string

value

readonly value: string | number | boolean


OptionsInput()

OptionsInput(props): DOMElement<OptionsInputProps, Element>

Parameters

props: OptionsInputProps

Returns

DOMElement<OptionsInputProps, Element>


parseTile()

parseTile(root): TileV0

Parameters

root: ReactElement<any, string | JSXElementConstructor<any>>

Returns

TileV0


SignAction()

SignAction(props): ReactElement<SignActionProps, string | JSXElementConstructor<any>>

Parameters

props: SignActionProps

Returns

ReactElement<SignActionProps, string | JSXElementConstructor<any>>


SubmitAction()

SubmitAction(props): ReactElement<SubmitActionProps, string | JSXElementConstructor<any>>

Parameters

props: SubmitActionProps

Returns

ReactElement<SubmitActionProps, string | JSXElementConstructor<any>>


Text()

Text(props): ReactElement<TextProps, string | JSXElementConstructor<any>>

Parameters

props: TextProps

Returns

ReactElement<TextProps, string | JSXElementConstructor<any>>


TextInput()

TextInput(props): ReactElement<TextInputProps, string | JSXElementConstructor<any>>

Parameters

props: TextInputProps

Returns

ReactElement<TextInputProps, string | JSXElementConstructor<any>>


Tile()

Tile(props): ReactElement<BoxProps & object & object, string | JSXElementConstructor<any>>

Parameters

props: TileProps

Returns

ReactElement<BoxProps & object & object, string | JSXElementConstructor<any>>


toValidTile()

toValidTile(input): TileV0

Parameters

input: ValidTileInput

Returns

TileV0