mirror of
https://github.com/captbaritone/webamp.git
synced 2026-01-23 02:15:01 +00:00
Improve typechecking of webamp-modern
This commit is contained in:
parent
b99ea291eb
commit
f2fd00b65b
10 changed files with 33 additions and 24 deletions
|
|
@ -22,7 +22,6 @@
|
|||
"devDependencies": {
|
||||
"@babel/core": "^7.17.10",
|
||||
"@babel/preset-env": "^7.17.10",
|
||||
"@types/eslint": "^7.2.14",
|
||||
"@types/estree": "^0.0.50",
|
||||
"@types/jest": "^27.5.0",
|
||||
"@typescript-eslint/eslint-plugin": "^7.1.0",
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@ export class AudioPlayer {
|
|||
|
||||
constructor() {
|
||||
this._context = this._context = new (window.AudioContext ||
|
||||
window.webkitAudioContext)();
|
||||
(window as any).webkitAudioContext)();
|
||||
|
||||
// Fix for iOS and Chrome (Canary) which require that the context be created
|
||||
// or resumed by a user interaction.
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ export default class TrueTypeFont {
|
|||
}
|
||||
|
||||
dispose() {
|
||||
document.fonts.delete(this._fontFace);
|
||||
(document.fonts as any).delete(this._fontFace);
|
||||
}
|
||||
|
||||
getBase64() {
|
||||
|
|
@ -68,6 +68,6 @@ export default class TrueTypeFont {
|
|||
|
||||
const font = new FontFace(fontFamily, `url(${fontUrl})`);
|
||||
this._fontFace = await font.load();
|
||||
document.fonts.add(this._fontFace);
|
||||
(document.fonts as any).add(this._fontFace);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@ export default class ButtonKjofol extends Button {
|
|||
|
||||
_renderX() {
|
||||
super._renderX();
|
||||
this._div.style.setProperty("--left", px(-this._x ?? 0));
|
||||
this._div.style.setProperty("--left", px(-this._x));
|
||||
}
|
||||
|
||||
_renderY() {
|
||||
super._renderY();
|
||||
this._div.style.setProperty("--top", px(-this._y ?? 0));
|
||||
this._div.style.setProperty("--top", px(-this._y));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,11 +10,11 @@ export default class ToggleButtonKjofol extends ToggleButton {
|
|||
|
||||
_renderX() {
|
||||
super._renderX();
|
||||
this._div.style.setProperty("--left", px(-this._x ?? 0));
|
||||
this._div.style.setProperty("--left", px(-this._x));
|
||||
}
|
||||
|
||||
_renderY() {
|
||||
super._renderY();
|
||||
this._div.style.setProperty("--top", px(-this._y ?? 0));
|
||||
this._div.style.setProperty("--top", px(-this._y));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import GuiObj from "./GuiObj";
|
||||
import { AUDIO_PAUSED, AUDIO_STOPPED, AUDIO_PLAYING } from "../AudioPlayer";
|
||||
import { UIRoot } from "../../UIRoot";
|
||||
|
||||
// Maybe this?
|
||||
// http://wiki.winamp.com/wiki/XML_GUI_Objects#.3CWasabi:StandardFrame:Status.2F.3E
|
||||
|
|
|
|||
|
|
@ -1316,6 +1316,7 @@ export default class SystemObject extends BaseObject {
|
|||
*/
|
||||
getviewportheightfrompoint(x: number, y: number): number {
|
||||
// TODO
|
||||
return unimplemented(0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1334,6 +1335,7 @@ export default class SystemObject extends BaseObject {
|
|||
*/
|
||||
getmonitorheightfrompoint(x: number, y: number): number {
|
||||
// TODO
|
||||
return unimplemented(0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1342,6 +1344,7 @@ export default class SystemObject extends BaseObject {
|
|||
*/
|
||||
getmonitorheightfromguiobject(g: GuiObj): number {
|
||||
// TODO
|
||||
return unimplemented(0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1359,6 +1362,7 @@ export default class SystemObject extends BaseObject {
|
|||
*/
|
||||
getmonitorleftfromguiobject(g: GuiObj): number {
|
||||
// TODO
|
||||
return unimplemented(0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1369,6 +1373,7 @@ export default class SystemObject extends BaseObject {
|
|||
*/
|
||||
getmonitorleftfrompoint(x: number, y: number): number {
|
||||
// TODO
|
||||
return unimplemented(0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1391,6 +1396,7 @@ export default class SystemObject extends BaseObject {
|
|||
*/
|
||||
getmonitortopfromguiobject(g: GuiObj): number {
|
||||
// TODO
|
||||
return unimplemented(0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1401,6 +1407,7 @@ export default class SystemObject extends BaseObject {
|
|||
*/
|
||||
getmonitortopfrompoint(x: number, y: number): number {
|
||||
// TODO
|
||||
return unimplemented(0);
|
||||
}
|
||||
|
||||
getviewportleft(): number {
|
||||
|
|
@ -1425,6 +1432,7 @@ export default class SystemObject extends BaseObject {
|
|||
*/
|
||||
getviewportleftfrompoint(x: number, y: number): number {
|
||||
// TODO
|
||||
return unimplemented(0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -1443,6 +1451,7 @@ export default class SystemObject extends BaseObject {
|
|||
*/
|
||||
getviewporttopfrompoint(x: number, y: number): number {
|
||||
// TODO
|
||||
return unimplemented(0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -29,14 +29,14 @@ export default class WasabiTitleBar extends Group {
|
|||
_renderX() {
|
||||
this._div.style.left =
|
||||
this._relatx == "1"
|
||||
? relative(this._padtitleleft + this._x ?? 0)
|
||||
: px(this._padtitleleft + this._x ?? 0);
|
||||
? relative(this._padtitleleft + this._x)
|
||||
: px(this._padtitleleft + this._x);
|
||||
}
|
||||
|
||||
_renderWidth() {
|
||||
this._div.style.width =
|
||||
this._relatw == "1"
|
||||
? relative(-this._padtitleleft + -this._padtitleright + this._w ?? 0)
|
||||
? relative(-this._padtitleleft + -this._padtitleright + this._w)
|
||||
: px(-this._padtitleright + this.getwidth());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,17 @@
|
|||
"esModuleInterop": true,
|
||||
"allowJs": true,
|
||||
"resolveJsonModule": true,
|
||||
"target": "es5"
|
||||
}
|
||||
"target": "es2018",
|
||||
"lib": ["es2018", "dom"],
|
||||
"downlevelIteration": true,
|
||||
"skipLibCheck": true,
|
||||
"moduleResolution": "node",
|
||||
"strict": false,
|
||||
"noEmit": true
|
||||
},
|
||||
"exclude": [
|
||||
"node_modules",
|
||||
"**/*.test.ts",
|
||||
"tools/eslint-rules/proper-maki-types.ts"
|
||||
]
|
||||
}
|
||||
|
|
|
|||
11
pnpm-lock.yaml
generated
11
pnpm-lock.yaml
generated
|
|
@ -554,9 +554,6 @@ importers:
|
|||
'@babel/preset-env':
|
||||
specifier: ^7.17.10
|
||||
version: 7.27.2(@babel/core@7.27.4)
|
||||
'@types/eslint':
|
||||
specifier: ^7.2.14
|
||||
version: 7.29.0
|
||||
'@types/estree':
|
||||
specifier: ^0.0.50
|
||||
version: 0.0.50
|
||||
|
|
@ -4113,9 +4110,6 @@ packages:
|
|||
'@types/eslint-scope@3.7.7':
|
||||
resolution: {integrity: sha512-MzMFlSLBqNF2gcHWO0G1vP/YQyfvrxZ0bF+u7mzUdZ1/xK4A4sru+nraZz5i3iEIk1l1uyicaDVTB4QbbEkAYg==}
|
||||
|
||||
'@types/eslint@7.29.0':
|
||||
resolution: {integrity: sha512-VNcvioYDH8/FxaeTKkM4/TiTwt6pBV9E3OfGmvaw8tPl0rrHCJ4Ll15HRT+pMiFAf/MLQvAzC+6RzUMEL9Ceng==}
|
||||
|
||||
'@types/eslint@8.56.7':
|
||||
resolution: {integrity: sha512-SjDvI/x3zsZnOkYZ3lCt9lOZWZLB2jIlNKz+LBgCtDurK0JZcwucxYHn1w2BJkD34dgX9Tjnak0txtq4WTggEA==}
|
||||
|
||||
|
|
@ -18992,11 +18986,6 @@ snapshots:
|
|||
'@types/eslint': 8.56.7
|
||||
'@types/estree': 1.0.8
|
||||
|
||||
'@types/eslint@7.29.0':
|
||||
dependencies:
|
||||
'@types/estree': 1.0.8
|
||||
'@types/json-schema': 7.0.15
|
||||
|
||||
'@types/eslint@8.56.7':
|
||||
dependencies:
|
||||
'@types/estree': 1.0.8
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue