import type { ByteSource, PartialDeep } from "protoscript"; import * as protoscript from "protoscript"; /** * `NullValue` is a singleton enumeration to represent the null value for the * `Value` type union. * * The JSON representation for `NullValue` is JSON `null`. */ export type NullValue = "NULL_VALUE"; /** * `Struct` represents a structured data value, consisting of fields * which map to dynamically typed values. In some languages, `Struct` * might be supported by a native representation. For example, in * scripting languages like JS a struct is represented as an * object. The details of that representation are described together * with the proto support for the language. * * The JSON representation for `Struct` is JSON object. */ export interface Struct { /** * Unordered map of dynamically typed values. */ fields: Record; } export declare namespace Struct { interface Fields { key: string; value: Value; } } /** * `Value` represents a dynamically typed value which can be either * null, a number, a string, a boolean, a recursive struct value, or a * list of values. A producer of value is expected to set one of these * variants. Absence of any variant indicates an error. * * The JSON representation for `Value` is JSON value. */ export interface Value { /** * Represents a null value. */ nullValue?: NullValue | null | undefined; /** * Represents a double value. */ numberValue?: number | null | undefined; /** * Represents a string value. */ stringValue?: string | null | undefined; /** * Represents a boolean value. */ boolValue?: boolean | null | undefined; /** * Represents a structured value. */ structValue?: Struct | null | undefined; /** * Represents a repeated `Value`. */ listValue?: ListValue | null | undefined; } /** * `ListValue` is a wrapper around a repeated field of values. * * The JSON representation for `ListValue` is JSON array. */ export interface ListValue { /** * Repeated field of dynamically typed values. */ values: Value[]; } export declare const NullValue: { /** * Null value. */ readonly NULL_VALUE: "NULL_VALUE"; /** * @private */ readonly _fromInt: (i: number) => NullValue; /** * @private */ readonly _toInt: (i: NullValue) => number; }; export declare const Struct: { /** * Serializes Struct to protobuf. */ encode: (msg: PartialDeep) => Uint8Array; /** * Deserializes Struct from protobuf. */ decode: (bytes: ByteSource) => Struct; /** * Initializes Struct with all fields set to their default value. */ initialize: (msg?: Partial) => Struct; /** * @private */ _writeMessage: (msg: PartialDeep, writer: protoscript.BinaryWriter) => protoscript.BinaryWriter; /** * @private */ _readMessage: (msg: Struct, reader: protoscript.BinaryReader) => Struct; Fields: { /** * @private */ _writeMessage: (msg: PartialDeep, writer: protoscript.BinaryWriter) => protoscript.BinaryWriter; /** * @private */ _readMessage: (msg: Struct.Fields, reader: protoscript.BinaryReader) => Struct.Fields; }; }; export declare const Value: { /** * Serializes Value to protobuf. */ encode: (msg: PartialDeep) => Uint8Array; /** * Deserializes Value from protobuf. */ decode: (bytes: ByteSource) => Value; /** * Initializes Value with all fields set to their default value. */ initialize: (msg?: Partial) => Value; /** * @private */ _writeMessage: (msg: PartialDeep, writer: protoscript.BinaryWriter) => protoscript.BinaryWriter; /** * @private */ _readMessage: (msg: Value, reader: protoscript.BinaryReader) => Value; }; export declare const ListValue: { /** * Serializes ListValue to protobuf. */ encode: (msg: PartialDeep) => Uint8Array; /** * Deserializes ListValue from protobuf. */ decode: (bytes: ByteSource) => ListValue; /** * Initializes ListValue with all fields set to their default value. */ initialize: (msg?: Partial) => ListValue; /** * @private */ _writeMessage: (msg: PartialDeep, writer: protoscript.BinaryWriter) => protoscript.BinaryWriter; /** * @private */ _readMessage: (msg: ListValue, reader: protoscript.BinaryReader) => ListValue; }; export declare const NullValueJSON: { /** * Null value. */ readonly NULL_VALUE: "NULL_VALUE"; /** * @private */ readonly _fromInt: (i: number) => NullValue; /** * @private */ readonly _toInt: (i: NullValue) => number; }; export declare const StructJSON: { /** * Serializes Struct to JSON. */ encode: (msg: PartialDeep) => string; /** * Deserializes Struct from JSON. */ decode: (json: string) => Struct; /** * Initializes Struct with all fields set to their default value. */ initialize: (msg?: Partial) => Struct; /** * @private */ _writeMessage: (msg: PartialDeep) => Record; /** * @private */ _readMessage: (msg: Struct, json: any) => Struct; Fields: { /** * @private */ _writeMessage: (msg: PartialDeep) => Record; /** * @private */ _readMessage: (msg: Struct.Fields, json: any) => Struct.Fields; }; }; export declare const ValueJSON: { /** * Serializes Value to JSON. */ encode: (msg: PartialDeep) => string; /** * Deserializes Value from JSON. */ decode: (json: string) => Value; /** * Initializes Value with all fields set to their default value. */ initialize: (msg?: Partial) => Value; /** * @private */ _writeMessage: (msg: PartialDeep) => Record; /** * @private */ _readMessage: (msg: Value, json: any) => Value; }; export declare const ListValueJSON: { /** * Serializes ListValue to JSON. */ encode: (msg: PartialDeep) => string; /** * Deserializes ListValue from JSON. */ decode: (json: string) => ListValue; /** * Initializes ListValue with all fields set to their default value. */ initialize: (msg?: Partial) => ListValue; /** * @private */ _writeMessage: (msg: PartialDeep) => Record; /** * @private */ _readMessage: (msg: ListValue, json: any) => ListValue; };