fix: duplicate api definition (#2522)

This commit is contained in:
Louis 2024-03-28 11:45:08 +07:00 committed by GitHub
parent 75eea1fdb2
commit 3b3eb119f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 0 additions and 30 deletions

View File

@ -37,8 +37,6 @@ const readdirSync = (...args: any[]) => globalThis.core.api?.readdirSync(...args
*/ */
const mkdir = (...args: any[]) => globalThis.core.api?.mkdir(...args) const mkdir = (...args: any[]) => globalThis.core.api?.mkdir(...args)
const mkdir = (...args: any[]) => global.core.api?.mkdir(...args)
/** /**
* Removes a directory at the specified path. * Removes a directory at the specified path.
* @returns {Promise<any>} A Promise that resolves when the directory is removed successfully. * @returns {Promise<any>} A Promise that resolves when the directory is removed successfully.

View File

@ -88,28 +88,4 @@ export class FSExt implements Processor {
}) })
}) })
} }
mkdir(path: string): Promise<void> {
return new Promise((resolve, reject) => {
fs.mkdir(path, { recursive: true }, (err) => {
if (err) {
reject(err)
} else {
resolve()
}
})
})
}
rmdir(path: string): Promise<void> {
return new Promise((resolve, reject) => {
fs.rm(path, { recursive: true }, (err) => {
if (err) {
reject(err)
} else {
resolve()
}
})
})
}
} }

View File

@ -95,8 +95,6 @@ export enum FileManagerRoute {
getUserHomePath = 'getUserHomePath', getUserHomePath = 'getUserHomePath',
fileStat = 'fileStat', fileStat = 'fileStat',
writeBlob = 'writeBlob', writeBlob = 'writeBlob',
mkdir = 'mkdir',
rm = 'rm',
} }
export type ApiFunction = (...args: any[]) => any export type ApiFunction = (...args: any[]) => any

View File

@ -9,8 +9,6 @@ import {
PromptTemplate, PromptTemplate,
} from '@janhq/core/node' } from '@janhq/core/node'
import decompress from 'decompress' import decompress from 'decompress'
import { SystemInformation } from '@janhq/core'
import { PromptTemplate } from '@janhq/core'
// Polyfill fetch with retry // Polyfill fetch with retry
const fetchRetry = fetchRT(fetch) const fetchRetry = fetchRT(fetch)