import { MedleyConfig, startTimer } from "@mebble/medley";
const config: MedleyConfig = {
name: 'Shoulder stretches',
timer: {
type: 'sequence',
of: [{
type: 'loop',
times: 2,
of: {
type: 'sequence',
of: [
{ type: 'unit', name: 'Left shoulder', duration: 30 },
{ type: 'unit', name: 'Rest', duration: 10 },
{ type: 'unit', name: 'Right shoulder', duration: 30 },
{ type: 'unit', name: 'Rest', duration: 10 },
]
}
}, {
type: 'unit',
name: 'Rest',
duration: 30
}]
}
};
startTimer(config, event => {
console.log(event)
});
Install with any one of the following package managers:
npm install @mebble/medley
yarn add @mebble/medley
pnpm add @mebble/medley
If your JS code is placed within a <script type="module">
, you can import as an ES module from a CDN:
<script type="module">
import medley from 'https://esm.sh/@mebble/medley';
</script>
Alternatively, you can import the bundle:
<script src="https://cdn.jsdelivr.net/npm/@mebble/medley@latest/dist/index.umd.js"></script>
Here, the library will be available as the global variable medley
.
The API reference is available on the website.
See the contribution guide at CONTRIBUTING.md.
Generated using TypeDoc