-
-
Notifications
You must be signed in to change notification settings - Fork 184
Closed
Labels
Description
Some Lua APIs provide objects with methods that must be invoked using dot syntax (thing.method(...)) as opposed to colon syntax (thing:method(...)). Having a custom decorator for this would be very useful.
Edit: This behavior already exists for namespaces, it just needs to be expanded for object-oriented use. I propose a new custom decorator, !DotMethod, applicable to declarations of classes, interfaces, type literals, and methods of any of these.
Example usages:
/** !DotMethod */
declare class SomethingExternal {
doThing(): SomethingReturned;
}
/** !DotMethod */
interface SomethingReturned {
doOtherThing(): void;
}
type SomethingElse = {
/** !DotMethod **/
dotMethod(): void,
regularMethod(): void
}Reactions are currently unavailable