1234567891011121314151617181920212223242526 |
- import { Long } from 'long'
- import { IConversionOptions } from 'protobufjs'
- import { IWorkingGroupMetadataAction } from '../compiled'
- export type AnyMessage<T> = T & {
- toJSON(): Record<string, unknown>
- }
- export type AnyMetadataClass<T> = {
- name: string
- decode(binary: Uint8Array): AnyMessage<T>
- encode(obj: T): { finish(): Uint8Array }
- toObject(obj: AnyMessage<T>, options?: IConversionOptions): Record<string, unknown>
- verify(message: { [k: string]: any }): null | string
- fromObject(object: { [k: string]: any }): AnyMessage<T>
- }
- export type DecodedMetadataObject<T> = {
- [K in keyof T]: T[K] extends Long | null | undefined
- ? Exclude<T[K], Long> | string
- : T[K] extends string | number | boolean | null | undefined
- ? T[K]
- : T[K] extends Array<infer S>
- ? DecodedMetadataObject<S>[]
- : DecodedMetadataObject<T[K]>
- }
|