import { useState } from '#app' import { Ref } from 'vue' import { start, stop } from '@/composables/engine/startStop' interface EngineContext { isActive: Ref shouldStop: Ref } export interface useEngine { start(): void stop(): void } export default (): useEngine => { const context: EngineContext = { isActive: useState('engine__is-active', () => false), shouldStop: useState('engine__should-stop', () => false), } return { start: () => start.apply(context), stop: () => stop.apply(context), } }