declare
Updateddeclare function name(params): R declare name: T declare extern type Name with ... end declare class Name extends Base ... end
A definition-file statement. Luau's own definition syntax, in a .d.aly: a file of globals that every file sees with no import. It holds no runtime, and alloy build writes nothing for it. A class or an extern type lists members: name: T, read name: T, write name: T, a method function name(self, ...): R, and an indexer [K]: V; extends names the base.
The rest of the file declares types, and each one is global: type, interface, struct, trait, and enum, which is a type alone, with no constructors. A file may name a type of another .d.aly. A T[] is a plain table, { T }, since the host gives no std array, and a std type such as Result is out of reach. The editor and alloy flux load every .d.aly under [build] in and each file of [flux] definitions, which may sit outside in. The editor's alloy-luau.types.definitionFiles setting adds files for the editor alone.
