mirror of
https://github.com/NapNeko/NapCatQQ.git
synced 2026-02-12 16:00:27 +00:00
refactor: search file
This commit is contained in:
@@ -187,16 +187,22 @@ export class NTQQFileApi {
|
||||
}[]
|
||||
}[]
|
||||
};
|
||||
const [id, data] = await NTEventDispatch.CallNormalEvent<EventType, (params: OnListener) => void>(
|
||||
'NodeIKernelSearchService/searchFileWithKeywords',
|
||||
'NodeIKernelSearchListener/onSearchFileKeywordsResult',
|
||||
1,
|
||||
10000,
|
||||
(arg): boolean => { return id == data.searchId },
|
||||
keys,
|
||||
12
|
||||
);
|
||||
return data.resultItems[0];
|
||||
// (params: OnListener) => void 'NodeIKernelSearchListener/onSearchFileKeywordsResult',
|
||||
// 1,
|
||||
// 10000,
|
||||
// (arg): boolean => { return id == data.searchId },
|
||||
// keys,
|
||||
// 12
|
||||
const Event = await NTEventDispatch.CreatEventFunction<EventType>('NodeIKernelSearchService/searchFileWithKeywords');
|
||||
let id = '';
|
||||
const [Listener] = await NTEventDispatch.RegisterListen<(params: OnListener) => void>('NodeIKernelSearchListener/onSearchFileKeywordsResult', 1, 5000, (params) => {
|
||||
if (id !== '' && params.searchId == id) {
|
||||
return true
|
||||
}
|
||||
return false;
|
||||
});
|
||||
id = await Event!(keys, 12);
|
||||
return Listener.resultItems[0];
|
||||
}
|
||||
static async getImageUrl(element: PicElement) {
|
||||
if (!element) {
|
||||
|
||||
@@ -8,6 +8,23 @@ export enum UrlFileDownloadType {
|
||||
KURLFILEDOWNLOADCOMMON,
|
||||
KURLFILEDOWNLOADINSTALLAPP
|
||||
}
|
||||
export enum RMBizTypeEnum {
|
||||
KUNKNOWN,
|
||||
KC2CFILE,
|
||||
KGROUPFILE,
|
||||
KC2CPIC,
|
||||
KGROUPPIC,
|
||||
KDISCPIC,
|
||||
KC2CVIDEO,
|
||||
KGROUPVIDEO,
|
||||
KC2CPTT,
|
||||
KGROUPPTT,
|
||||
KFEEDCOMMENTPIC,
|
||||
KGUILDFILE,
|
||||
KGUILDPIC,
|
||||
KGUILDPTT,
|
||||
KGUILDVIDEO
|
||||
}
|
||||
export interface CommonFileInfo {
|
||||
bizType: number;
|
||||
chatType: number;
|
||||
@@ -227,13 +244,25 @@ export interface NodeIKernelRichMediaService {
|
||||
|
||||
cancelSearcheGroupFile(arg1: unknown, arg2: unknown, arg3: unknown): unknown;
|
||||
|
||||
onlyDownloadFile(arg1: unknown, arg2: unknown, arg3: unknown): unknown;
|
||||
onlyDownloadFile(peer: Peer, arg2: unknown, arg3: Array<{
|
||||
fileId: string,
|
||||
fileName: string,
|
||||
fileSize: string,
|
||||
fileModelId: string
|
||||
}
|
||||
>): unknown;
|
||||
|
||||
onlyUploadFile(arg1: unknown, arg2: unknown): unknown;
|
||||
|
||||
isExtraLargePic(arg1: unknown, arg2: unknown, arg3: unknown): unknown;
|
||||
|
||||
uploadRMFileWithoutMsg(arg: unknown): unknown;
|
||||
uploadRMFileWithoutMsg(arg: {
|
||||
bizType: RMBizTypeEnum,
|
||||
filePath: string,
|
||||
peerUid: string,
|
||||
transferId: string
|
||||
useNTV2: string
|
||||
}): Promise<unknown>;
|
||||
|
||||
isNull(): boolean;
|
||||
}
|
||||
@@ -51,7 +51,7 @@ export interface NodeIKernelSearchService {
|
||||
|
||||
cancelSearchMsgWithKeywords(...args: any[]): unknown;// needs 3 arguments
|
||||
|
||||
searchFileWithKeywords(keywords: string[], source: number): Promise<unknown>;// needs 2 arguments
|
||||
searchFileWithKeywords(keywords: string[], source: number): Promise<string>;// needs 2 arguments
|
||||
|
||||
searchMoreFileWithKeywordsr(...args: any[]): unknown;// needs 1 arguments
|
||||
|
||||
|
||||
Reference in New Issue
Block a user