mirror of
https://github.com/lobehub/lobehub
synced 2026-04-21 17:47:27 +00:00
🔨 chore: fix type in some scripts (#8631)
* upgrade types * fix types * fix types
This commit is contained in:
parent
9b74e172a0
commit
29417d5e18
6 changed files with 12 additions and 7 deletions
|
|
@ -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",
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
});
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue