Papupata Documentation

API Reference

class DeclaredAPI

exposed type ResponseType

Purpose

Represents the type returned from the API.

Usage

The exposed types are used with the typeof operator. See the example below for details.

Although the types are presented as fields on the API, they have no runtime value.

Examples

import { APIDeclaration } from 'papupata'
const api = new APIDeclaration()
const myAPI = api.declarePostAPI('/do-stuff')
  .response<string>()

type ResponseType = typeof myAPI['ResponseType']
// ResponseType is now string