Uploader online (#26)

This commit is contained in:
Asher
2019-01-30 15:40:01 -06:00
committed by Kyle Carberry
parent 62b1e0ef00
commit ebe5e1b1a9
20 changed files with 430 additions and 264 deletions

View File

@@ -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;