How do I call such a module?


export type ListChildren = {
	[number]: Instance,
}

local PropertySignals = {
	"CanvasPosition",
	"AbsoluteWindowSize",
	"AbsolutePosition",
}

return function(children: ListChildren, itemHeight: number): ScrollingFrame
	local totalChildren = #children > 0 and #children or 1

So I wanted to call this module to make a reliable scroll frame system but this makes no sense. How do I require this and give all parameters to make this work? What does export type mean?

The module itself returns a function. Therefore when you call require(module) on it, you will have this function returned. The export type... is part of Luau’s type checking; it allows the script that is requiring this module to have access to this custom type. Assuming there is an end to the function (I can’t see one in the code you’ve provided) you can do something like this to call it:

local ScrollingFrameModule = require(yourModuleHere)
ScrollingFrameModule()
1 Like

Do I give scroll frame has parameter of something else cause


local totalChildren = #children > 0 and #children or 1

errors saying comparing instance with number value

As you can see in the function definition in the module script, the function takes 2 arguments: children and itemHeight. Because the creator of this module used type checking, you even know what type these arguments need to be.
So, the first argument u pass must be of type ListChildren which is defined as an array of instances. (Maybe expects an array obtained through :GetChildren())
ex: {instance1, instance2, instance3}
The second argument must be a number.