import { EmptyMeta, EmptyResponseData } from "../codecs.js"; import { HttpSuccessCodes } from "../httpStatusCode.js"; import { Endpoint, HasOnlyOptionalProps } from "../types.js"; type ApplicationResponseObject = { /** * Set non-200 success status code */ status?: HttpSuccessCodes; } & (E["return"] extends EmptyResponseData ? { data?: never; } : { data: E["return"] | (E["return"] extends undefined ? undefined : Uint8Array); }) & (E["meta"] extends EmptyMeta ? { meta?: never; } : { meta: E["meta"]; }); export type ApplicationResponse = HasOnlyOptionalProps> extends true ? ApplicationResponseObject | void : ApplicationResponseObject; export type ApiContext = { /** * Raw ssz bytes from request payload, only available for ssz requests */ sszBytes?: Uint8Array | null; /** * Informs application method about preferable return type to avoid unnecessary serialization */ returnBytes?: boolean; }; type GenericOptions = Record; export type ApplicationMethod = (args: E["args"], context?: ApiContext, opts?: GenericOptions) => Promise>; export type ApplicationMethods> = { [K in keyof Es]: ApplicationMethod; }; export {}; //# sourceMappingURL=method.d.ts.map