Files
NapCatQQ/.pnpm-store/v3/files/43/9bfcb2b1ecd5bf34eaf26464ee203f8b0d1e6d5fc2715ec7817742de8643229f48735ead14d911123392a311e266e0c1a50e31661ad42a2d3130fb87accd14
T
TanTan e311ca3275
Build NapCat Artifacts / Windows Loader Test (push) Canceled after 0s
Build NapCat Artifacts / Type Check & Test (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Framework (push) Canceled after 0s
Build NapCat Artifacts / Build NapCat.Shell (push) Canceled after 0s
docs: 仓库链接指向本镜像仓库
2026-11-13 09:25:58 +08:00

28 lines
1.4 KiB
Plaintext

import type { JsonValue } from "./json-typings";
import type { JsonWriteOptions } from "./json-format-contract";
import type { EnumInfo, FieldInfo, PartialMessageInfo } from "./reflection-info";
import { ScalarType } from "./reflection-info";
import type { IMessageType } from "./message-type-contract";
/**
* Writes proto3 messages in canonical JSON format using reflection
* information.
*
* https://developers.google.com/protocol-buffers/docs/proto3#json
*/
export declare class ReflectionJsonWriter {
private readonly fields;
constructor(info: PartialMessageInfo);
/**
* Converts the message to a JSON object, based on the field descriptors.
*/
write<T extends object>(message: T, options: JsonWriteOptions): JsonValue;
field(field: FieldInfo, value: unknown, options: JsonWriteOptions): JsonValue | undefined;
/**
* Returns `null` as the default for google.protobuf.NullValue.
*/
enum(type: EnumInfo, value: unknown, fieldName: string, optional: boolean, emitDefaultValues: boolean, enumAsInteger: boolean): JsonValue | undefined;
message(type: IMessageType<any>, value: unknown, fieldName: string, options: JsonWriteOptions): JsonValue | undefined;
scalar(type: ScalarType, value: unknown, fieldName: string, optional: false, emitDefaultValues: boolean): JsonValue;
scalar(type: ScalarType, value: unknown, fieldName: string, optional: boolean, emitDefaultValues: boolean): JsonValue | undefined;
}