@codingame/monaco-vscode-files-service-override 1.82.4 → 1.82.5-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/files.d.ts +101 -0
- package/index.d.ts +4 -2
- package/index.js +2 -2
- package/package.json +2 -2
- package/vscode/src/vs/base/browser/indexedDB.d.ts +17 -0
- package/vscode/src/vs/platform/files/browser/htmlFileSystemProvider.d.ts +43 -0
- package/vscode/src/vs/platform/files/common/inMemoryFilesystemProvider.d.ts +50 -0
package/files.d.ts
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { IEditorOverrideServices } from 'vscode/vscode/vs/editor/standalone/browser/standaloneServices';
|
|
2
|
+
import { Emitter, Event } from 'vscode/vscode/vs/base/common/event';
|
|
3
|
+
import { Disposable, IDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
5
|
+
import { FileType, IStat, IFileSystemProviderWithFileReadWriteCapability, IFileChange, IFileSystemProvider, FileSystemProviderCapabilities, FileChangeType, IFileWriteOptions, IWatchOptions, IFileDeleteOptions, IFileOverwriteOptions } from 'vscode/vscode/vs/platform/files/common/files';
|
|
6
|
+
export { FileChangeType, FilePermission, FileSystemProviderCapabilities, FileSystemProviderError, FileSystemProviderErrorCode, FileType, IFileChange, IFileDeleteOptions, IFileOverwriteOptions, IFileSystemProviderWithFileReadWriteCapability, IFileWriteOptions, IStat, IWatchOptions } from 'vscode/vscode/vs/platform/files/common/files';
|
|
7
|
+
|
|
8
|
+
declare abstract class RegisteredFile {
|
|
9
|
+
uri: URI;
|
|
10
|
+
private readonly;
|
|
11
|
+
private ctime;
|
|
12
|
+
private mtime;
|
|
13
|
+
readonly type: FileType;
|
|
14
|
+
protected _onDidChange: Emitter<void>;
|
|
15
|
+
onDidChange: Event<void>;
|
|
16
|
+
protected _onDidDelete: Emitter<void>;
|
|
17
|
+
onDidDelete: Event<void>;
|
|
18
|
+
protected _onDidRename: Emitter<{
|
|
19
|
+
from: URI;
|
|
20
|
+
to: URI;
|
|
21
|
+
}>;
|
|
22
|
+
onDidRename: Event<{
|
|
23
|
+
from: URI;
|
|
24
|
+
to: URI;
|
|
25
|
+
}>;
|
|
26
|
+
constructor(uri: URI, readonly: boolean);
|
|
27
|
+
stats(): Promise<IStat>;
|
|
28
|
+
getSize(): Promise<number>;
|
|
29
|
+
abstract read(): Promise<string | Uint8Array>;
|
|
30
|
+
abstract write(content: string): Promise<void>;
|
|
31
|
+
delete(): Promise<void>;
|
|
32
|
+
rename(to: URI): Promise<void>;
|
|
33
|
+
}
|
|
34
|
+
declare class RegisteredReadOnlyFile extends RegisteredFile {
|
|
35
|
+
read: () => Promise<string | Uint8Array>;
|
|
36
|
+
constructor(uri: URI, read: () => Promise<string | Uint8Array>);
|
|
37
|
+
write(): Promise<void>;
|
|
38
|
+
delete(): Promise<void>;
|
|
39
|
+
rename(): Promise<void>;
|
|
40
|
+
}
|
|
41
|
+
declare class RegisteredMemoryFile extends RegisteredFile {
|
|
42
|
+
private content;
|
|
43
|
+
constructor(uri: URI, content: string);
|
|
44
|
+
read(): Promise<string | Uint8Array>;
|
|
45
|
+
write(content: string): Promise<void>;
|
|
46
|
+
}
|
|
47
|
+
declare class RegisteredFileSystemProvider extends Disposable implements IFileSystemProviderWithFileReadWriteCapability {
|
|
48
|
+
private files;
|
|
49
|
+
capabilities: number;
|
|
50
|
+
constructor(readonly: boolean);
|
|
51
|
+
onDidChangeCapabilities: Event<any>;
|
|
52
|
+
_onDidChangeFile: Emitter<readonly IFileChange[]>;
|
|
53
|
+
onDidChangeFile: Event<readonly IFileChange[]>;
|
|
54
|
+
registerFile(file: RegisteredFile): IDisposable;
|
|
55
|
+
stat(resource: URI): Promise<IStat>;
|
|
56
|
+
readdir(resource: URI): Promise<[string, FileType][]>;
|
|
57
|
+
readFile(resource: URI): Promise<Uint8Array>;
|
|
58
|
+
watch(): IDisposable;
|
|
59
|
+
writeFile(resource: URI, content: Uint8Array): Promise<void>;
|
|
60
|
+
delete(resource: URI): Promise<void>;
|
|
61
|
+
rename(from: URI, to: URI): Promise<void>;
|
|
62
|
+
mkdir(): Promise<never>;
|
|
63
|
+
}
|
|
64
|
+
declare class DelegateFileSystemProvider implements IFileSystemProvider {
|
|
65
|
+
private options;
|
|
66
|
+
constructor(options: {
|
|
67
|
+
delegate: IFileSystemProvider;
|
|
68
|
+
toDelegate: (uri: URI) => URI;
|
|
69
|
+
fromDeletate: (uri: URI) => URI;
|
|
70
|
+
});
|
|
71
|
+
get capabilities(): FileSystemProviderCapabilities;
|
|
72
|
+
onDidChangeCapabilities: Event<void>;
|
|
73
|
+
onDidChangeFile: Event<{
|
|
74
|
+
type: FileChangeType;
|
|
75
|
+
resource: URI;
|
|
76
|
+
}[]>;
|
|
77
|
+
readFile: ((resource: URI) => Promise<Uint8Array>) | undefined;
|
|
78
|
+
writeFile: ((resource: URI, content: Uint8Array, opts: IFileWriteOptions) => Promise<void>) | undefined;
|
|
79
|
+
watch(resource: URI, opts: IWatchOptions): IDisposable;
|
|
80
|
+
stat(resource: URI): Promise<IStat>;
|
|
81
|
+
mkdir(resource: URI): Promise<void>;
|
|
82
|
+
readdir(resource: URI): Promise<[string, FileType][]>;
|
|
83
|
+
delete(resource: URI, opts: IFileDeleteOptions): Promise<void>;
|
|
84
|
+
rename(from: URI, to: URI, opts: IFileOverwriteOptions): Promise<void>;
|
|
85
|
+
}
|
|
86
|
+
declare function getServiceOverride(): IEditorOverrideServices;
|
|
87
|
+
declare function registerExtensionFile(extensionLocation: URI, filePath: string, getContent: () => Promise<string | Uint8Array>): IDisposable;
|
|
88
|
+
/**
|
|
89
|
+
* Register a file system overlay
|
|
90
|
+
*
|
|
91
|
+
* By default, a memory filesystem is used to read and write file
|
|
92
|
+
*
|
|
93
|
+
* This method allows to register another fileSystemProvider in front OR behind the default memory one.
|
|
94
|
+
*
|
|
95
|
+
* The default one is registered as priority: 0, so:
|
|
96
|
+
* - any provider registered with a positive priority will be in front of the default one
|
|
97
|
+
* - any provider registered with a negative priority will be behind the default one
|
|
98
|
+
*/
|
|
99
|
+
declare function registerFileSystemOverlay(priority: number, provider: IFileSystemProviderWithFileReadWriteCapability): IDisposable;
|
|
100
|
+
|
|
101
|
+
export { DelegateFileSystemProvider, RegisteredFile, RegisteredFileSystemProvider, RegisteredMemoryFile, RegisteredReadOnlyFile, getServiceOverride as default, registerExtensionFile, registerFileSystemOverlay };
|
package/index.d.ts
CHANGED
|
@@ -1,2 +1,4 @@
|
|
|
1
|
-
export { default } from '
|
|
2
|
-
export
|
|
1
|
+
export { DelegateFileSystemProvider, RegisteredFile, RegisteredFileSystemProvider, RegisteredMemoryFile, RegisteredReadOnlyFile, default, registerExtensionFile, registerFileSystemOverlay } from './files.js';
|
|
2
|
+
export { InMemoryFileSystemProvider } from './vscode/src/vs/platform/files/common/inMemoryFilesystemProvider.js';
|
|
3
|
+
export { FileChangeType, FilePermission, FileSystemProviderCapabilities, FileSystemProviderError, FileSystemProviderErrorCode, FileType, IFileChange, IFileDeleteOptions, IFileOverwriteOptions, IFileSystemProviderWithFileReadWriteCapability, IFileWriteOptions, IStat, IWatchOptions } from 'vscode/vscode/vs/platform/files/common/files';
|
|
4
|
+
export { HTMLFileSystemProvider } from './vscode/src/vs/platform/files/browser/htmlFileSystemProvider.js';
|
package/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
2
|
-
export
|
|
1
|
+
export * from 'vscode/service-override/files';
|
|
2
|
+
export { default } from 'vscode/service-override/files';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-files-service-override",
|
|
3
|
-
"version": "1.82.
|
|
3
|
+
"version": "1.82.5-next.0",
|
|
4
4
|
"keywords": [],
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "CodinGame",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"module": "index.js",
|
|
19
19
|
"types": "index.d.ts",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"vscode": "npm:@codingame/monaco-vscode-api@1.82.
|
|
21
|
+
"vscode": "npm:@codingame/monaco-vscode-api@1.82.5-next.0",
|
|
22
22
|
"monaco-editor": "0.43.0"
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
declare class IndexedDB {
|
|
2
|
+
private readonly name;
|
|
3
|
+
static create(name: string, version: number | undefined, stores: string[]): Promise<IndexedDB>;
|
|
4
|
+
private static openDatabase;
|
|
5
|
+
private static doOpenDatabase;
|
|
6
|
+
private static deleteDatabase;
|
|
7
|
+
private database;
|
|
8
|
+
private readonly pendingTransactions;
|
|
9
|
+
constructor(database: IDBDatabase, name: string);
|
|
10
|
+
hasPendingTransactions(): boolean;
|
|
11
|
+
close(): void;
|
|
12
|
+
runInTransaction<T>(store: string, transactionMode: IDBTransactionMode, dbRequestFn: (store: IDBObjectStore) => IDBRequest<T>[]): Promise<T[]>;
|
|
13
|
+
runInTransaction<T>(store: string, transactionMode: IDBTransactionMode, dbRequestFn: (store: IDBObjectStore) => IDBRequest<T>): Promise<T>;
|
|
14
|
+
getKeyValues<V>(store: string, isValid: (value: unknown) => value is V): Promise<Map<string, V>>;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export { IndexedDB };
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
2
|
+
import { CancellationToken } from 'vscode/vscode/vs/base/common/cancellation';
|
|
3
|
+
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
4
|
+
import { IDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
5
|
+
import { ReadableStreamEvents } from 'vscode/vscode/vs/base/common/stream';
|
|
6
|
+
import { IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithFileReadStreamCapability, FileSystemProviderCapabilities, IStat, FileType, IFileReadStreamOptions, IFileWriteOptions, IFileDeleteOptions, IFileOverwriteOptions, IWatchOptions } from 'vscode/vscode/vs/platform/files/common/files';
|
|
7
|
+
import { IndexedDB } from '../../../base/browser/indexedDB.js';
|
|
8
|
+
import { ILogService } from 'vscode/vscode/vs/platform/log/common/log';
|
|
9
|
+
|
|
10
|
+
declare class HTMLFileSystemProvider implements IFileSystemProviderWithFileReadWriteCapability, IFileSystemProviderWithFileReadStreamCapability {
|
|
11
|
+
private indexedDB;
|
|
12
|
+
private readonly store;
|
|
13
|
+
private logService;
|
|
14
|
+
readonly onDidChangeCapabilities: Event<any>;
|
|
15
|
+
readonly onDidChangeFile: Event<any>;
|
|
16
|
+
private extUri;
|
|
17
|
+
private _capabilities;
|
|
18
|
+
get capabilities(): FileSystemProviderCapabilities;
|
|
19
|
+
constructor(indexedDB: IndexedDB | undefined, store: string, logService: ILogService);
|
|
20
|
+
stat(resource: URI): Promise<IStat>;
|
|
21
|
+
readdir(resource: URI): Promise<[string, FileType][]>;
|
|
22
|
+
readFileStream(resource: URI, opts: IFileReadStreamOptions, token: CancellationToken): ReadableStreamEvents<Uint8Array>;
|
|
23
|
+
readFile(resource: URI): Promise<Uint8Array>;
|
|
24
|
+
writeFile(resource: URI, content: Uint8Array, opts: IFileWriteOptions): Promise<void>;
|
|
25
|
+
mkdir(resource: URI): Promise<void>;
|
|
26
|
+
delete(resource: URI, opts: IFileDeleteOptions): Promise<void>;
|
|
27
|
+
rename(from: URI, to: URI, opts: IFileOverwriteOptions): Promise<void>;
|
|
28
|
+
watch(resource: URI, opts: IWatchOptions): IDisposable;
|
|
29
|
+
private readonly _files;
|
|
30
|
+
private readonly _directories;
|
|
31
|
+
registerFileHandle(handle: FileSystemFileHandle): Promise<URI>;
|
|
32
|
+
registerDirectoryHandle(handle: FileSystemDirectoryHandle): Promise<URI>;
|
|
33
|
+
get directories(): Iterable<FileSystemDirectoryHandle>;
|
|
34
|
+
private registerHandle;
|
|
35
|
+
getHandle(resource: URI): Promise<FileSystemHandle | undefined>;
|
|
36
|
+
private getFileHandle;
|
|
37
|
+
private getDirectoryHandle;
|
|
38
|
+
private doGetHandle;
|
|
39
|
+
private toFileSystemProviderError;
|
|
40
|
+
private createFileSystemProviderError;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export { HTMLFileSystemProvider };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Event } from 'vscode/vscode/vs/base/common/event';
|
|
2
|
+
import { Disposable, IDisposable } from 'vscode/vscode/vs/base/common/lifecycle';
|
|
3
|
+
import { URI } from 'vscode/vscode/vs/base/common/uri';
|
|
4
|
+
import { IFileSystemProviderWithFileReadWriteCapability, FileSystemProviderCapabilities, IStat, FileType, IFileWriteOptions, IFileOverwriteOptions, IFileDeleteOptions, IFileChange, IWatchOptions } from 'vscode/vscode/vs/platform/files/common/files';
|
|
5
|
+
|
|
6
|
+
declare class File implements IStat {
|
|
7
|
+
type: FileType.File;
|
|
8
|
+
ctime: number;
|
|
9
|
+
mtime: number;
|
|
10
|
+
size: number;
|
|
11
|
+
name: string;
|
|
12
|
+
data?: Uint8Array;
|
|
13
|
+
constructor(name: string);
|
|
14
|
+
}
|
|
15
|
+
declare class Directory implements IStat {
|
|
16
|
+
type: FileType.Directory;
|
|
17
|
+
ctime: number;
|
|
18
|
+
mtime: number;
|
|
19
|
+
size: number;
|
|
20
|
+
name: string;
|
|
21
|
+
entries: Map<string, File | Directory>;
|
|
22
|
+
constructor(name: string);
|
|
23
|
+
}
|
|
24
|
+
declare class InMemoryFileSystemProvider extends Disposable implements IFileSystemProviderWithFileReadWriteCapability {
|
|
25
|
+
private _onDidChangeCapabilities;
|
|
26
|
+
readonly onDidChangeCapabilities: Event<void>;
|
|
27
|
+
private _capabilities;
|
|
28
|
+
get capabilities(): FileSystemProviderCapabilities;
|
|
29
|
+
setReadOnly(readonly: boolean): void;
|
|
30
|
+
root: Directory;
|
|
31
|
+
stat(resource: URI): Promise<IStat>;
|
|
32
|
+
readdir(resource: URI): Promise<[string, FileType][]>;
|
|
33
|
+
readFile(resource: URI): Promise<Uint8Array>;
|
|
34
|
+
writeFile(resource: URI, content: Uint8Array, opts: IFileWriteOptions): Promise<void>;
|
|
35
|
+
rename(from: URI, to: URI, opts: IFileOverwriteOptions): Promise<void>;
|
|
36
|
+
delete(resource: URI, opts: IFileDeleteOptions): Promise<void>;
|
|
37
|
+
mkdir(resource: URI): Promise<void>;
|
|
38
|
+
private _lookup;
|
|
39
|
+
private _lookupAsDirectory;
|
|
40
|
+
private _lookupAsFile;
|
|
41
|
+
private _lookupParentDirectory;
|
|
42
|
+
private readonly _onDidChangeFile;
|
|
43
|
+
readonly onDidChangeFile: Event<readonly IFileChange[]>;
|
|
44
|
+
private _bufferedChanges;
|
|
45
|
+
private _fireSoonHandle?;
|
|
46
|
+
watch(resource: URI, opts: IWatchOptions): IDisposable;
|
|
47
|
+
private _fireSoon;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export { InMemoryFileSystemProvider };
|