Skip to content

Commit 63c66e2

Browse files
committed
Fixed playground example indenting
1 parent 994e259 commit 63c66e2

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

src/playground/index.ts

+27-27
Original file line numberDiff line numberDiff line change
@@ -37,33 +37,33 @@ document.addEventListener('DOMContentLoaded', () => {
3737
// Actual editor and transpilation
3838
let example = `/** @noSelfInFile */
3939
40-
// Declare exposed API
41-
type Vector = [number, number, number];
42-
43-
declare interface OnSpellStartEvent {
44-
caster: Unit;
45-
targetLocation: Vector;
46-
}
47-
48-
declare class Unit {
49-
getLevel(): number;
50-
isEnemy(other: Unit): boolean;
51-
kill(): void;
52-
}
53-
54-
declare function print(...messages: any[]): void;
55-
declare function FindUnitsInRadius(location: Vector, radius: number): Unit[];
56-
57-
// Use declared API in code
58-
function onSpellStart(event: OnSpellStartEvent): void {
59-
const units = FindUnitsInRadius(event.targetLocation, 500);
60-
const enemies = units.filter(unit => event.caster.isEnemy(unit));
61-
62-
for (const unit of enemies) {
63-
print(unit, unit.getLevel());
64-
unit.kill();
65-
}
66-
}`;
40+
// Declare exposed API
41+
type Vector = [number, number, number];
42+
43+
declare interface OnSpellStartEvent {
44+
caster: Unit;
45+
targetLocation: Vector;
46+
}
47+
48+
declare class Unit {
49+
getLevel(): number;
50+
isEnemy(other: Unit): boolean;
51+
kill(): void;
52+
}
53+
54+
declare function print(...messages: any[]): void;
55+
declare function FindUnitsInRadius(location: Vector, radius: number): Unit[];
56+
57+
// Use declared API in code
58+
function onSpellStart(event: OnSpellStartEvent): void {
59+
const units = FindUnitsInRadius(event.targetLocation, 500);
60+
const enemies = units.filter(unit => event.caster.isEnemy(unit));
61+
62+
for (const unit of enemies) {
63+
print(unit, unit.getLevel());
64+
unit.kill();
65+
}
66+
}`;
6767

6868
var queryStringSrcStart = window.location.hash.indexOf("#src=");
6969
if (queryStringSrcStart == 0) {

0 commit comments

Comments
 (0)