Options
All
  • Public
  • Public/Protected
  • All
Menu

betrybe-technical-test

Index

Type aliases

AllBPI

AllBPI: GetCurrentPriceBTCResponse["bpi"] & LocalBPI

BtcGetHandlerResponse

BtcGetHandlerResponse: BtcServiceGetCurrentPriceResponse

Default response for btc get request

BtcUpdateHandlerResponse

BtcUpdateHandlerResponse: { message: string }

Default response for btc get request

Type declaration

  • message: string

Currencies

Currencies: keyof CurrenciesExchanges

CurrenciesExchanges

CurrenciesExchanges: typeof currenciesExchanges

GlobPattern

GlobPattern: string

Matches a string using glob (*) matching.

HttpRequestInterceptor

HttpRequestInterceptor: (req: IncomingHttpRequest) => void | Promise<void>

Interceptor for an HTTP request. If a Promise is returned, it will be awaited before passing the request to the next handler (if there is one), otherwise the request will be passed to the next handler synchronously.

Type declaration

HttpResponseInterceptor

HttpResponseInterceptor: (res: IncomingHttpResponse) => void | Promise<void>

Interceptor for an HTTP response. If a Promise is returned, it will be awaited before passing the request to the next handler (if there is one), otherwise the request will be passed to the next handler synchronously.

Type declaration

InterceptionState

InterceptionState: "Received" | "Intercepted" | "ResponseReceived" | "ResponseIntercepted" | "Complete" | "Errored"

LocalBPI

LocalBPI: {}

Type declaration

LoginHandlerResponse

LoginHandlerResponse: LoginResponseData

Default response for login request

Method

Method: "ACL" | "BIND" | "CHECKOUT" | "CONNECT" | "COPY" | "DELETE" | "GET" | "HEAD" | "LINK" | "LOCK" | "M-SEARCH" | "MERGE" | "MKACTIVITY" | "MKCALENDAR" | "MKCOL" | "MOVE" | "NOTIFY" | "OPTIONS" | "PATCH" | "POST" | "PROPFIND" | "PROPPATCH" | "PURGE" | "PUT" | "REBIND" | "REPORT" | "SEARCH" | "SOURCE" | "SUBSCRIBE" | "TRACE" | "UNBIND" | "UNLINK" | "UNLOCK" | "UNSUBSCRIBE" | "acl" | "bind" | "checkout" | "connect" | "copy" | "delete" | "get" | "head" | "link" | "lock" | "m-search" | "merge" | "mkactivity" | "mkcalendar" | "mkcol" | "move" | "notify" | "options" | "patch" | "post" | "propfind" | "proppatch" | "purge" | "put" | "rebind" | "report" | "search" | "source" | "subscribe" | "trace" | "unbind" | "unlink" | "unlock" | "unsubscribe"

NumberMatcher

NumberMatcher: number | number[]

Matches a single number or any of an array of acceptable numbers.

RouteHandler

RouteHandler: string | StaticResponse | RouteHandlerController | object

RouteHandlerController

RouteHandlerController: HttpRequestInterceptor

RouteMatcher

A RouteMatcher describes a filter for HTTP requests.

RouteMatcherOptions

StaticResponse

StaticResponse: GenericStaticResponse<string, string | object> & { delayMs?: number }

Describes a response that will be sent back to the browser to fulfill the request.

StringMatcher

StringMatcher: GlobPattern | RegExp

Either a GlobPattern string or a RegExp.

ValidationErrorContent

ValidationErrorContent: ErrorResponseContent

ValidationResponse

Variables

Const ENDPOINT

ENDPOINT: "https://api.coindesk.com/v1/" = "https://api.coindesk.com/v1/"

Const FILE_NAME

FILE_NAME: "currencies.json" = "currencies.json"

Const apiClient

apiClient: AxiosInstance = axios.create({ baseURL: '/api' })

Make a request on the app

Functions

Alert

  • Alert(__namedParameters: { children: string; type: "default" | "warning" }): Element

BtcRateInput

  • BtcRateInput(__namedParameters: { disabled: boolean; onChange: (event: ChangeEvent<HTMLInputElement>) => void; rate: number; title: string }): Element
  • Parameters

    • __namedParameters: { disabled: boolean; onChange: (event: ChangeEvent<HTMLInputElement>) => void; rate: number; title: string }
      • disabled: boolean
      • onChange: (event: ChangeEvent<HTMLInputElement>) => void
          • (event: ChangeEvent<HTMLInputElement>): void
          • Parameters

            • event: ChangeEvent<HTMLInputElement>

            Returns void

      • rate: number
      • title: string

    Returns Element

FormInputError

  • FormInputError(__namedParameters: { message: string }): Element

Loading

  • Loading(): Element

LoginPage

  • LoginPage(): Element

MyApp

  • MyApp(__namedParameters: { Component: NextComponentType<NextPageContext, any, {}>; pageProps: any }): Element
  • Parameters

    • __namedParameters: { Component: NextComponentType<NextPageContext, any, {}>; pageProps: any }
      • Component: NextComponentType<NextPageContext, any, {}>
      • pageProps: any

    Returns Element

UpdatePage

  • UpdatePage(__namedParameters: { currenciesExchanges: { BRL: string; CAD: string; EUR: string } }): Element
  • Parameters

    • __namedParameters: { currenciesExchanges: { BRL: string; CAD: string; EUR: string } }
      • currenciesExchanges: { BRL: string; CAD: string; EUR: string }
        • BRL: string
        • CAD: string
        • EUR: string

    Returns Element

Const btcGetHandler

  • btcGetHandler(req: NextApiRequest, res: NextApiResponse<any>): Promise<void>

Const btcHandler

  • btcHandler(req: NextApiRequest, res: NextApiResponse<any>): Promise<void>

Const btcUpdateHandler

  • btcUpdateHandler(req: NextApiRequest, res: NextApiResponse<any>): Promise<void>

Const getServerSideProps

  • getServerSideProps(): Promise<{ props: object }>

jsonResponse

  • jsonResponse<T>(res: NextApiResponse, statusCode: number, data: T): void
  • Create a JSON response

    Type parameters

    • T = any

    Parameters

    • res: NextApiResponse
    • statusCode: number
    • data: T

    Returns void

Const loginHandler

  • loginHandler(req: NextApiRequest, res: NextApiResponse<any>): Promise<void>

methodNotAllowedResponse

  • methodNotAllowedResponse(methods: string[], req: NextApiRequest, res: NextApiResponse): void

Const notFoundHandler

  • notFoundHandler(req: NextApiRequest, res: NextApiResponse<any>): Promise<void>

useApiClient

  • useApiClient<T>(url: string, config?: AxiosRequestConfig): responseInterface<AxiosResponse<T>, any>
  • Type parameters

    • T

    Parameters

    • url: string
    • Default value config: AxiosRequestConfig = {}

    Returns responseInterface<AxiosResponse<T>, any>

Object literals

Const currenciesName

currenciesName: object

BRL

BRL: string = "Brazilian Real"

CAD

CAD: string = "Canadian Dollar"

EUR

EUR: string = "Euro"

Generated using TypeDoc