deploy: v0.12 fix 存档key名

This commit is contained in:
2026-06-24 03:09:02 +00:00
parent 7a08d49fe3
commit e0a5281119
58743 changed files with 7297269 additions and 39505 deletions
+121
View File
@@ -0,0 +1,121 @@
/// <reference types="node" />
import type { MessageSender, FSWatchEvent } from '../messages';
declare type FSEncoding = BufferEncoding | 'buffer';
export declare type FileContent = Uint8Array | string;
export interface FilesMap {
[filePath: string]: FileContent;
}
export interface FileWatchOptions {
recursive?: boolean;
}
export declare type FileWatchEvent = Omit<FSWatchEvent, 'watcherId'>;
export interface IFileStats {
type: 'dir' | 'file' | 'link';
size: number;
ino: number;
atimeMs: number;
mtimeMs: number;
ctimeMs: number;
blocks: number;
mode: number;
}
export interface FileSystemEvents {
'fs/init': {
files: FilesMap;
};
'fs/readFile': [{
path: string;
encoding?: undefined;
}, {
data: Uint8Array;
}] | [{
path: string;
encoding?: 'buffer';
}, {
data: Uint8Array;
}] | [{
path: string;
encoding?: FSEncoding;
}, {
data: string | FileContent;
}];
'fs/writeFile': {
path: string;
content: FileContent;
encoding?: BufferEncoding;
recursive?: boolean;
};
'fs/readdir': [
{
path: string;
},
{
data: string[];
}
];
'fs/stat': [
{
path: string;
},
{
data: IFileStats;
}
];
'fs/mkdir': {
path: string;
recursive?: boolean;
};
'fs/rm': {
path: string;
force?: boolean;
recursive?: boolean;
};
'fs/watch': {
watcherId: string;
includes: string[];
excludes: string[];
};
'fs/unwatch': {
watcherId: string;
};
}
declare type WriteFileOptions = BufferEncoding | {
encoding?: BufferEncoding;
recursive?: boolean;
};
export declare class FileSystemApi {
private readonly channel;
constructor(channel: MessageSender);
/**
* Initialize the File System worker with the files.
*/
init(files: FilesMap): Promise<void>;
/**
* Read a file at the given path.
*/
readFile(path: string, encoding?: undefined): Promise<Uint8Array>;
readFile(path: string, encoding: 'buffer'): Promise<Uint8Array>;
readFile(path: string, encoding: BufferEncoding): Promise<string>;
/**
* Write a file at the given path.
* Replaces the file content if the file already exists.
*/
writeFile(path: string, content: FileContent): Promise<void>;
writeFile(path: string, content: FileContent, options: WriteFileOptions): Promise<void>;
readdir(path: string): Promise<string[]>;
mkdir(path: string, options?: {
recursive?: boolean;
}): Promise<void>;
stat(path: string): Promise<IFileStats>;
rm(path: string, options?: {
force?: boolean;
recursive?: boolean;
}): Promise<void>;
/**
* Subscribe to changes at the given file or directory.
*/
watch(includes: string[], excludes: string[], listener?: (evt?: FileWatchEvent) => void): Promise<{
dispose: () => Promise<void>;
}>;
}
export {};
+22
View File
@@ -0,0 +1,22 @@
import type { MessageSender } from '../messages';
export interface PreviewEvents {
'preview/get/info': [
{
port?: number;
sourceShellId?: string;
},
PreviewInfo
];
}
export declare type PreviewInfo = {
url: string;
sourceShellId: string;
port: number;
};
export declare class PreviewApi {
private readonly channel;
constructor(channel: MessageSender);
private waitFor;
getByShellId(sourceShellId: string, timeout?: number): Promise<PreviewInfo>;
waitForPort(port: number, timeout?: number): Promise<PreviewInfo>;
}
+57
View File
@@ -0,0 +1,57 @@
import { Emitter } from 'strict-event-emitter';
import type { MessageSender, WorkerStatusUpdate } from '../messages';
export interface ShellEvents {
'shell/runCommand': [
{
command: string;
args: Array<string>;
options: ShellCommandOptions;
},
ShellInfo
];
'shell/exit': ShellInfo;
'shell/stdin': {
data: string | Uint8Array;
workerId: string;
};
}
export interface ShellCommandOptions {
cwd?: string;
env?: Record<string, string>;
}
export declare type ShellInfo = {
id: string;
};
export declare class ShellApi {
private readonly channel;
constructor(channel: MessageSender);
create(): ShellProcess;
}
export declare class ShellProcess {
private readonly channel;
id?: string;
state: 'running' | 'idle';
stdout: Emitter<{
data: [string];
}>;
stderr: Emitter<{
data: [string];
}>;
stdin: {
write: (data: string | Uint8Array) => Promise<void>;
};
constructor(channel: MessageSender);
private forwardStdEvents;
/**
* Evaluates a given module in the File
*/
runCommand(command: string, args: Array<string>, options?: ShellCommandOptions): Promise<ShellInfo>;
on(message: 'exit', listener: (exitCode: number, error?: {
message: string;
}) => void): Promise<void>;
on(message: 'progress', listener: (status: WorkerStatusUpdate) => void): Promise<void>;
/**
* Terminates the shell process.
*/
kill(): Promise<void>;
}