UNPKG

657 BTypeScriptView Raw
1import { StatusObject } from './call-interface';
2import { Status } from './constants';
3import { Metadata } from './metadata';
4/**
5 * A builder for gRPC status objects.
6 */
7export declare class StatusBuilder {
8 private code;
9 private details;
10 private metadata;
11 constructor();
12 /**
13 * Adds a status code to the builder.
14 */
15 withCode(code: Status): this;
16 /**
17 * Adds details to the builder.
18 */
19 withDetails(details: string): this;
20 /**
21 * Adds metadata to the builder.
22 */
23 withMetadata(metadata: Metadata): this;
24 /**
25 * Builds the status object.
26 */
27 build(): Partial<StatusObject>;
28}