Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

(SOLVED) Problems with exporting type definitions?

hello,

is it currently possible? right now if I try to import something from a module of exported type definitions, I get Unknown type: ---. this is how I've seen it used online and in some modules by others in the library, which... strangely suffer the same issue. is it just my studio acting up?

definitions module:

export type MyType = {hell_yeah: number}

return {}

other module

local TypeDefs = require(script.Parent.Types)
type MyType = TypeDefs.MyType

local dict: MyType
dict = 5 -- works anyways. with nostrict it shows nothing, and with strict it gives me that error!

-- I've also tried it this way
local otherdict: TypeDefs.MyType -- same problem

1 answer

well that's great. I've been scratching my head for near an hour and figured it out minutes after posting this. if this helps anyone in the future, make sure to put --!strict at the top of your definitions module, haha.

This discussion is preserved as it was. New answers, comments, and votes are closed.