#how to use typescript with the api?

1 messages · Page 1 of 1 (latest)

unique viper
#

import { example } from "./file"
i have no clue what to do

rough sand
unique viper
#

i have some functions in ts and i want to import it in js, how do i do that?

rough sand
unique viper
#

i did import * as kits from "./kitFuncs.ts" and it said [Scripting][error]-Plugin [item text testing - 2.4.8] - [main.js] ran with error: [ReferenceError: Module [kitFuncs.ts.js] not found. Native module error or file not found.]

unique viper
rough sand
unique viper
#

my file name is 'file.d.ts' is that different to 'file.ts'

unique viper
#

same error

rough sand
rough sand
unique viper
#

[Scripting][error]-Plugin [item text testing - 2.4.8] - [main.js] ran with error: [ReferenceError: Module [kitFuncs.d.ts.js] not found. Native module error or file not found.]

rough sand
#

.d.ts.js what?

unique viper
#

it autocorrects for some reason

rough sand
#

bro just name it KitFuncs_d.ts

unique viper
#

like i didnt type that

#

i did

#
import { world, system } from "@minecraft/server"
import * as kits from "kitFuncs.d.ts"```
rough sand
#

then i think you cant impoer ts

unique viper
#

dang thanks for helping anyway

rough sand