// Custom options for defining:
// - Maximum size of string/bytes
// - Maximum number of elements in array
//
// These are used by nanopb to generate statically allocable structures
// for memory-limited environments.

// @generated by protoc-gen-es v2.12.0 with parameter "target=ts"
// @generated from file nanopb.proto (syntax proto2)
/* eslint-disable */

import type { GenEnum, GenExtension, GenFile, GenMessage } from "@bufbuild/protobuf/codegenv2";
import { enumDesc, extDesc, fileDesc, messageDesc } from "@bufbuild/protobuf/codegenv2";
import type { EnumOptions, FieldDescriptorProto_Type, FieldOptions, FileOptions, MessageOptions } from "@bufbuild/protobuf/wkt";
import { file_google_protobuf_descriptor } from "@bufbuild/protobuf/wkt";
import type { Message } from "@bufbuild/protobuf";

/**
 * Describes the file nanopb.proto.
 */
export const file_nanopb: GenFile = /*@__PURE__*/
  fileDesc("CgxuYW5vcGIucHJvdG8ipAcKDU5hbm9QQk9wdGlvbnMSEAoIbWF4X3NpemUYASABKAUSEgoKbWF4X2xlbmd0aBgOIAEoBRIRCgltYXhfY291bnQYAiABKAUSJgoIaW50X3NpemUYByABKA4yCC5JbnRTaXplOgpJU19ERUZBVUxUEiQKBHR5cGUYAyABKA4yCi5GaWVsZFR5cGU6CkZUX0RFRkFVTFQSGAoKbG9uZ19uYW1lcxgEIAEoCDoEdHJ1ZRIcCg1wYWNrZWRfc3RydWN0GAUgASgIOgVmYWxzZRIaCgtwYWNrZWRfZW51bRgKIAEoCDoFZmFsc2USGwoMc2tpcF9tZXNzYWdlGAYgASgIOgVmYWxzZRIYCglub191bmlvbnMYCCABKAg6BWZhbHNlEg0KBW1zZ2lkGAkgASgNEh4KD2Fub255bW91c19vbmVvZhgLIAEoCDoFZmFsc2USFQoGcHJvdG8zGAwgASgIOgVmYWxzZRIjChRwcm90bzNfc2luZ3VsYXJfbXNncxgVIAEoCDoFZmFsc2USHQoOZW51bV90b19zdHJpbmcYDSABKAg6BWZhbHNlEhsKDGZpeGVkX2xlbmd0aBgPIAEoCDoFZmFsc2USGgoLZml4ZWRfY291bnQYECABKAg6BWZhbHN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GUucHJvdG9idWYuRmlsZU9wdGlvbnMY8gcgASgLMg4uTmFub1BCT3B0aW9uc1INbmFub3BiRmlsZW9wdDpVCg1uYW5vcGJfbXNnb3B0Eh8uZ29vZ2xlLnByb3RvYnVmLk1lc3NhZ2VPcHRpb25zGPIHIAEoCzIOLk5hbm9QQk9wdGlvbnNSDG5hbm9wYk1zZ29wdDpUCg5uYW5vcGJfZW51bW9wdBIcLmdvb2dsZS5wcm90b2J1Zi5FbnVtT3B0aW9ucxjyByABKAsyDi5OYW5vUEJPcHRpb25zUg1uYW5vcGJFbnVtb3B0OkYKBm5hbm9wYhIdLmdvb2dsZS5wcm90b2J1Zi5GaWVsZE9wdGlvbnMY8gcgASgLMg4uTmFub1BCT3B0aW9uc1IGbmFub3BiQj4KGGZpLmthcHNpLmtvdGkuanBhLm5hbm9wYloiZ2l0aHViLmNvbS9tZXNodGFzdGljL2dvL2dlbmVyYXRlZA", [file_google_protobuf_descriptor]);

/**
 * This is the inner options message, which basically defines options for
 * a field. When it is used in message or file scope, it applies to all
 * fields.
 *
 * @generated from message NanoPBOptions
 */
export type NanoPBOptions = Message<"NanoPBOptions"> & {
  /**
   * Allocated size for 'bytes' and 'string' fields.
   * For string fields, this should include the space for null terminator.
   *
   * @generated from field: optional int32 max_size = 1;
   */
  maxSize: number;

  /**
   * Maximum length for 'string' fields. Setting this is equivalent
   * to setting max_size to a value of length+1.
   *
   * @generated from field: optional int32 max_length = 14;
   */
  maxLength: number;

  /**
   * Allocated number of entries in arrays ('repeated' fields)
   *
   * @generated from field: optional int32 max_count = 2;
   */
  maxCount: number;

  /**
   * Size of integer fields. Can save some memory if you don't need
   * full 32 bits for the value.
   *
   * @generated from field: optional IntSize int_size = 7 [default = IS_DEFAULT];
   */
  intSize: IntSize;

  /**
   * Force type of field (callback or static allocation)
   *
   * @generated from field: optional FieldType type = 3 [default = FT_DEFAULT];
   */
  type: FieldType;

  /**
   * Use long names for enums, i.e. EnumName_EnumValue.
   *
   * @generated from field: optional bool long_names = 4 [default = true];
   */
  longNames: boolean;

  /**
   * Add 'packed' attribute to generated structs.
   * Note: this cannot be used on CPUs that break on unaligned
   * accesses to variables.
   *
   * @generated from field: optional bool packed_struct = 5 [default = false];
   */
  packedStruct: boolean;

  /**
   * Add 'packed' attribute to generated enums.
   *
   * @generated from field: optional bool packed_enum = 10 [default = false];
   */
  packedEnum: boolean;

  /**
   * Skip this message
   *
   * @generated from field: optional bool skip_message = 6 [default = false];
   */
  skipMessage: boolean;

  /**
   * Generate oneof fields as normal optional fields instead of union.
   *
   * @generated from field: optional bool no_unions = 8 [default = false];
   */
  noUnions: boolean;

  /**
   * integer type tag for a message
   *
   * @generated from field: optional uint32 msgid = 9;
   */
  msgid: number;

  /**
   * decode oneof as anonymous union
   *
   * @generated from field: optional bool anonymous_oneof = 11 [default = false];
   */
  anonymousOneof: boolean;

  /**
   * Proto3 singular field does not generate a "has_" flag
   *
   * @generated from field: optional bool proto3 = 12 [default = false];
   */
  proto3: boolean;

  /**
   * Force proto3 messages to have no "has_" flag.
   * This was default behavior until nanopb-0.4.0.
   *
   * @generated from field: optional bool proto3_singular_msgs = 21 [default = false];
   */
  proto3SingularMsgs: boolean;

  /**
   * Generate an enum->string mapping function (can take up lots of space).
   *
   * @generated from field: optional bool enum_to_string = 13 [default = false];
   */
  enumToString: boolean;

  /**
   * Generate bytes arrays with fixed length
   *
   * @generated from field: optional bool fixed_length = 15 [default = false];
   */
  fixedLength: boolean;

  /**
   * Generate repeated field with fixed count
   *
   * @generated from field: optional bool fixed_count = 16 [default = false];
   */
  fixedCount: boolean;

  /**
   * Generate message-level callback that is called before decoding submessages.
   * This can be used to set callback fields for submsgs inside oneofs.
   *
   * @generated from field: optional bool submsg_callback = 22 [default = false];
   */
  submsgCallback: boolean;

  /**
   * Shorten or remove package names from type names.
   * This option applies only on the file level.
   *
   * @generated from field: optional TypenameMangling mangle_names = 17 [default = M_NONE];
   */
  mangleNames: TypenameMangling;

  /**
   * Data type for storage associated with callback fields.
   *
   * @generated from field: optional string callback_datatype = 18 [default = "pb_callback_t"];
   */
  callbackDatatype: string;

  /**
   * Callback function used for encoding and decoding.
   * Prior to nanopb-0.4.0, the callback was specified in per-field pb_callback_t
   * structure. This is still supported, but does not work inside e.g. oneof or pointer
   * fields. Instead, a new method allows specifying a per-message callback that
   * will be called for all callback fields in a message type.
   *
   * @generated from field: optional string callback_function = 19 [default = "pb_default_field_callback"];
   */
  callbackFunction: string;

  /**
   * Select the size of field descriptors. This option has to be defined
   * for the whole message, not per-field. Usually automatic selection is
   * ok, but if it results in compilation errors you can increase the field
   * size here.
   *
   * @generated from field: optional DescriptorSize descriptorsize = 20 [default = DS_AUTO];
   */
  descriptorsize: DescriptorSize;

  /**
   * Set default value for has_ fields.
   *
   * @generated from field: optional bool default_has = 23 [default = false];
   */
  defaultHas: boolean;

  /**
   * Extra files to include in generated `.pb.h`
   *
   * @generated from field: repeated string include = 24;
   */
  include: string[];

  /**
   * Automatic includes to exclude from generated `.pb.h`
   * Same as nanopb_generator.py command line flag -x.
   *
   * @generated from field: repeated string exclude = 26;
   */
  exclude: string[];

  /**
   * Package name that applies only for nanopb.
   *
   * @generated from field: optional string package = 25;
   */
  package: string;

  /**
   * Override type of the field in generated C code. Only to be used with related field types
   *
   * @generated from field: optional google.protobuf.FieldDescriptorProto.Type type_override = 27;
   */
  typeOverride: FieldDescriptorProto_Type;

  /**
   * Due to historical reasons, nanopb orders fields in structs by their tag number
   * instead of the order in .proto. Set this to false to keep the .proto order.
   * The default value will probably change to false in nanopb-0.5.0.
   *
   * @generated from field: optional bool sort_by_tag = 28 [default = true];
   */
  sortByTag: boolean;

  /**
   * Set the FT_DEFAULT field conversion strategy.
   * A field that can become a static member of a c struct (e.g. int, bool, etc)
   * will be a a static field.
   * Fields with dynamic length are converted to either a pointer or a callback.
   *
   * @generated from field: optional FieldType fallback_type = 29 [default = FT_CALLBACK];
   */
  fallbackType: FieldType;
};

/**
 * Describes the message NanoPBOptions.
 * Use `create(NanoPBOptionsSchema)` to create a new message.
 */
export const NanoPBOptionsSchema: GenMessage<NanoPBOptions> = /*@__PURE__*/
  messageDesc(file_nanopb, 0);

/**
 * @generated from enum FieldType
 */
export enum FieldType {
  /**
   * Automatically decide field type, generate static field if possible.
   *
   * @generated from enum value: FT_DEFAULT = 0;
   */
  FT_DEFAULT = 0,

  /**
   * Always generate a callback field.
   *
   * @generated from enum value: FT_CALLBACK = 1;
   */
  FT_CALLBACK = 1,

  /**
   * Always generate a dynamically allocated field.
   *
   * @generated from enum value: FT_POINTER = 4;
   */
  FT_POINTER = 4,

  /**
   * Generate a static field or raise an exception if not possible.
   *
   * @generated from enum value: FT_STATIC = 2;
   */
  FT_STATIC = 2,

  /**
   * Ignore the field completely.
   *
   * @generated from enum value: FT_IGNORE = 3;
   */
  FT_IGNORE = 3,

  /**
   * Legacy option, use the separate 'fixed_length' option instead
   *
   * @generated from enum value: FT_INLINE = 5;
   */
  FT_INLINE = 5,
}

/**
 * Describes the enum FieldType.
 */
export const FieldTypeSchema: GenEnum<FieldType> = /*@__PURE__*/
  enumDesc(file_nanopb, 0);

/**
 * @generated from enum IntSize
 */
export enum IntSize {
  /**
   * Default, 32/64bit based on type in .proto
   *
   * @generated from enum value: IS_DEFAULT = 0;
   */
  IS_DEFAULT = 0,

  /**
   * @generated from enum value: IS_8 = 8;
   */
  IS_8 = 8,

  /**
   * @generated from enum value: IS_16 = 16;
   */
  IS_16 = 16,

  /**
   * @generated from enum value: IS_32 = 32;
   */
  IS_32 = 32,

  /**
   * @generated from enum value: IS_64 = 64;
   */
  IS_64 = 64,
}

/**
 * Describes the enum IntSize.
 */
export const IntSizeSchema: GenEnum<IntSize> = /*@__PURE__*/
  enumDesc(file_nanopb, 1);

/**
 * @generated from enum TypenameMangling
 */
export enum TypenameMangling {
  /**
   * Default, no typename mangling
   *
   * @generated from enum value: M_NONE = 0;
   */
  M_NONE = 0,

  /**
   * Strip current package name
   *
   * @generated from enum value: M_STRIP_PACKAGE = 1;
   */
  M_STRIP_PACKAGE = 1,

  /**
   * Only use last path component
   *
   * @generated from enum value: M_FLATTEN = 2;
   */
  M_FLATTEN = 2,

  /**
   * Replace the package name by the initials
   *
   * @generated from enum value: M_PACKAGE_INITIALS = 3;
   */
  M_PACKAGE_INITIALS = 3,
}

/**
 * Describes the enum TypenameMangling.
 */
export const TypenameManglingSchema: GenEnum<TypenameMangling> = /*@__PURE__*/
  enumDesc(file_nanopb, 2);

/**
 * @generated from enum DescriptorSize
 */
export enum DescriptorSize {
  /**
   * Select minimal size based on field type
   *
   * @generated from enum value: DS_AUTO = 0;
   */
  DS_AUTO = 0,

  /**
   * 1 word; up to 15 byte fields, no arrays
   *
   * @generated from enum value: DS_1 = 1;
   */
  DS_1 = 1,

  /**
   * 2 words; up to 4095 byte fields, 4095 entry arrays
   *
   * @generated from enum value: DS_2 = 2;
   */
  DS_2 = 2,

  /**
   * 4 words; up to 2^32-1 byte fields, 2^16-1 entry arrays
   *
   * @generated from enum value: DS_4 = 4;
   */
  DS_4 = 4,

  /**
   * 8 words; up to 2^32-1 entry arrays
   *
   * @generated from enum value: DS_8 = 8;
   */
  DS_8 = 8,
}

/**
 * Describes the enum DescriptorSize.
 */
export const DescriptorSizeSchema: GenEnum<DescriptorSize> = /*@__PURE__*/
  enumDesc(file_nanopb, 3);

/**
 * @generated from extension: optional NanoPBOptions nanopb_fileopt = 1010;
 */
export const nanopb_fileopt: GenExtension<FileOptions, NanoPBOptions> = /*@__PURE__*/
  extDesc(file_nanopb, 0);

/**
 * @generated from extension: optional NanoPBOptions nanopb_msgopt = 1010;
 */
export const nanopb_msgopt: GenExtension<MessageOptions, NanoPBOptions> = /*@__PURE__*/
  extDesc(file_nanopb, 1);

/**
 * @generated from extension: optional NanoPBOptions nanopb_enumopt = 1010;
 */
export const nanopb_enumopt: GenExtension<EnumOptions, NanoPBOptions> = /*@__PURE__*/
  extDesc(file_nanopb, 2);

/**
 * @generated from extension: optional NanoPBOptions nanopb = 1010;
 */
export const nanopb: GenExtension<FieldOptions, NanoPBOptions> = /*@__PURE__*/
  extDesc(file_nanopb, 3);

