Dummy

← Back to module

JSDoc

Classes

ReactClient

class

Minimal API client for the react module.

class ReactClient
Members

options

property
options: ClientOptions

constructor

constructor
constructor(options: ClientOptions): ReactClient

request

method

Perform a JSON request and return a typed result.

<T>(input: RequestInput): Promise<RequestResult<T>>

Functions

createReactClient

function

Create a new client instance.

createReactClient(options: ClientOptions): ReactClient

helloReact

function

Convenience greeting for quick smoke testing.

helloReact(name: string, excited?: boolean): string

Types

HttpMethod

type

Supported HTTP methods for client requests.

type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE"

ClientOptions

type

Configuration for creating a React client.

type ClientOptions = {
  /**
   * Base URL for API requests (for example, "https://api.example.com").
   */
  baseUrl: string;
  /**
   * Optional API key for authenticated requests.
   */
  apiKey?: string;
  /**
   * Request timeout in milliseconds.
   */
  timeoutMs?: number;
}

RequestInput

type

Input shape for a request.

type RequestInput = {
  /**
   * Path to append to the base URL (for example, "/v1/health").
   */
  path: string;
  /**
   * HTTP method to use.
   */
  method?: HttpMethod;
  /**
   * Optional JSON-serializable body.
   */
  body?: unknown;
}

RequestResult

type

Result of a request.

type RequestResult = RequestResult<T>

Constants

moduleId

const
const moduleId: "react"