-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom definitions for AudioAnalyzer. #1180
Conversation
include/customDefinitions.d.ts
Outdated
@@ -868,6 +868,15 @@ interface SocialService extends Instance { | |||
readonly GameInvitePromptClosed: RBXScriptSignal<(senderPlayer: Player, recipientIds: Array<number>) => void>; | |||
} | |||
|
|||
interface AudioAnalyzer extends Instance { | |||
readonly Changed: RBXScriptSignal<(value: string) => void>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed
is actually from Instance
.. but we intentionally omit it because it breaks inheritance.
You should try to use .GetPropertyChangedSignal()
when possible.
If that doesn't work, there's a helper type called ChangedSignal
for this purpose. Here's an example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we intentionally omit it because it breaks inheritance
To provide some more context:
Instance.Changed
is typed as(string) -> void
NumberValue.Changed
is typed as(number) -> void
These types conflict, so if we add both .Changed
events, NumberValue
cannot inherit from Instance
without an error.
This applies to not just NumberValue, but several different -Value
classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Gotcha! I'll remove that real quick
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I try to keep the interfaces in customDefinitions.d.ts
alphabetically sorted as much as possible. Can you move it higher please?
Added custom definitions for both
GetSpectrum()
andChanged
.