🔨 chore: fix type in some scripts (#8631)

* upgrade types

* fix types

* fix types
This commit is contained in:
Arvin Xu 2025-08-01 12:42:55 +08:00 committed by GitHub
parent 9b74e172a0
commit 29417d5e18
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 12 additions and 7 deletions

View file

@ -355,7 +355,7 @@
"stylelint": "^15.11.0",
"tsx": "~4.19.4",
"type-fest": "^4.41.0",
"typescript": "^5.8.3",
"typescript": "^5.9.2",
"unified": "^11.0.5",
"unist-util-visit": "^5.0.0",
"vite": "^5.4.19",

View file

@ -81,7 +81,7 @@ export const fetchImageAsFile = async (url: string, width: number) => {
const filename = Date.now().toString() + type;
// Step 3: Create a file from the blob
const file: File = new File([buffer], filename, {
const file: File = new File([buffer as ArrayBuffer], filename, {
lastModified: Date.now(),
type: type === '.webp' ? 'image/webp' : blob.type,
});

View file

@ -9,7 +9,8 @@ export const asyncClient = createTRPCClient<AsyncRouter>({
links: [
httpBatchLink({
fetch: isDesktop
? (input, init) => fetchWithDesktopRemoteRPC(input as string, init)
? // eslint-disable-next-line no-undef
(input, init) => fetchWithDesktopRemoteRPC(input as string, init as RequestInit)
: undefined,
maxURLLength: 2083,
transformer: superjson,

View file

@ -10,7 +10,8 @@ export const edgeClient = createTRPCClient<EdgeRouter>({
links: [
httpBatchLink({
fetch: isDesktop
? (input, init) => fetchWithDesktopRemoteRPC(input as string, init)
? // eslint-disable-next-line no-undef
(input, init) => fetchWithDesktopRemoteRPC(input as string, init as RequestInit)
: undefined,
headers: async () => {
// dynamic import to avoid circular dependency

View file

@ -17,12 +17,14 @@ const links = [
if (isDesktop) {
const { desktopRemoteRPCFetch } = await import('@/utils/electron/desktopRemoteRPCFetch');
const res = await desktopRemoteRPCFetch(input as string, init);
// eslint-disable-next-line no-undef
const res = await desktopRemoteRPCFetch(input as string, init as RequestInit);
if (res) return res;
}
const response = await fetch(input, init);
// eslint-disable-next-line no-undef
const response = await fetch(input, init as RequestInit);
if (response.ok) return response;

View file

@ -9,7 +9,8 @@ export const toolsClient = createTRPCClient<ToolsRouter>({
links: [
httpBatchLink({
fetch: isDesktop
? (input, init) => fetchWithDesktopRemoteRPC(input as string, init)
? // eslint-disable-next-line no-undef
(input, init) => fetchWithDesktopRemoteRPC(input as string, init as RequestInit)
: undefined,
headers: async () => {
// dynamic import to avoid circular dependency