Uploader online (#26)
This commit is contained in:
@ -59,7 +59,7 @@ const decodeStream = (encoding: string): NodeJS.ReadWriteStream => {
|
||||
return new IconvLiteDecoderStream({ encoding });
|
||||
};
|
||||
|
||||
// @ts-ignore
|
||||
iconv.decodeStream = decodeStream;
|
||||
const target = iconv as typeof iconv;
|
||||
target.decodeStream = decodeStream;
|
||||
|
||||
export = iconv;
|
||||
export = target;
|
||||
|
@ -1,3 +1,7 @@
|
||||
// TODO: ?
|
||||
import { join } from "path";
|
||||
|
||||
// tslint:disable-next-line no-any
|
||||
(global as any).requireToUrl = (path: string): string => `${location.protocol}//{location.host}/${path}`;
|
||||
(global as any).requireToUrl = (path: string): string => {
|
||||
// TODO: can start with vs/...
|
||||
return join(`${location.protocol}//${location.host}/resource`, path);
|
||||
};
|
||||
|
@ -8,7 +8,7 @@ import * as globalStorage from "vs/platform/storage/node/storageIpc";
|
||||
import * as paths from "./paths";
|
||||
import { logger, field } from "@coder/logger";
|
||||
|
||||
export class StorageDatabase implements workspaceStorage.IStorageDatabase {
|
||||
class StorageDatabase implements workspaceStorage.IStorageDatabase {
|
||||
|
||||
public readonly onDidChangeItemsExternal = Event.None;
|
||||
private items = new Map<string, string>();
|
||||
@ -81,7 +81,7 @@ export class StorageDatabase implements workspaceStorage.IStorageDatabase {
|
||||
|
||||
}
|
||||
|
||||
export class GlobalStorageDatabase extends StorageDatabase implements IDisposable {
|
||||
class GlobalStorageDatabase extends StorageDatabase implements IDisposable {
|
||||
|
||||
public constructor() {
|
||||
super(path.join(paths.getAppDataPath(), "globalStorage", "state.vscdb"));
|
||||
@ -93,7 +93,10 @@ export class GlobalStorageDatabase extends StorageDatabase implements IDisposabl
|
||||
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
workspaceStorage.SQLiteStorageDatabase = StorageDatabase;
|
||||
// @ts-ignore
|
||||
globalStorage.GlobalStorageDatabaseChannelClient = GlobalStorageDatabase;
|
||||
const workspaceTarget = workspaceStorage as typeof workspaceStorage;
|
||||
// @ts-ignore TODO: don't ignore it.
|
||||
workspaceTarget.SQLiteStorageDatabase = StorageDatabase;
|
||||
|
||||
const globalTarget = globalStorage as typeof globalStorage;
|
||||
// @ts-ignore TODO: don't ignore it.
|
||||
globalTarget.GlobalStorageDatabaseChannelClient = GlobalStorageDatabase;
|
||||
|
@ -8,28 +8,29 @@ target.Registry = class Registry extends vscodeTextmate.Registry {
|
||||
...opts,
|
||||
getOnigLib: (): Promise<vscodeTextmate.IOnigLib> => {
|
||||
return new Promise<vscodeTextmate.IOnigLib>((res, rej) => {
|
||||
const onigasm = require('onigasm');
|
||||
const wasmUrl = require('!!file-loader!onigasm/lib/onigasm.wasm');
|
||||
const onigasm = require("onigasm");
|
||||
const wasmUrl = require("!!file-loader!onigasm/lib/onigasm.wasm");
|
||||
|
||||
return fetch(wasmUrl).then(resp => resp.arrayBuffer()).then(buffer => {
|
||||
return onigasm.loadWASM(buffer);
|
||||
}).then(() => {
|
||||
res({
|
||||
createOnigScanner: function (patterns) { return new onigasm.OnigScanner(patterns); },
|
||||
createOnigString: function (s) { return new onigasm.OnigString(s); }
|
||||
})
|
||||
createOnigString: function (s) { return new onigasm.OnigString(s); },
|
||||
});
|
||||
}).catch(reason => rej(reason));
|
||||
});
|
||||
},
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
enum StandardTokenType {
|
||||
Other = 0,
|
||||
Comment = 1,
|
||||
String = 2,
|
||||
RegEx = 4,
|
||||
};
|
||||
Comment = 1,
|
||||
String = 2,
|
||||
RegEx = 4,
|
||||
}
|
||||
|
||||
// Any needed here to override const
|
||||
(<any>target).StandardTokenType = StandardTokenType;
|
||||
// tslint:disable-next-line no-any to override const
|
||||
(target as any).StandardTokenType = StandardTokenType;
|
||||
|
@ -281,5 +281,6 @@ class WindowsService implements IWindowsService {
|
||||
|
||||
}
|
||||
|
||||
// @ts-ignore
|
||||
windowsIpc.WindowsChannelClient = WindowsService;
|
||||
const target = windowsIpc as typeof windowsIpc;
|
||||
// @ts-ignore TODO: don't ignore it.
|
||||
target.WindowsChannelClient = WindowsService;
|
||||
|
Reference in New Issue
Block a user