@cerbos/core
Version:
Common types used by the Cerbos client libraries
18 lines • 768 B
TypeScript
import type { DescMessage, MessageShape } from "@bufbuild/protobuf";
import type { StatusNotOK } from "../types/external.js";
import { NotOK } from "./external.js";
import type { ErrorRegistry } from "./registry.js";
/** @internal */
export interface ErrorDetails<T> {
typeUrl: string;
value: T;
}
/** @internal */
export declare abstract class AbstractErrorResponse<Details> extends Error {
readonly code: StatusNotOK;
constructor(code: number, message: string);
toNotOK(registry: ErrorRegistry | undefined): NotOK;
protected abstract details(): Generator<ErrorDetails<Details>, void, undefined>;
protected abstract parseDetails<T extends DescMessage>(schema: T, details: Details): MessageShape<T>;
}
//# sourceMappingURL=response.d.ts.map