feat: update plugins
Signed-off-by: MiaoWoo <admin@yumc.pw>
This commit is contained in:
parent
54d12749dc
commit
e442da5b3b
@ -17,6 +17,7 @@ declare global {
|
|||||||
function engineLoad(str: string): any;
|
function engineLoad(str: string): any;
|
||||||
interface Core {
|
interface Core {
|
||||||
getClass(name: String): any;
|
getClass(name: String): any;
|
||||||
|
getProxyClass(): any;
|
||||||
getInstance(): any;
|
getInstance(): any;
|
||||||
read(path: string): string;
|
read(path: string): string;
|
||||||
save(path: string, content: string): void;
|
save(path: string, content: string): void;
|
||||||
|
@ -12,8 +12,8 @@ const StandardCopyOption = Java.type("java.nio.file.StandardCopyOption");
|
|||||||
/**
|
/**
|
||||||
* 用文件分割符合并路径
|
* 用文件分割符合并路径
|
||||||
*/
|
*/
|
||||||
export function concat() {
|
export function concat(...args: string[]) {
|
||||||
return Array.prototype.join.call(arguments, separatorChar);
|
return args.join(separatorChar);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -23,12 +23,12 @@ export function concat() {
|
|||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
export function file(...opts: any[]): any {
|
export function file(...opts: any[]): any {
|
||||||
if (!arguments[0]) {
|
if (!opts[0]) {
|
||||||
console.warn("文件名称不得为 undefined 或者 null !");
|
console.warn("文件名称不得为 undefined 或者 null !");
|
||||||
}
|
}
|
||||||
switch (arguments.length) {
|
switch (opts.length) {
|
||||||
case 1:
|
case 1:
|
||||||
var f = arguments[0];
|
var f = opts[0];
|
||||||
if (f instanceof File) {
|
if (f instanceof File) {
|
||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
@ -40,7 +40,7 @@ export function file(...opts: any[]): any {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return new File(file(arguments[0]), arguments[1]);
|
return new File(file(opts[0]), opts[1]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -48,7 +48,7 @@ export function file(...opts: any[]): any {
|
|||||||
* 创建目录
|
* 创建目录
|
||||||
* @param path
|
* @param path
|
||||||
*/
|
*/
|
||||||
export function mkdirs(path) {
|
export function mkdirs(path: any) {
|
||||||
// noinspection JSUnresolvedVariable
|
// noinspection JSUnresolvedVariable
|
||||||
file(path).parentFile.mkdirs();
|
file(path).parentFile.mkdirs();
|
||||||
}
|
}
|
||||||
@ -57,7 +57,7 @@ export function mkdirs(path) {
|
|||||||
* 创建文件
|
* 创建文件
|
||||||
* @param file
|
* @param file
|
||||||
*/
|
*/
|
||||||
export function create(path) {
|
export function create(path: any) {
|
||||||
var f = file(path);
|
var f = file(path);
|
||||||
if (!f.exists()) {
|
if (!f.exists()) {
|
||||||
mkdirs(f);
|
mkdirs(f);
|
||||||
@ -70,7 +70,7 @@ export function create(path) {
|
|||||||
* @param file
|
* @param file
|
||||||
* @returns {*}
|
* @returns {*}
|
||||||
*/
|
*/
|
||||||
export function path(f) {
|
export function path(f: any) {
|
||||||
return file(f).canonicalPath;
|
return file(f).canonicalPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ export function path(f) {
|
|||||||
* @param target 目标文件
|
* @param target 目标文件
|
||||||
* @param override 是否覆盖
|
* @param override 是否覆盖
|
||||||
*/
|
*/
|
||||||
export function copy(inputStream, target, override) {
|
export function copy(inputStream: any, target: any, override: any) {
|
||||||
Files.copy(inputStream, target.toPath(), StandardCopyOption[override ? 'REPLACE_EXISTING' : 'ATOMIC_MOVE']);
|
Files.copy(inputStream, target.toPath(), StandardCopyOption[override ? 'REPLACE_EXISTING' : 'ATOMIC_MOVE']);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user