UNPKG

ketting

Version:

Opinionated HATEOAS / Rest client.

21 lines (20 loc) 615 B
import { BaseState } from './base-state.js'; import Client from '../client.js'; /** * Represents a resource state in the Siren format */ export declare class SirenState<T> extends BaseState<T> { /** * Returns a serialization of the state that can be used in a HTTP * response. * * For example, a JSON object might simply serialize using * JSON.serialize(). */ serializeBody(): string; clone(): SirenState<T>; } /** * Turns a HTTP response into a SirenState */ export declare const factory: (client: Client, uri: string, response: Response) => Promise<SirenState<any>>;