You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want manoco editor to has some package's types, like dayjs, so I get all *.d.ts files in dayjs package and call addExtraLib to register all type file, but it does not work as expect.
typeFileInfo={name: string;code: string;};/*** all *.d.ts in dayjs* just like* {* name: 'index.d.ts',* code: ''; // content copy from https://cdn.jsdelivr.net/npm/[email protected]/index.d.ts* }*/constfiles: FileInfo[]=[];for(const{ name, code }offiles){constpath=`file://node_modules/dayjs/${name}`;monaco.languages.typescript.typescriptDefaults.addExtraLib(code,path);}
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
I want manoco editor to has some package's types, like
dayjs
, so I get all*.d.ts
files indayjs
package and calladdExtraLib
to register all type file, but it does not work as expect.it results as below
but in TypeScript Play, it works fine
monaco editor: 0.40.0 ( I tried the latest version, 0.45.0, no diffs )
Beta Was this translation helpful? Give feedback.
All reactions