mirror of
https://github.com/whscullin/apple1js.git
synced 2024-12-26 13:31:40 +00:00
Enable strict
This commit is contained in:
parent
88bd7836bc
commit
0216e75e7f
@ -22,8 +22,8 @@ import type { byte } from './types';
|
||||
*/
|
||||
|
||||
export class TextPage {
|
||||
_page: ImageData;
|
||||
_context: CanvasRenderingContext2D;
|
||||
_page: ImageData | undefined;
|
||||
_context: CanvasRenderingContext2D | undefined;
|
||||
|
||||
_buffer: byte[][] = [];
|
||||
_greenMode = false;
|
||||
@ -98,6 +98,9 @@ export class TextPage {
|
||||
this.refresh();
|
||||
}
|
||||
writeAt(row: byte, col: byte, val: byte): void {
|
||||
if (!this._page) {
|
||||
return;
|
||||
}
|
||||
this._buffer[row][col] = val;
|
||||
const data = this._page.data;
|
||||
let color;
|
||||
@ -169,6 +172,9 @@ export class TextPage {
|
||||
this.refresh();
|
||||
}
|
||||
blit() {
|
||||
if (!this._page || !this._context) {
|
||||
return;
|
||||
}
|
||||
if (this._dirty) {
|
||||
this._context.putImageData(
|
||||
this._page,
|
||||
|
1056
js/cpu6502.ts
1056
js/cpu6502.ts
File diff suppressed because it is too large
Load Diff
@ -214,19 +214,17 @@ export class KeyBoard {
|
||||
return span;
|
||||
}
|
||||
|
||||
const _mouseup = (
|
||||
event: MouseEvent & {
|
||||
currentTarget: HTMLElement;
|
||||
const _mouseup = (event: Event) => {
|
||||
if (!(event.currentTarget instanceof HTMLElement)) {
|
||||
return;
|
||||
}
|
||||
) => {
|
||||
event.currentTarget.classList.remove('pressed');
|
||||
};
|
||||
|
||||
const _mousedown = (
|
||||
event: MouseEvent & {
|
||||
currentTarget: HTMLElement;
|
||||
const _mousedown = (event: Event) => {
|
||||
if (!(event.currentTarget instanceof HTMLElement)) {
|
||||
return;
|
||||
}
|
||||
) => {
|
||||
event.currentTarget.classList.add('pressed');
|
||||
let key = event.currentTarget.dataset[this.shifted ? 'key2' : 'key1'];
|
||||
if (!key) {
|
||||
@ -262,7 +260,7 @@ export class KeyBoard {
|
||||
case 'SHIFT':
|
||||
this.shifted = !this.shifted;
|
||||
this.kb
|
||||
.querySelectorAll('.key-SHIFT')
|
||||
.querySelectorAll<HTMLElement>('.key-SHIFT')
|
||||
.forEach(function (el: HTMLElement) {
|
||||
el.classList.toggle('active');
|
||||
});
|
||||
|
@ -8,15 +8,13 @@
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"target": "es6",
|
||||
"lib": ["DOM", "ES6"],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strict": true,
|
||||
"noUnusedLocals": true,
|
||||
"noUnusedParameters": true,
|
||||
"exactOptionalPropertyTypes": true,
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"sourceMap": true,
|
||||
"strictNullChecks": true,
|
||||
"outDir": "dist",
|
||||
"baseUrl": ".",
|
||||
"allowJs": true,
|
||||
|
Loading…
Reference in New Issue
Block a user