Skip to main content

@tairu/next/server

Tairu Next.js integration for route handlers.

Installation​

npm install @tairu/next/server

Type Aliases​

BoxElement​

BoxElement: ReactElement<BoxProps, typeof Box>


BoxProps​

BoxProps: object

Type declaration​

children?​

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

style?​

optional style: BoxStyleV0


Context​

Context: object

Type declaration​

revalidate()​

revalidate: () => void

Returns​

void


ImageElement​

ImageElement: ReactElement<ImageProps, typeof Image>


ImageProps​

ImageProps: object

Type declaration​

alt​

alt: string

height​

height: number

src​

src: string

width​

width: number


Method​

Method: "GET" | "OPTIONS" | "POST"


NextHandler()​

NextHandler: (req) => Promise<Response>

Parameters​

req​

NextRequest

Returns​

Promise<Response>


NextHandlers​

NextHandlers: Record<Method, NextHandler>


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


TileElement​

TileElement: ReactElement<TileProps, typeof Tile>


TileProps​

TileProps: BoxProps & TileMetaV0 & object

Type declaration​

actions?​

optional actions: TileActionsProp

input?​

optional input: TileInputProp

Functions​

Box()​

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

Parameters​

props​

BoxProps

Returns​

ReactElement<BoxProps, string | JSXElementConstructor>


handle()​

handle<SearchParams>(tileHandler): NextHandlers

Type Parameters​

• SearchParams extends ParamsRecord = ParamsRecord

Parameters​

tileHandler​

TileHandler<Record<string, never>, SearchParams, ValidTileInput, Context>

Returns​

NextHandlers


Image()​

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

Parameters​

props​

ImageProps

Returns​

ReactElement<ImageProps, string | JSXElementConstructor>


OpenAction()​

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

Parameters​

props​

OpenActionProps

Returns​

ReactElement<OpenActionProps, string | JSXElementConstructor>


Option()​

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

Parameters​

props​
props.label​

string

props.value​

string | number | boolean

Returns​

ReactElement<object, string | JSXElementConstructor>

label​

label: string

value​

value: string | number | boolean


OptionsInput()​

OptionsInput(props): DOMElement

Parameters​

props​

OptionsInputProps

Returns​

DOMElement


SignAction()​

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

Parameters​

props​

SignActionProps

Returns​

ReactElement<SignActionProps, string | JSXElementConstructor>


SubmitAction()​

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

Parameters​

props​

SubmitActionProps

Returns​

ReactElement<SubmitActionProps, string | JSXElementConstructor>


Text()​

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

Parameters​

props​

TextProps

Returns​

ReactElement<TextProps, string | JSXElementConstructor>


TextInput()​

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

Parameters​

props​

TextInputProps

Returns​

ReactElement<TextInputProps, string | JSXElementConstructor>


Tile()​

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

Parameters​

props​

TileProps

Returns​

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