UNPKG

@open-audio-stack/core

Version:
56 lines (55 loc) 3.39 kB
import { GlobOptionsWithFileTypesFalse } from 'glob'; import { PackageInterface } from '../types/Package.js'; import { PluginFile } from '../types/Plugin.js'; import { PresetFile } from '../types/Preset.js'; import { ProjectFile } from '../types/Project.js'; import { ZodIssue } from 'zod'; import { SystemType } from '../types/SystemType.js'; export declare function isSafeArchiveEntryPath(entryName: string, targetRoot: string): boolean; export declare function archiveExtract(filePath: string, dirPath: string): Promise<void>; export declare function dirApp(dirName?: string): string; export declare function dirContains(parentDir: string, childDir: string): boolean; export declare function dirCreate(dir: string): string | false; export declare function dirDelete(dir: string): false | void; export declare function dirEmpty(dir: string): boolean; export declare function dirExists(dir: string): boolean; export declare function dirIs(dir: string): boolean; export declare function dirMove(dir: string, dirNew: string): void | boolean; export declare function dirOpen(dir: string): Buffer<ArrayBuffer>; export declare function dirPackage(pkg: PackageInterface): string; export declare function dirPlugins(): string; export declare function dirPresets(): string; export declare function dirProjects(): string; export declare function dirApps(): string; export declare function dirRead(dir: string, options?: GlobOptionsWithFileTypesFalse): string[]; export declare function dirRename(dir: string, dirNew: string): void | boolean; export declare function fileCreate(filePath: string, data: string | Buffer): void; export declare function fileCreateJson(filePath: string, data: object): void; export declare function fileCreateYaml(filePath: string, data: object): void; export declare function fileDate(filePath: string): Date; export declare function fileDelete(filePath: string): boolean | void; export declare function fileExec(filePath: string): void; export declare function fileExists(filePath: string): boolean; export declare function fileHash(filePath: string, algorithm?: string): Promise<string>; export declare function fileInstall(filePath: string): Buffer<ArrayBuffer>; export declare function fileMove(filePath: string, newPath: string): void | boolean; export declare function filesMove(dirSource: string, dirTarget: string, dirSub: string, formatDir: Record<string, string>): string[]; export declare function fileOpen(filePath: string, options?: string[]): import("child_process").ChildProcess | Buffer<ArrayBuffer>; export declare function fileRead(filePath: string): string; export declare function fileReadJson(filePath: string): any; export declare function fileReadString(filePath: string): string; export declare function fileReadYaml(filePath: string): unknown; export declare function fileSize(filePath: string): number; export declare function isAdmin(): boolean; export declare function fileValidateMetadata(filePath: string, fileMetadata: PluginFile | PresetFile | ProjectFile): Promise<ZodIssue[]>; export declare function getPlatform(): SystemType; export interface AdminPayload { appDir: string; operation: string; type: string; id: string; version?: string; log?: boolean; } export declare function runCliAsAdmin(payload: AdminPayload): Promise<void>; export declare function zipCreate(filesPath: string, zipPath: string): void;