/** * Defines the protobuf types, descriptors, and wire helpers used by generated * Nebius SDK code. * * Application code normally uses generated message exports. Use this * low-level module when you implement a registry, inspect runtime descriptors, * or encode and decode dynamic protobuf values. * * @packageDocumentation */ import dayjs, { Dayjs } from 'dayjs'; import Long from 'long'; /** Provides the configured Day.js instance used by generated well-known types. */ export { dayjs }; /** Represents a protobuf timestamp in generated SDK code. */ export type { Dayjs }; /** Represents a protobuf duration as a Day.js duration. */ export type Duration = ReturnType; /** Provides arbitrary-precision values for protobuf 64-bit integers. */ export { default as Long } from 'long'; /** Provides protobuf wire readers and writers used by generated codecs. */ export { BinaryReader, BinaryWriter } from '@bufbuild/protobuf/wire'; /** * Identifies a protobuf scalar type by its descriptor numeric code. * * Generated descriptors use these values to distinguish default values when * they build reset masks. */ export type MessageFieldScalarType = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 12 | 13 | 14 | 15 | 16 | 17 | 18; /** * Describes one generated message field for runtime reflection. * * This is a small SDK descriptor, not a complete protobuf descriptor. It * contains only the data needed by runtime features such as reset masks. */ export interface MessageFieldDescriptor { /** Contains the original `snake_case` protobuf field name. */ pbName: string; /** Specifies whether the field has `field_behavior = IMMUTABLE`. */ immutable?: boolean; /** Specifies whether the field is repeated. */ repeated?: boolean; /** Specifies whether the field belongs to a oneof. */ oneof?: boolean; /** Specifies whether the field represents an immutable oneof. */ immutableOneof?: boolean; /** Specifies whether the field is a map. */ map?: boolean; /** Contains the protobuf descriptor code when this is a scalar or enum. */ scalarType?: MessageFieldScalarType; /** Returns the nested descriptor when this field contains a message. */ message?: () => MessageDescriptor | undefined; /** Returns the nested descriptor when this is a map with message values. */ mapValue?: () => MessageDescriptor | undefined; } /** Describes the fields and optional value adapter for one generated message. */ export interface MessageDescriptor { /** * Converts a runtime value to its descriptor-shaped object. * * Well-known types use this adapter because their TypeScript values do not * have the same shape as their protobuf fields. */ reflect?: (value: unknown) => Record | undefined; /** Maps generated TypeScript field names to their descriptors. */ fields: Record; } /** * Identifies a non-enumerable {@link MessageDescriptor} attached by * {@link attachMessageDescriptor}. * * Runtime helpers read this symbol. It does not appear in normal object * iteration or JSON output. */ export declare const messageDescriptorSymbol: unique symbol; /** * Attaches a descriptor to a message without adding an enumerable property. * * The function normally changes and returns `message`. If the object does not * accept a new property, it creates a shallow copy, attaches the descriptor, * and returns that copy. Always use the returned value. * * If `descriptor` is absent, the function returns `message` unchanged. */ export declare function attachMessageDescriptor(message: T, descriptor: MessageDescriptor | undefined): T; /** * Defines the static runtime operations emitted for a generated message. * * Generated message exports implement this interface. Application code * normally uses {@link MessageFns.create | create} for type-safe construction, * {@link MessageFns.encode | encode} followed by `finish()` for wire bytes, and * {@link MessageFns.decode | decode} for wire input. */ export interface MessageFns { /** Contains the fully qualified runtime type name. */ $type: TType; /** Contains optional reflection data used by SDK runtime helpers. */ $descriptor?: MessageDescriptor; /** Encodes a message into a supplied or new protobuf writer. */ encode(message: T, writer?: import('@bufbuild/protobuf/wire').BinaryWriter): import('@bufbuild/protobuf/wire').BinaryWriter; /** Decodes one message from wire bytes or a reader. */ decode(input: import('@bufbuild/protobuf/wire').BinaryReader | Uint8Array, length?: number): T; /** Converts protobuf JSON input to the generated TypeScript representation. */ fromJSON(object: any): T; /** * Converts a message to JSON. * * `json` uses standard protobuf JSON forms. `pb` exposes protobuf field * shapes for SDK compatibility where supported. */ toJSON(message: T, use?: 'json' | 'pb'): unknown; /** Creates a message from a deep partial value and applies field defaults. */ create>(base?: I): T; /** Converts a deep partial value to a complete generated message. */ fromPartial>(object: I): T; } /** * Identifies raw unknown-field bytes preserved during protobuf decoding. * * Generated decoders store the original bytes on this symbol when they find * unknown fields. Generated encoders write the bytes again. This supports * forward compatibility when an older SDK reads a message with newer fields. */ export declare const unknownFieldsSymbol: unique symbol; /** Lists values that {@link DeepPartial} treats as indivisible leaves. */ export type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined; /** * Makes nested message fields optional for generated * {@link MessageFns.create | create} and * {@link MessageFns.fromPartial | fromPartial} methods. * * A 64-bit integer also accepts a string or number. Use a string for values * outside JavaScript's safe integer range. */ export type DeepPartial = T extends Builtin ? T : T extends Long ? string | number | Long : T extends globalThis.Array ? globalThis.Array> : T extends ReadonlyArray ? ReadonlyArray> : T extends {} ? { [K in Exclude]?: DeepPartial; } : Partial; /** Returns `true` for every value except `null` and `undefined`. */ export declare function isSet(value: unknown): boolean; //# sourceMappingURL=core.d.ts.map