UNPKG

yc-types

Version:

TypeScript types and interfaces for YellowCard protobuf definitions

49 lines (48 loc) 1.93 kB
import { BinaryReader, BinaryWriter } from "@bufbuild/protobuf/wire"; import { Metadata } from "./common"; export declare const protobufPackage = "pb"; export interface Issuer { id: string; accreditedBy?: string | undefined; registrationNumber?: string | undefined; organizationName?: string | undefined; address?: Uint8Array | undefined; contactEmail?: string | undefined; contactPhone?: string | undefined; createdAt?: Date | undefined; } export interface CreateIssuerRequest { accreditedBy: string; registrationNumber: string; organizationName: string; address: Uint8Array; contactEmail: string; contactPhone: string; } export interface ListIssuersResponse { status: number; issuers: Issuer[]; meta: Metadata | undefined; } export declare const Issuer: MessageFns<Issuer>; export declare const CreateIssuerRequest: MessageFns<CreateIssuerRequest>; export declare const ListIssuersResponse: MessageFns<ListIssuersResponse>; type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; export type DeepPartial<T> = T extends Builtin ? T : T extends globalThis.Array<infer U> ? globalThis.Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]>; } : Partial<T>; type KeysOfUnion<T> = T extends T ? keyof T : never; export type Exact<P, I extends P> = P extends Builtin ? P : P & { [K in keyof P]: Exact<P[K], I[K]>; } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never; }; export interface MessageFns<T> { encode(message: T, writer?: BinaryWriter): BinaryWriter; decode(input: BinaryReader | Uint8Array, length?: number): T; fromJSON(object: any): T; toJSON(message: T): unknown; create<I extends Exact<DeepPartial<T>, I>>(base?: I): T; fromPartial<I extends Exact<DeepPartial<T>, I>>(object: I): T; } export {};