Prevent autocomplete with function type

export type RemoteFunction<ClientArg,ServerArg> = Instance & {
	
	InvokeServer : (self : any, struct : ServerArg) -> ClientArg;
	OnServerInvoke : (player :  Player, struct : ServerArg) -> ClientArg;

}

local RemoteFunction: RemoteFunction<any,any>

RemoteFunction.OnServerInvoke() -- <- ide autocompletes to this
RemoteFunction.OnServerInvoke -- <-  i want the ide to auto complete up to here


is this possible?

Just asking out of curiosity, what will you use this for?

solved;

use a union type with any

OnServerInvoke : ((player :  Player, struct : ServerArg) -> ClientArg);
--becomes
OnServerInvoke : ((player :  Player, struct : ServerArg) -> ClientArg) | any;

type checking for remotes or events

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.