mirror of
https://github.com/APIParkLab/APIPark.git
synced 2026-06-14 20:41:15 +08:00
73435497a2
- Load balancing (can connect to multiple accounts, automatically switch accounts when there is no quota) - AI call log - Model rate configuration
27 lines
909 B
TypeScript
27 lines
909 B
TypeScript
import * as monaco from 'monaco-editor'
|
|
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'
|
|
import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker'
|
|
import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker'
|
|
import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker'
|
|
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker'
|
|
|
|
self.MonacoEnvironment = {
|
|
getWorker(_, label) {
|
|
if (label === 'json') {
|
|
return new jsonWorker()
|
|
}
|
|
if (label === 'css' || label === 'scss' || label === 'less') {
|
|
return new cssWorker()
|
|
}
|
|
if (label === 'html' || label === 'handlebars' || label === 'razor') {
|
|
return new htmlWorker()
|
|
}
|
|
if (label === 'typescript' || label === 'javascript') {
|
|
return new tsWorker()
|
|
}
|
|
return new editorWorker()
|
|
}
|
|
}
|
|
|
|
export { monaco }
|