mirror of
https://github.com/The-Low-Code-Foundation/OpenNoodl.git
synced 2026-01-11 14:52:55 +01:00
feat(typescript): upgrade TypeScript to 5.9.3, remove transpileOnly workaround
- Upgrade TypeScript from 4.9.5 to 5.9.3 - Upgrade @typescript-eslint/parser from 5.62.0 to 7.18.0 - Upgrade @typescript-eslint/eslint-plugin from 5.62.0 to 7.18.0 - Remove transpileOnly: true workaround from webpack.renderer.core.js - Fix 9 type errors from TS5's stricter checks: - PropertyPanelBaseInput.tsx: Fix event handler types - keyboardhandler.ts: Fix KeyMod return type - model.ts: Remove unused @ts-expect-error directives - ScreenSizes.ts: Add proper type guard predicate Closes TASK-006
This commit is contained in:
@@ -14,11 +14,11 @@ export interface PropertyPanelBaseInputProps<ValueType = string | number> {
|
||||
hasSmallText?: boolean;
|
||||
|
||||
onChange?: (value: ValueType) => void;
|
||||
onClick?: MouseEventHandler<HTMLButtonElement>;
|
||||
onMouseEnter?: MouseEventHandler<HTMLButtonElement>;
|
||||
onMouseLeave?: MouseEventHandler<HTMLButtonElement>;
|
||||
onFocus?: FocusEventHandler<HTMLButtonElement>;
|
||||
onBlur?: FocusEventHandler<HTMLButtonElement>;
|
||||
onClick?: MouseEventHandler<HTMLInputElement>;
|
||||
onMouseEnter?: MouseEventHandler<HTMLInputElement>;
|
||||
onMouseLeave?: MouseEventHandler<HTMLInputElement>;
|
||||
onFocus?: FocusEventHandler<HTMLInputElement>;
|
||||
onBlur?: FocusEventHandler<HTMLInputElement>;
|
||||
onKeyDown?: KeyboardEventHandler;
|
||||
onError?: (error: Error) => void;
|
||||
|
||||
|
||||
@@ -127,7 +127,7 @@
|
||||
"style-loader": "^3.3.4",
|
||||
"ts-loader": "^9.5.4",
|
||||
"ts-node": "^10.9.2",
|
||||
"typescript": "^4.9.5",
|
||||
"typescript": "^5.9.3",
|
||||
"url-loader": "^4.1.1",
|
||||
"webpack": "^5.101.3",
|
||||
"webpack-cli": "^4.10.0",
|
||||
|
||||
@@ -8,8 +8,8 @@ export interface KeyboardCommand {
|
||||
type?: 'up' | 'down'; //default is down
|
||||
}
|
||||
|
||||
function getKeyMod(evt: KeyboardEvent): KeyMod {
|
||||
let modKey: KeyMod = 0;
|
||||
function getKeyMod(evt: KeyboardEvent): number {
|
||||
let modKey = 0;
|
||||
if (evt.metaKey || evt.ctrlKey) modKey |= KeyMod.CtrlCmd; // | KeyMod.WinCtrl
|
||||
if (evt.shiftKey) modKey |= KeyMod.Shift;
|
||||
if (evt.altKey) modKey |= KeyMod.Alt;
|
||||
|
||||
@@ -135,7 +135,6 @@ export class Model<TEnum extends ModelEventEnum = any, TEvents extends ModelEven
|
||||
for (let index = 0; index < this.listeners.length; index++) {
|
||||
const listener = this.listeners[index];
|
||||
if (shouldNotify(listener, event)) {
|
||||
// @ts-expect-error
|
||||
listener.listener(...args);
|
||||
}
|
||||
}
|
||||
@@ -143,7 +142,6 @@ export class Model<TEnum extends ModelEventEnum = any, TEvents extends ModelEven
|
||||
if (this.listenersOnce.length > 0) {
|
||||
this.listenersOnce = this.listenersOnce.filter((listener) => {
|
||||
if (shouldNotify(listener, event)) {
|
||||
// @ts-expect-error
|
||||
listener.listener(...args);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -73,8 +73,7 @@ export const screenSizesWithDividers: (ScreenSize | 'divider')[] = [
|
||||
}
|
||||
];
|
||||
|
||||
//@ts-expect-error TODO: make proper type when i know it works
|
||||
export const screenSizes: ScreenSize[] = screenSizesWithDividers.filter((item) => typeof item !== 'string');
|
||||
export const screenSizes: ScreenSize[] = screenSizesWithDividers.filter((item): item is ScreenSize => typeof item !== 'string');
|
||||
|
||||
export function getIconFromScreenSizeGroupName(group: ScreenSize['group']) {
|
||||
switch (group) {
|
||||
|
||||
Reference in New Issue
Block a user