how i can add type to file that doesn't not exits
how i can add type to file that doesn't not exits
22 Replies
what? what do you mean "file that doesn't exist?"
also, why are you using jsdoc for typescript?
it was a try
what are you trying to do?
i have a component a my pkg accessing wathqny.config that file not is not there but it is one the site
.config isn't a valid extension
it is a ts
file
you don't have to add the type ex
in js/ts
you're trying to load a file called "wathqny.config.ts"?
i am using that file already
but i have jsut type problem
so, whats the problem?
which type problem?
i want to load the type for a file that dosen't exits
import type { WathqnyConfig as WathqnyConfigType } from "wtqtypes";
show us the problem
show us error messages, compilation errors ... something
you have to create the file then
also, why are you importing types manually?
wouldnt a .d.ts file be enough?
because the file is not there
the types is my own types
what do those files have?
That leading
/
on /wathqny.config
will cause it to look in the root of the filesystem. If you want the current directory, use ./
.
this is the solution
what even are you trying to do?
i was trying to get a types for my component that i am using it in my site where wathqny.config because of that file doesn't not exits for the typescript lang server but for compile it works
how about you create a
.d.ts
file with the types you need?
for example, your "untyped" file could have a .d.ts
counterpart that describes the data typesthe WathqnyConfigType already comes from .d.ts
so, you're importing the .d.ts file?