improve typings

This commit is contained in:
Jorrin
2024-01-09 23:01:11 +01:00
parent dce0799213
commit f669b2d168
5 changed files with 32 additions and 10 deletions

View File

@@ -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);