chore(ags): fix some typing stuff
All checks were successful
Discord / discord commits (push) Has been skipped

This commit is contained in:
matt1432 2024-01-06 12:24:09 -05:00
parent 681e356c26
commit 248ba1281c
7 changed files with 6 additions and 31 deletions

View file

@ -92,7 +92,6 @@ export default () => {
], ],
}), }),
}).hook(SystemTray, (self) => { }).hook(SystemTray, (self) => {
// @ts-expect-error
self.reveal_child = systray.get_children().length > 0; self.reveal_child = systray.get_children().length > 0;
}); });
}; };

View file

@ -43,10 +43,8 @@ export default (window) => Box({
self.on('toggled', () => { self.on('toggled', () => {
self.toggleClassName( self.toggleClassName(
'toggled', 'toggled',
// @ts-expect-error
self.get_active(), self.get_active(),
); );
// @ts-expect-error
window.exclusivity = self.get_active() ? window.exclusivity = self.get_active() ?
'exclusive' : 'exclusive' :
'normal'; 'normal';

View file

@ -45,7 +45,7 @@ export const getWorkspaces = (box) => {
* @param {boolean} normal * @param {boolean} normal
*/ */
const Workspace = (id, name, normal = true) => { const Workspace = (id, name, normal = true) => {
const fixed = Fixed(); const fixed = Fixed({});
const workspace = Revealer({ const workspace = Revealer({
transition: 'slide_right', transition: 'slide_right',

View file

@ -121,12 +121,7 @@ export const BluetoothMenu = () => {
child: ListBox({ child: ListBox({
setup: (self) => { setup: (self) => {
// @ts-expect-error
self.set_sort_func( self.set_sort_func(
/**
* @param {Box} a
* @param {Box} b
*/
(a, b) => { (a, b) => {
// @ts-expect-error // @ts-expect-error
return b.get_children()[0].attribute.dev.paired - // eslint-disable-line return b.get_children()[0].attribute.dev.paired - // eslint-disable-line
@ -146,7 +141,6 @@ export const BluetoothMenu = () => {
if (!DevList.has(dev) && dev.name) { if (!DevList.has(dev) && dev.name) {
DevList.set(dev, BluetoothDevice(dev)); DevList.set(dev, BluetoothDevice(dev));
// @ts-expect-error
self.add(DevList.get(dev)); self.add(DevList.get(dev));
self.show_all(); self.show_all();
} }
@ -167,8 +161,7 @@ export const BluetoothMenu = () => {
DevList.delete(dev); DevList.delete(dev);
} }
else { else {
devWidget.children[0] devWidget.child.reveal_child = false;
.reveal_child = false;
devWidget.toDestroy = true; devWidget.toDestroy = true;
} }
} }
@ -184,7 +177,6 @@ export const BluetoothMenu = () => {
const scroll = self.get_parent()?.get_parent(); const scroll = self.get_parent()?.get_parent();
if (scroll) { if (scroll) {
// @ts-expect-error
const n_child = self.get_children().length; const n_child = self.get_children().length;
if (n_child > SCROLL_THRESH_N) { if (n_child > SCROLL_THRESH_N) {
@ -211,9 +203,7 @@ export const BluetoothMenu = () => {
} }
// Trigger sort_func // Trigger sort_func
// @ts-expect-error
self.get_children().forEach( self.get_children().forEach(
/** @param {Box} ListBoxRow */
(ListBoxRow) => { (ListBoxRow) => {
// @ts-expect-error // @ts-expect-error
ListBoxRow.changed(); ListBoxRow.changed();

View file

@ -138,12 +138,7 @@ export const NetworkMenu = () => {
child: ListBox({ child: ListBox({
setup: (self) => { setup: (self) => {
// @ts-expect-error
self.set_sort_func( self.set_sort_func(
/**
* @param {Box} a
* @param {Box} b
*/
(a, b) => { (a, b) => {
return b.get_children()[0] return b.get_children()[0]
// @ts-expect-error // @ts-expect-error
@ -169,7 +164,6 @@ export const NetworkMenu = () => {
else { else {
APList.set(ap.ssid, AccessPoint(ap)); APList.set(ap.ssid, AccessPoint(ap));
// @ts-expect-error
self.add(APList.get(ap.ssid)); self.add(APList.get(ap.ssid));
self.show_all(); self.show_all();
} }
@ -191,8 +185,7 @@ export const NetworkMenu = () => {
APList.delete(ssid); APList.delete(ssid);
} }
else { else {
apWidget.children[0] apWidget.child.reveal_child = false;
.reveal_child = false;
apWidget.toDestroy = true; apWidget.toDestroy = true;
} }
} }
@ -208,7 +201,6 @@ export const NetworkMenu = () => {
const scroll = self.get_parent()?.get_parent(); const scroll = self.get_parent()?.get_parent();
if (scroll) { if (scroll) {
// @ts-expect-error
const n_child = self.get_children().length; const n_child = self.get_children().length;
if (n_child > SCROLL_THRESH_N) { if (n_child > SCROLL_THRESH_N) {
@ -235,9 +227,7 @@ export const NetworkMenu = () => {
} }
// Trigger sort_func // Trigger sort_func
// @ts-expect-error
self.get_children().forEach( self.get_children().forEach(
/** @param {Box} ListBoxRow */
(ListBoxRow) => { (ListBoxRow) => {
// @ts-expect-error // @ts-expect-error
ListBoxRow.changed(); ListBoxRow.changed();

View file

@ -12,13 +12,11 @@ export default (rev) => CenterBox({
setup: (self) => { setup: (self) => {
// Open at startup if there are players // Open at startup if there are players
const id = Mpris.connect('changed', () => { const id = Mpris.connect('changed', () => {
// @ts-expect-error
self.set_active(Mpris.players.length > 0); self.set_active(Mpris.players.length > 0);
Mpris.disconnect(id); Mpris.disconnect(id);
}); });
self.on('toggled', () => { self.on('toggled', () => {
// @ts-expect-error
if (self.get_active()) { if (self.get_active()) {
self.child self.child
// @ts-expect-error // @ts-expect-error