import { Ink } from '@impulsedev/ink';
// Initialize Ink
// By default, this starts the auto-training process in the background
const ink = new Ink();
// Wait for the model to be ready (trains or loads)
await ink.loadModel();
// ... (Integration with your canvas to capture strokes) ...
// Recognize the current drawing
const result = await ink.recognize();
if (result.valid) {
console.log(`Expression: ${result.expression}`); // Output: "2 + 2"
console.log(`Result: ${result.result}`); // Output: 4
}