Added strict type checking to the project. (#236)
* Implement strict typing (WIP). * changes * Finish type checks * Fix notification icon, matugen settings and update tsconfig. * OSD Styling updates and added the ability to configure OSD duration.
This commit is contained in:
@@ -69,7 +69,6 @@ export const pollVariableBash = <T>(
|
||||
});
|
||||
};
|
||||
|
||||
// Set up the interval initially with the provided polling interval
|
||||
Utils.merge([pollingInterval, ...trackers], (pollIntrvl: number) => {
|
||||
intervalFn(pollIntrvl);
|
||||
});
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
// @ts-expect-error
|
||||
import GTop from 'gi://GTop';
|
||||
|
||||
const defaultCpuData: number = 0;
|
||||
|
||||
let previousCpuData = new GTop.glibtop_cpu();
|
||||
GTop.glibtop_get_cpu(previousCpuData);
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
import options from "options";
|
||||
|
||||
// @ts-expect-error
|
||||
import GTop from 'gi://GTop';
|
||||
|
||||
// Module initializer
|
||||
import { module } from "../module"
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HyprctlDeviceLayout, HyprctlKeyboard, KbLabelType } from "lib/types/customModules/kbLayout";
|
||||
import { HyprctlDeviceLayout, HyprctlKeyboard, KbLabelType, LayoutKeys, LayoutValues } from "lib/types/customModules/kbLayout";
|
||||
import { layoutMap } from "./layouts";
|
||||
|
||||
export const getKeyboardLayout = (obj: string, format: KbLabelType) => {
|
||||
@@ -15,7 +15,8 @@ export const getKeyboardLayout = (obj: string, format: KbLabelType) => {
|
||||
mainKb = keyboards[keyboards.length - 1];
|
||||
}
|
||||
|
||||
let layout = mainKb['active_keymap'];
|
||||
let layout: LayoutKeys = mainKb['active_keymap'] as LayoutKeys;
|
||||
const foundLayout: LayoutValues = layoutMap[layout];
|
||||
|
||||
return format === "code" ? layoutMap[layout] || layout : layout;
|
||||
return format === "code" ? foundLayout || layout : layout;
|
||||
}
|
||||
|
||||
@@ -581,4 +581,4 @@ export const layoutMap = {
|
||||
"Wolof": "SN",
|
||||
"Yakut": "RU (Sah)",
|
||||
"Yoruba": "NG (Yoruba)"
|
||||
};
|
||||
} as const;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { Module } from "lib/types/bar";
|
||||
import { BarButtonStyles } from "lib/types/options";
|
||||
import options from "options";
|
||||
import Gtk from "types/@girs/gtk-3.0/gtk-3.0";
|
||||
import { Binding } from "types/service";
|
||||
@@ -40,7 +41,7 @@ export const module = ({
|
||||
|
||||
return {
|
||||
component: Widget.Box({
|
||||
className: Utils.merge([style.bind("value"), showLabelBinding], (style: string, shwLabel: boolean) => {
|
||||
className: Utils.merge([style.bind("value"), showLabelBinding], (style: BarButtonStyles, shwLabel: boolean) => {
|
||||
const shouldShowLabel = shwLabel || showLabel;
|
||||
const styleMap = {
|
||||
default: "style1",
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { ResourceLabelType } from 'lib/types/bar';
|
||||
import { GenericResourceData } from 'lib/types/customModules/generic';
|
||||
import { InputHandlerEvents } from 'lib/types/customModules/utils';
|
||||
import { Binding } from 'lib/utils';
|
||||
import { openMenu } from 'modules/bar/utils';
|
||||
import options from 'options';
|
||||
@@ -75,7 +76,7 @@ export const inputHandler = (
|
||||
onMiddleClick,
|
||||
onScrollUp,
|
||||
onScrollDown,
|
||||
}
|
||||
}: InputHandlerEvents
|
||||
) => {
|
||||
const sanitizeInput = (input: VariableType<string>): string => {
|
||||
if (input === undefined) {
|
||||
|
||||
Reference in New Issue
Block a user