import type { Stream } from "@dxos/codec-protobuf"; import substitutions from "../../substitutions"; import * as dxos_registry from "../dxos/registry"; import * as dxos_type from "../dxos/type"; export interface FileDescriptorSet { file?: FileDescriptorProto[]; } export interface FileDescriptorProto { name?: string; package?: string; dependency?: string[]; /** * Options: * - packed = false */ publicDependency?: number[]; /** * Options: * - packed = false */ weakDependency?: number[]; messageType?: DescriptorProto[]; enumType?: EnumDescriptorProto[]; service?: ServiceDescriptorProto[]; extension?: FieldDescriptorProto[]; options?: FileOptions; sourceCodeInfo?: SourceCodeInfo; syntax?: string; } export interface DescriptorProto { name?: string; field?: FieldDescriptorProto[]; extension?: FieldDescriptorProto[]; nestedType?: DescriptorProto[]; enumType?: EnumDescriptorProto[]; extensionRange?: DescriptorProto.ExtensionRange[]; oneofDecl?: OneofDescriptorProto[]; options?: MessageOptions; reservedRange?: DescriptorProto.ReservedRange[]; reservedName?: string[]; } export namespace DescriptorProto { export interface ExtensionRange { start?: number; end?: number; options?: ExtensionRangeOptions; } export interface ReservedRange { start?: number; end?: number; } } export interface ExtensionRangeOptions { uninterpretedOption?: UninterpretedOption[]; } export interface FieldDescriptorProto { name?: string; number?: number; label?: FieldDescriptorProto.Label; type?: FieldDescriptorProto.Type; typeName?: string; extendee?: string; defaultValue?: string; oneofIndex?: number; jsonName?: string; options?: FieldOptions; proto3Optional?: boolean; } export namespace FieldDescriptorProto { export enum Type { TYPE_DOUBLE = 1, TYPE_FLOAT = 2, TYPE_INT64 = 3, TYPE_UINT64 = 4, TYPE_INT32 = 5, TYPE_FIXED64 = 6, TYPE_FIXED32 = 7, TYPE_BOOL = 8, TYPE_STRING = 9, TYPE_GROUP = 10, TYPE_MESSAGE = 11, TYPE_BYTES = 12, TYPE_UINT32 = 13, TYPE_ENUM = 14, TYPE_SFIXED32 = 15, TYPE_SFIXED64 = 16, TYPE_SINT32 = 17, TYPE_SINT64 = 18 } export enum Label { LABEL_OPTIONAL = 1, LABEL_REQUIRED = 2, LABEL_REPEATED = 3 } } export interface OneofDescriptorProto { name?: string; options?: OneofOptions; } export interface EnumDescriptorProto { name?: string; value?: EnumValueDescriptorProto[]; options?: EnumOptions; reservedRange?: EnumDescriptorProto.EnumReservedRange[]; reservedName?: string[]; } export namespace EnumDescriptorProto { export interface EnumReservedRange { start?: number; end?: number; } } export interface EnumValueDescriptorProto { name?: string; number?: number; options?: EnumValueOptions; } export interface ServiceDescriptorProto { name?: string; method?: MethodDescriptorProto[]; options?: ServiceOptions; } export interface MethodDescriptorProto { name?: string; inputType?: string; outputType?: string; options?: MethodOptions; /** * Options: * - default = false */ clientStreaming?: boolean; /** * Options: * - default = false */ serverStreaming?: boolean; } export interface FileOptions { javaPackage?: string; javaOuterClassname?: string; /** * Options: * - default = false */ javaMultipleFiles?: boolean; /** * Options: * - deprecated = true */ javaGenerateEqualsAndHash?: boolean; /** * Options: * - default = false */ javaStringCheckUtf8?: boolean; /** * Options: * - default = "SPEED" */ optimizeFor?: FileOptions.OptimizeMode; goPackage?: string; /** * Options: * - default = false */ ccGenericServices?: boolean; /** * Options: * - default = false */ javaGenericServices?: boolean; /** * Options: * - default = false */ pyGenericServices?: boolean; /** * Options: * - default = false */ phpGenericServices?: boolean; /** * Options: * - default = false */ deprecated?: boolean; /** * Options: * - default = true */ ccEnableArenas?: boolean; objcClassPrefix?: string; csharpNamespace?: string; swiftPrefix?: string; phpClassPrefix?: string; phpNamespace?: string; phpMetadataNamespace?: string; rubyPackage?: string; uninterpretedOption?: UninterpretedOption[]; } export namespace FileOptions { export enum OptimizeMode { SPEED = 1, CODE_SIZE = 2, LITE_RUNTIME = 3 } } export interface MessageOptions { /** * Options: * - default = false */ messageSetWireFormat?: boolean; /** * Options: * - default = false */ noStandardDescriptorAccessor?: boolean; /** * Options: * - default = false */ deprecated?: boolean; mapEntry?: boolean; uninterpretedOption?: UninterpretedOption[]; } export interface FieldOptions { /** * Options: * - default = "STRING" */ ctype?: FieldOptions.CType; packed?: boolean; /** * Options: * - default = "JS_NORMAL" */ jstype?: FieldOptions.JSType; /** * Options: * - default = false */ lazy?: boolean; /** * Options: * - default = false */ deprecated?: boolean; /** * Options: * - default = false */ weak?: boolean; uninterpretedOption?: UninterpretedOption[]; } export namespace FieldOptions { export enum CType { STRING = 0, CORD = 1, STRING_PIECE = 2 } export enum JSType { JS_NORMAL = 0, JS_STRING = 1, JS_NUMBER = 2 } } export interface OneofOptions { uninterpretedOption?: UninterpretedOption[]; } export interface EnumOptions { allowAlias?: boolean; /** * Options: * - default = false */ deprecated?: boolean; uninterpretedOption?: UninterpretedOption[]; } export interface EnumValueOptions { /** * Options: * - default = false */ deprecated?: boolean; uninterpretedOption?: UninterpretedOption[]; } export interface ServiceOptions { /** * Options: * - default = false */ deprecated?: boolean; uninterpretedOption?: UninterpretedOption[]; } export interface MethodOptions { /** * Options: * - default = false */ deprecated?: boolean; /** * Options: * - default = "IDEMPOTENCY_UNKNOWN" */ idempotencyLevel?: MethodOptions.IdempotencyLevel; uninterpretedOption?: UninterpretedOption[]; } export namespace MethodOptions { export enum IdempotencyLevel { IDEMPOTENCY_UNKNOWN = 0, NO_SIDE_EFFECTS = 1, IDEMPOTENT = 2 } } export interface UninterpretedOption { name?: UninterpretedOption.NamePart[]; identifierValue?: string; positiveIntValue?: string; negativeIntValue?: string; doubleValue?: number; stringValue?: Uint8Array; aggregateValue?: string; } export namespace UninterpretedOption { export interface NamePart { namePart: string; isExtension: boolean; } } export interface SourceCodeInfo { location?: SourceCodeInfo.Location[]; } export namespace SourceCodeInfo { export interface Location { path?: number[]; span?: number[]; leadingComments?: string; trailingComments?: string; leadingDetachedComments?: string[]; } } export interface GeneratedCodeInfo { annotation?: GeneratedCodeInfo.Annotation[]; } export namespace GeneratedCodeInfo { export interface Annotation { path?: number[]; sourceFile?: string; begin?: number; end?: number; } } export interface Timestamp { seconds?: string; nanos?: number; }