JSDoc
Classes
ReactClient
classMinimal API client for the react module.
class ReactClient
Members
options
propertyoptions: ClientOptions
constructor
constructorconstructor(options: ClientOptions): ReactClient
request
methodPerform a JSON request and return a typed result.
<T>(input: RequestInput): Promise<RequestResult<T>>
Functions
createReactClient
functionCreate a new client instance.
createReactClient(options: ClientOptions): ReactClient
helloReact
functionConvenience greeting for quick smoke testing.
helloReact(name: string, excited?: boolean): string
Types
HttpMethod
typeSupported HTTP methods for client requests.
type HttpMethod = "GET" | "POST" | "PUT" | "PATCH" | "DELETE"
ClientOptions
typeConfiguration 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
typeInput 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
typeResult of a request.
type RequestResult = RequestResult<T>
Constants
moduleId
constconst moduleId: "react"