import type { BinaryWriteOptions } from '@protobuf-ts/runtime';
import type { IBinaryWriter } from '@protobuf-ts/runtime';
import type { BinaryReadOptions } from '@protobuf-ts/runtime';
import type { IBinaryReader } from '@protobuf-ts/runtime';
import type { PartialMessage } from '@protobuf-ts/runtime';
import { MessageType } from '@protobuf-ts/runtime';
import { Empty } from '../../../../../google/protobuf/empty.js';
/**
 * Encodes values that the ledger accepts as command arguments and emits as contract arguments.
 *
 * The values encoding use different classes of non-empty strings as identifiers. Those classes are
 * defined as follows:
 *
 * - NameStrings are strings with length <= 1000 that match the regexp ``[A-Za-z\$_][A-Za-z0-9\$_]*``.
 * - PackageIdStrings are strings with length <= 64 that match the regexp ``[A-Za-z0-9\-_ ]+``.
 * - PartyIdStrings are strings with length <= 255 that match the regexp ``[A-Za-z0-9:\-_ ]+``.
 * - LedgerStrings are strings with length <= 255 that match the regexp ``[A-Za-z0-9#:\-_/ ]+``.
 * - UserIdStrings are strings with length <= 128 that match the regexp ``[a-zA-Z0-9@^$.!`\-#+'~_|:]+``.
 *
 *
 * @generated from protobuf message com.daml.ledger.api.v2.Value
 */
export interface Value {
    /**
     * @generated from protobuf oneof: sum
     */
    sum: {
        oneofKind: 'unit';
        /**
         * This value is used for example for choices that don't take any arguments.
         *
         * @generated from protobuf field: google.protobuf.Empty unit = 1
         */
        unit: Empty;
    } | {
        oneofKind: 'bool';
        /**
         * True or false.
         *
         * @generated from protobuf field: bool bool = 2
         */
        bool: boolean;
    } | {
        oneofKind: 'int64';
        /**
         * @generated from protobuf field: sint64 int64 = 3 [jstype = JS_STRING]
         */
        int64: string;
    } | {
        oneofKind: 'date';
        /**
         * Days since the unix epoch. Can go backwards. Limited from
         * 0001-01-01 to 9999-12-31, also to be compatible with
         * https://www.ietf.org/rfc/rfc3339.txt
         *
         * @generated from protobuf field: int32 date = 4
         */
        date: number;
    } | {
        oneofKind: 'timestamp';
        /**
         * Microseconds since the UNIX epoch. Can go backwards. Fixed
         * since the vast majority of values will be greater than
         * 2^28, since currently the number of microseconds since the
         * epoch is greater than that. Range: 0001-01-01T00:00:00Z to
         * 9999-12-31T23:59:59.999999Z, so that we can convert to/from
         * https://www.ietf.org/rfc/rfc3339.txt
         *
         * @generated from protobuf field: sfixed64 timestamp = 5 [jstype = JS_STRING]
         */
        timestamp: string;
    } | {
        oneofKind: 'numeric';
        /**
         * A Numeric, that is a decimal value with precision 38 (at most 38 significant digits) and a
         * scale between 0 and 37 (significant digits on the right of the decimal point).
         * The field has to match the regex
         *
         * .. code-block:: none
         *
         *   [+-]?\d{1,38}(.\d{0,37})?
         *
         * and should be representable by a Numeric without loss of precision.
         *
         * @generated from protobuf field: string numeric = 6
         */
        numeric: string;
    } | {
        oneofKind: 'party';
        /**
         * An agent operating on the ledger.
         * Must be a valid PartyIdString.
         *
         * @generated from protobuf field: string party = 7
         */
        party: string;
    } | {
        oneofKind: 'text';
        /**
         * A string.
         *
         * @generated from protobuf field: string text = 8
         */
        text: string;
    } | {
        oneofKind: 'contractId';
        /**
         * Identifier of an on-ledger contract. Commands which reference an unknown or already archived contract ID will fail.
         * Must be a valid LedgerString.
         *
         * @generated from protobuf field: string contract_id = 9
         */
        contractId: string;
    } | {
        oneofKind: 'optional';
        /**
         * The Optional type, None or Some
         *
         * @generated from protobuf field: com.daml.ledger.api.v2.Optional optional = 10
         */
        optional: Optional;
    } | {
        oneofKind: 'list';
        /**
         * Represents a homogeneous list of values.
         *
         * @generated from protobuf field: com.daml.ledger.api.v2.List list = 11
         */
        list: List;
    } | {
        oneofKind: 'textMap';
        /**
         * The TextMap type
         *
         * @generated from protobuf field: com.daml.ledger.api.v2.TextMap text_map = 12
         */
        textMap: TextMap;
    } | {
        oneofKind: 'genMap';
        /**
         * The GenMap type
         *
         * @generated from protobuf field: com.daml.ledger.api.v2.GenMap gen_map = 13
         */
        genMap: GenMap;
    } | {
        oneofKind: 'record';
        /**
         * @generated from protobuf field: com.daml.ledger.api.v2.Record record = 14
         */
        record: Record;
    } | {
        oneofKind: 'variant';
        /**
         * @generated from protobuf field: com.daml.ledger.api.v2.Variant variant = 15
         */
        variant: Variant;
    } | {
        oneofKind: 'enum';
        /**
         * The Enum type
         *
         * @generated from protobuf field: com.daml.ledger.api.v2.Enum enum = 16
         */
        enum: Enum;
    } | {
        oneofKind: undefined;
    };
}
/**
 * Contains nested values.
 *
 * @generated from protobuf message com.daml.ledger.api.v2.Record
 */
export interface Record {
    /**
     * Omitted from the transaction stream when verbose streaming is not enabled.
     * Optional when submitting commands.
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.Identifier record_id = 1
     */
    recordId?: Identifier;
    /**
     * The nested values of the record.
     * Required
     *
     * @generated from protobuf field: repeated com.daml.ledger.api.v2.RecordField fields = 2
     */
    fields: RecordField[];
}
/**
 * A named nested value within a record.
 *
 * @generated from protobuf message com.daml.ledger.api.v2.RecordField
 */
export interface RecordField {
    /**
     * When reading a transaction stream, it's omitted if verbose streaming is not enabled.
     * When submitting a command, it's optional:
     *
     * - if all keys within a single record are present, the order in which fields appear does not matter. however, each key must appear exactly once.
     * - if any of the keys within a single record are omitted, the order of fields MUST match the order of declaration in the Daml template.
     *
     * Must be a valid NameString
     *
     * @generated from protobuf field: string label = 1
     */
    label: string;
    /**
     * A nested value of a record.
     * Required
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.Value value = 2
     */
    value?: Value;
}
/**
 * Unique identifier of an entity.
 * Throughout this API, the following terminology is being used:
 *
 *   - if a Daml package-id is encoded in the package_id field, it is referred to as using a "package-id reference format"
 *   - if a Daml package-name is encoded in the package_id field, it is referred to as using a "package-name reference format"
 *
 * @generated from protobuf message com.daml.ledger.api.v2.Identifier
 */
export interface Identifier {
    /**
     * Generally, the identifier of the Daml package that contains the entity.
     * When encoding a package-id, it must be a valid PackageIdString.
     *
     * The field is overloaded to also be able to contain the package-name of the Daml package.
     * This is supported if the entity referenced is either an interface or template.
     * When representing the Daml package-name, the encoding is of form `#<package-name>`
     * where `#` (not a valid package-id character)
     * is used as a discriminator for signalling a package-name encoding.
     *
     * Required
     *
     * @generated from protobuf field: string package_id = 1
     */
    packageId: string;
    /**
     * The dot-separated module name of the identifier.
     * Required
     *
     * @generated from protobuf field: string module_name = 2
     */
    moduleName: string;
    /**
     * The dot-separated name of the entity (e.g. record, template, ...) within the module.
     * Required
     *
     * @generated from protobuf field: string entity_name = 3
     */
    entityName: string;
}
/**
 * A value with alternative representations.
 *
 * @generated from protobuf message com.daml.ledger.api.v2.Variant
 */
export interface Variant {
    /**
     * Omitted from the transaction stream when verbose streaming is not enabled.
     * Optional when submitting commands.
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.Identifier variant_id = 1
     */
    variantId?: Identifier;
    /**
     * Determines which of the Variant's alternatives is encoded in this message.
     * Must be a valid NameString.
     * Required
     *
     * @generated from protobuf field: string constructor = 2
     */
    constructor: string;
    /**
     * The value encoded within the Variant.
     * Required
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.Value value = 3
     */
    value?: Value;
}
/**
 * A value with finite set of alternative representations.
 *
 * @generated from protobuf message com.daml.ledger.api.v2.Enum
 */
export interface Enum {
    /**
     * Omitted from the transaction stream when verbose streaming is not enabled.
     * Optional when submitting commands.
     *
     * @generated from protobuf field: com.daml.ledger.api.v2.Identifier enum_id = 1
     */
    enumId?: Identifier;
    /**
     * Determines which of the Variant's alternatives is encoded in this message.
     * Must be a valid NameString.
     * Required
     *
     * @generated from protobuf field: string constructor = 2
     */
    constructor: string;
}
/**
 * A homogenous collection of values.
 *
 * @generated from protobuf message com.daml.ledger.api.v2.List
 */
export interface List {
    /**
     * The elements must all be of the same concrete value type.
     * Optional
     *
     * @generated from protobuf field: repeated com.daml.ledger.api.v2.Value elements = 1
     */
    elements: Value[];
}
/**
 * Corresponds to Java's Optional type, Scala's Option, and Haskell's Maybe.
 * The reason why we need to wrap this in an additional ``message`` is that we
 * need to be able to encode the ``None`` case in the ``Value`` oneof.
 *
 * @generated from protobuf message com.daml.ledger.api.v2.Optional
 */
export interface Optional {
    /**
     * @generated from protobuf field: com.daml.ledger.api.v2.Value value = 1
     */
    value?: Value;
}
/**
 * @generated from protobuf message com.daml.ledger.api.v2.TextMap
 */
export interface TextMap {
    /**
     * @generated from protobuf field: repeated com.daml.ledger.api.v2.TextMap.Entry entries = 1
     */
    entries: TextMap_Entry[];
}
/**
 * @generated from protobuf message com.daml.ledger.api.v2.TextMap.Entry
 */
export interface TextMap_Entry {
    /**
     * @generated from protobuf field: string key = 1
     */
    key: string;
    /**
     * @generated from protobuf field: com.daml.ledger.api.v2.Value value = 2
     */
    value?: Value;
}
/**
 * @generated from protobuf message com.daml.ledger.api.v2.GenMap
 */
export interface GenMap {
    /**
     * @generated from protobuf field: repeated com.daml.ledger.api.v2.GenMap.Entry entries = 1
     */
    entries: GenMap_Entry[];
}
/**
 * @generated from protobuf message com.daml.ledger.api.v2.GenMap.Entry
 */
export interface GenMap_Entry {
    /**
     * @generated from protobuf field: com.daml.ledger.api.v2.Value key = 1
     */
    key?: Value;
    /**
     * @generated from protobuf field: com.daml.ledger.api.v2.Value value = 2
     */
    value?: Value;
}
declare class Value$Type extends MessageType<Value> {
    constructor();
    create(value?: PartialMessage<Value>): Value;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Value): Value;
    internalBinaryWrite(message: Value, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.Value
 */
export declare const Value: Value$Type;
declare class Record$Type extends MessageType<Record> {
    constructor();
    create(value?: PartialMessage<Record>): Record;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Record): Record;
    internalBinaryWrite(message: Record, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.Record
 */
export declare const Record: Record$Type;
declare class RecordField$Type extends MessageType<RecordField> {
    constructor();
    create(value?: PartialMessage<RecordField>): RecordField;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: RecordField): RecordField;
    internalBinaryWrite(message: RecordField, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.RecordField
 */
export declare const RecordField: RecordField$Type;
declare class Identifier$Type extends MessageType<Identifier> {
    constructor();
    create(value?: PartialMessage<Identifier>): Identifier;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Identifier): Identifier;
    internalBinaryWrite(message: Identifier, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.Identifier
 */
export declare const Identifier: Identifier$Type;
declare class Variant$Type extends MessageType<Variant> {
    constructor();
    create(value?: PartialMessage<Variant>): Variant;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Variant): Variant;
    internalBinaryWrite(message: Variant, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.Variant
 */
export declare const Variant: Variant$Type;
declare class Enum$Type extends MessageType<Enum> {
    constructor();
    create(value?: PartialMessage<Enum>): Enum;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Enum): Enum;
    internalBinaryWrite(message: Enum, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.Enum
 */
export declare const Enum: Enum$Type;
declare class List$Type extends MessageType<List> {
    constructor();
    create(value?: PartialMessage<List>): List;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: List): List;
    internalBinaryWrite(message: List, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.List
 */
export declare const List: List$Type;
declare class Optional$Type extends MessageType<Optional> {
    constructor();
    create(value?: PartialMessage<Optional>): Optional;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: Optional): Optional;
    internalBinaryWrite(message: Optional, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.Optional
 */
export declare const Optional: Optional$Type;
declare class TextMap$Type extends MessageType<TextMap> {
    constructor();
    create(value?: PartialMessage<TextMap>): TextMap;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TextMap): TextMap;
    internalBinaryWrite(message: TextMap, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.TextMap
 */
export declare const TextMap: TextMap$Type;
declare class TextMap_Entry$Type extends MessageType<TextMap_Entry> {
    constructor();
    create(value?: PartialMessage<TextMap_Entry>): TextMap_Entry;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: TextMap_Entry): TextMap_Entry;
    internalBinaryWrite(message: TextMap_Entry, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.TextMap.Entry
 */
export declare const TextMap_Entry: TextMap_Entry$Type;
declare class GenMap$Type extends MessageType<GenMap> {
    constructor();
    create(value?: PartialMessage<GenMap>): GenMap;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GenMap): GenMap;
    internalBinaryWrite(message: GenMap, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.GenMap
 */
export declare const GenMap: GenMap$Type;
declare class GenMap_Entry$Type extends MessageType<GenMap_Entry> {
    constructor();
    create(value?: PartialMessage<GenMap_Entry>): GenMap_Entry;
    internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GenMap_Entry): GenMap_Entry;
    internalBinaryWrite(message: GenMap_Entry, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
}
/**
 * @generated MessageType for protobuf message com.daml.ledger.api.v2.GenMap.Entry
 */
export declare const GenMap_Entry: GenMap_Entry$Type;
export {};
//# sourceMappingURL=value.d.ts.map