Initiate a TypeScript client
The class Client
is available in Koheron TypeScript API. It lets you connect to the instrument.
Create a client with:
new Client(private ip:string, websockPoolSize: number)
Example
The TypeScript driver is called within a class App
:
class App {
private driver: LedBlinker;
constructor(window: Window, document: Document, ip: string) {
let client = new Client(ip, 5);
window.addEventListener('load', () => {
client.init( () => {
this.driver = new LedBlinker(client);
});
}, false);
window.onbeforeunload = () => { client.exit(); };
}
}
let app = new App(window, document, location.hostname);
See also