mirror of
https://git.um-react.app/um/um-react.git
synced 2026-11-27 23:56:59 +00:00
- Added a new `actions.ts` file defining `WorkerActionMap` for better type management of worker actions. - Updated `client.ts`, `worker.ts`, and `decrypt.ts` to utilize the new action types, enhancing type safety. - Refactored `DecryptCommandPayload` to rename `id` to `fileId` for clarity and consistency. - Adjusted various components to align with the new payload structure and improved error handling in the worker event bus. - Enhanced tests to ensure compatibility with the new action type definitions and payload structures.
22 lines
807 B
TypeScript
22 lines
807 B
TypeScript
import type { DecryptionResult } from './constants';
|
|
import type {
|
|
DecryptCommandPayload,
|
|
FetchMusicExNamePayload,
|
|
GetQingTingFMDeviceKeyPayload,
|
|
ParseKugouHeaderPayload,
|
|
ParseKugouHeaderResponse,
|
|
ParseKuwoHeaderPayload,
|
|
ParseKuwoHeaderResponse,
|
|
} from './types';
|
|
|
|
export type WorkerActionMap = {
|
|
DECRYPT: { req: DecryptCommandPayload; res: DecryptionResult };
|
|
FIND_QMC_MUSICEX_NAME: { req: FetchMusicExNamePayload; res: string | null };
|
|
KUWO_PARSE_HEADER: { req: ParseKuwoHeaderPayload; res: ParseKuwoHeaderResponse };
|
|
KUGOU_PARSE_HEADER: { req: ParseKugouHeaderPayload; res: ParseKugouHeaderResponse };
|
|
QINGTING_FM_GET_DEVICE_KEY: { req: GetQingTingFMDeviceKeyPayload; res: string };
|
|
VERSION: { req: null; res: string };
|
|
};
|
|
|
|
export type WorkerActionName = keyof WorkerActionMap;
|