mirror of
https://github.com/movie-web/extension.git
synced 2025-09-13 18:13:25 +00:00
improve typings
This commit is contained in:
@@ -1,9 +1,14 @@
|
||||
import type { PlasmoMessaging } from '@plasmohq/messaging';
|
||||
|
||||
import type { BaseRequestBody } from '~types/request';
|
||||
import type { BaseRequest } from '~types/request';
|
||||
import type { BaseResponse } from '~types/response';
|
||||
import { validateDomainWhiteList } from '~utils/storage';
|
||||
|
||||
const handler: PlasmoMessaging.MessageHandler<BaseRequestBody> = async (req, res) => {
|
||||
type Response = BaseResponse<{
|
||||
version: string;
|
||||
}>;
|
||||
|
||||
const handler: PlasmoMessaging.MessageHandler<BaseRequest, Response> = async (req, res) => {
|
||||
try {
|
||||
await validateDomainWhiteList(req.body.requestDomain);
|
||||
|
||||
|
Reference in New Issue
Block a user