motidata
Version:
Data retrieval library for services (e.g. App) accessing MotiMate's main Api
21 lines • 861 B
TypeScript
import type { Serializable } from "child_process";
export interface SimpleResponseDTO<BodyType extends Serializable | undefined = undefined> {
ok: boolean;
statusCode: number;
data?: BodyType;
}
/**
* Collection of {@link SimpleResponseDTO} Helpers
*/
export declare const SimpleResponseHelpers: {
/**
* Due to limitations of NextJs Server Actions, [this can not be a class](https://react.dev/reference/rsc/use-server#serializable-parameters-and-return-values).
* @throws any `Response.json()` related error
*/
transformToSimpleResponse<ResponseDTO extends Serializable | undefined = undefined>(fetchResponse: Response): Promise<SimpleResponseDTO<ResponseDTO>>;
/**
* @private
*/
_extractDataBasedOnContentType(fetchResponse: Response): Promise<unknown>;
};
//# sourceMappingURL=SimpleResponseDTO.d.ts.map