File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
composables/parser/javascript Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change 1
1
<script lang="ts">
2
- import Typescript from ' typescript'
2
+ import { parserModulePromise } from ' ~/state/parser/module'
3
+ import type Typescript from ' typescript'
4
+
3
5
const useOption = makeUseOption <
4
6
Typescript .CreateSourceFileOptions & { scriptKind : Typescript .ScriptKind }
5
7
> ()
6
8
</script >
7
9
8
10
<script setup lang="ts">
9
- const scriptKind = useOption (' scriptKind' , Typescript .ScriptKind .TS , true )
11
+ const ts = await parserModulePromise .value
12
+ const scriptKind = useOption (' scriptKind' , ts .ScriptKind .TS , true )
10
13
const languageVersion = useOption (
11
14
' languageVersion' ,
12
- Typescript .ScriptTarget .Latest ,
15
+ ts .ScriptTarget .Latest ,
13
16
true ,
14
17
)
15
18
16
- const versions = Object .entries (Typescript .ScriptTarget ).filter (
19
+ const versions = Object .entries (ts .ScriptTarget ).filter (
17
20
([_ , value ]) => typeof value === ' number' ,
18
21
)
19
22
</script >
@@ -24,7 +27,7 @@ const versions = Object.entries(Typescript.ScriptTarget).filter(
24
27
<span >sourceType</span >
25
28
<select v-model =" scriptKind" >
26
29
<option
27
- v-for =" kind in Object.entries(Typescript .ScriptKind).filter(
30
+ v-for =" kind in Object.entries(ts .ScriptKind).filter(
28
31
([_, value]) => typeof value === 'number',
29
32
)"
30
33
:key =" kind[0]"
You can’t perform that action at this time.
0 commit comments