From 33019835ea1858fd22b47cc97ed88588f3f4e5cd Mon Sep 17 00:00:00 2001 From: Valtteri Karesto Date: Wed, 17 Aug 2022 21:05:46 +0300 Subject: [PATCH] Add some extra definitions to monaco typescript --- components/HooksEditor.tsx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/components/HooksEditor.tsx b/components/HooksEditor.tsx index ab7c7e8..68675d2 100644 --- a/components/HooksEditor.tsx +++ b/components/HooksEditor.tsx @@ -7,6 +7,7 @@ import { useRouter } from 'next/router' import Box from './Box' import Container from './Container' +import asc from 'assemblyscript/dist/asc' import { createNewFile, saveFile } from '../state/actions' import { apiHeaderFiles } from '../state/constants' import state from '../state' @@ -210,6 +211,11 @@ const HooksEditor = () => { ) } + monaco.languages.typescript.typescriptDefaults.addExtraLib( + asc.definitionFiles.assembly, + 'assemblyscript/std/assembly/index.d.ts' + ) + // create the web socket if (!subscriptionRef.current) { monaco.languages.register({