Skip to content

Commit

Permalink
fix type error with getRobot
Browse files Browse the repository at this point in the history
  • Loading branch information
SillyFreak committed Jun 20, 2020
1 parent 77d894a commit c08e600
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/sdk/hedgehog.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@ import ExecutorTask from '../components/ide/Executor/ExecutorTask';
import baseEmit from './base';
// <GSL customizable: hedgehog-imports>
import { type SimulatorType } from '../components/ide/Simulator';
import { Robot } from '../components/ide/Simulator/Simulation';
import { type Command } from '../executor/Hedgehog';
// </GSL customizable: hedgehog-imports>

export default async function init(getSimulator: () => Promise<SimulatorType>) {
// <GSL customizable: hedgehog-init>
async function getRobot(name: string) {
return (await getSimulator()).simulation.robots.get(name);
async function getRobot(name: string): Promise<Robot> {
const robot = (await getSimulator()).simulation.robots.get(name);
if (robot === undefined) throw new Error(`no robot named "${name}"`);
return robot;
}
// </GSL customizable: hedgehog-init>

Expand Down

0 comments on commit c08e600

Please sign in to comment.