diff --git a/src/core/packet/client.ts b/src/core/packet/client.ts index 88164cef..c00747a2 100644 --- a/src/core/packet/client.ts +++ b/src/core/packet/client.ts @@ -96,7 +96,7 @@ export class PacketClient { } } - async registerCallback(trace_id: string, type: string, callback: (json: RecvPacketData) => Promise): Promise { + private async registerCallback(trace_id: string, type: string, callback: (json: RecvPacketData) => Promise): Promise { this.cb.put(createHash('md5').update(trace_id).digest('hex') + type, callback); } @@ -113,7 +113,7 @@ export class PacketClient { this.websocket.send(JSON.stringify(initMessage)); } - async sendCommand(cmd: string, data: string, trace_id: string, rsp: boolean = false, timeout: number = 5000, sendcb: (json: RecvPacketData) => void = () => { + private async sendCommand(cmd: string, data: string, trace_id: string, rsp: boolean = false, timeout: number = 5000, sendcb: (json: RecvPacketData) => void = () => { }): Promise { return new Promise((resolve, reject) => { if (!this.isConnected || !this.websocket) { diff --git a/src/core/packet/proto/old/Message.ts b/src/core/packet/proto/old/Message.ts index 02a52afe..8eb7d3b4 100644 --- a/src/core/packet/proto/old/Message.ts +++ b/src/core/packet/proto/old/Message.ts @@ -1,3 +1,4 @@ +// TODO: refactor with NapProto import { MessageType, BinaryReader, ScalarType } from '@protobuf-ts/runtime'; export const BodyInner = new MessageType("BodyInner", [ @@ -45,4 +46,4 @@ export function decodeMessage(buffer: Uint8Array): any { export function decodeRecallGroup(buffer: Uint8Array): any { const reader = new BinaryReader(buffer); return RecallGroup.internalBinaryRead(reader, reader.len, { readUnknownField: true, readerFactory: () => new BinaryReader(buffer) }); -} \ No newline at end of file +} diff --git a/src/core/packet/proto/old/ProfileLike.ts b/src/core/packet/proto/old/ProfileLike.ts index 4cf22ad9..e79f089f 100644 --- a/src/core/packet/proto/old/ProfileLike.ts +++ b/src/core/packet/proto/old/ProfileLike.ts @@ -1,3 +1,4 @@ +// TODO: refactor with NapProto import { MessageType, BinaryReader, ScalarType, RepeatType } from '@protobuf-ts/runtime'; export const LikeDetail = new MessageType("likeDetail", [ @@ -55,4 +56,4 @@ export function decodeProfileLikeTip(buffer: Uint8Array): any { export function decodeSysMessage(buffer: Uint8Array): any { const reader = new BinaryReader(buffer); return SysMessage.internalBinaryRead(reader, reader.len, { readUnknownField: true, readerFactory: () => new BinaryReader(buffer) }); -} \ No newline at end of file +}