Skip to content
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

[TypeScript] Compilation fails with bind("volume") in Audio service #481

Open
ryze312 opened this issue Jun 28, 2024 · 0 comments
Open

[TypeScript] Compilation fails with bind("volume") in Audio service #481

ryze312 opened this issue Jun 28, 2024 · 0 comments

Comments

@ryze312
Copy link

ryze312 commented Jun 28, 2024

TypeScript fails to compile when using binding on volume in Audio service

const audio = await Service.import("audio");
const widget = Widget.Label({
    label: audio.speaker.bind("volume").as((v) => v.toString())
});
src/windows/bar.ts:28:51 - error TS18046: 'v' is of type 'unknown'.

28     label: audio.speaker.bind("volume").as((v) => v.toString())
                                                     ~


Found 1 error in src/windows/bar.ts:28

VSCode LSP seems to infer the type correctly

image

Other fields work just fine, e.g is_muted

const audio = await Service.import("audio");
const widget = Widget.Label({
    label: audio.speaker.bind("is_muted").as((v) => `test: ${v}`)
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant