Cannot use userdata in a .d.lua file? #884
davidgiven
started this conversation in
General
Replies: 1 comment
-
You can use class types in definition files which can replicate user datas / host types: declare class Cat
Name: string
function Meow(): ()
end |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to declare a host function which returns a userdata type in my type definition file:
This fails with a 'Unknown type: userdata' error.
Is this intentional / something I'm doing wrong / a bug / other?
As an aside: given that userdatas can represent different types of object, is there a way to generate a custom type for userdatas such that different types are not assignable?
Beta Was this translation helpful? Give feedback.
All reactions