Toggle stricter compilation rules in tsconfig

Now the whole codebase needs to be fixed. Every file.
This commit is contained in:
2024-04-19 22:25:04 +02:00
parent 75481e19f0
commit d3ac9f19a2
11 changed files with 150 additions and 114 deletions

28
src/API/IO/OSC.ts Normal file
View File

@ -0,0 +1,28 @@
import { sendToServer, type OSCMessage } from "../../IO/OSC";
import { Editor } from "../../main";
import { oscMessages } from "../../IO/OSC";
export const osc = (app: Editor) => (address: string, port: number, ...args: any[]): void => {
/**
* Sends an OSC message to the server.
*/
sendToServer({
address: address,
port: port,
args: args,
timetag: Math.round(Date.now() + (app.clock.nudge - app.clock.deviation)),
} as OSCMessage);
};
export const getOSC = () => (address?: string): any[] => {
/**
* Retrieves incoming OSC messages. Filters by address if provided.
*/
if (address) {
let messages = oscMessages.filter((msg: { address: string; }) => msg.address === address);
messages = messages.map((msg: { data: any; }) => msg.data);
return messages;
} else {
return oscMessages;
}
};