Skip to content

Commit

Permalink
add return types
Browse files Browse the repository at this point in the history
  • Loading branch information
silverwind committed Dec 9, 2024
1 parent f6ef9c0 commit 03298f8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions web_src/js/features/codeeditor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ function getLanguage(filename: string): string {
return languagesByFilename[filename] || languagesByExt[extname(filename)] || 'plaintext';
}

function updateEditor(monaco: Monaco, editor: IStandaloneCodeEditor, filename: string, lineWrapExts: string[]) {
function updateEditor(monaco: Monaco, editor: IStandaloneCodeEditor, filename: string, lineWrapExts: string[]): void {
editor.updateOptions(getFileBasedOptions(filename, lineWrapExts));
const model = editor.getModel();
if (!model) return;
Expand Down Expand Up @@ -118,7 +118,7 @@ function updateTheme(monaco: Monaco): void {

type CreateMonacoOpts = MonacoOpts & {language?: string};

export async function createMonaco(textarea: HTMLTextAreaElement, filename: string, opts: CreateMonacoOpts) {
export async function createMonaco(textarea: HTMLTextAreaElement, filename: string, opts: CreateMonacoOpts): Promise<{monaco: Monaco, editor: IStandaloneCodeEditor}> {
const monaco = await import(/* webpackChunkName: "monaco" */'monaco-editor');

initLanguages(monaco);
Expand Down

0 comments on commit 03298f8

Please sign in to comment.