From 717f13ebe0c540011458f756ba767dd7a933e9c4 Mon Sep 17 00:00:00 2001 From: thepaperpilot Date: Sun, 10 Jul 2022 02:20:51 -0500 Subject: [PATCH] Fix typing errors --- src/features/particles/Particles.vue | 2 +- src/game/layers.tsx | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/features/particles/Particles.vue b/src/features/particles/Particles.vue index d5ecdcb..04307d0 100644 --- a/src/features/particles/Particles.vue +++ b/src/features/particles/Particles.vue @@ -46,7 +46,7 @@ export default defineComponent({ backgroundAlpha: 0 }); resizeListener.value?.appendChild(app.value.view); - props.onInit(app.value as Application); + props.onInit?.(app.value as Application); } updateBounds(); if (props.onHotReload) { diff --git a/src/game/layers.tsx b/src/game/layers.tsx index e8d22c3..ea40350 100644 --- a/src/game/layers.tsx +++ b/src/game/layers.tsx @@ -35,7 +35,7 @@ export interface FeatureNode { * An injection key that a {@link Context} will use to provide a function that registers a {@link FeatureNode} with the given id and HTML element. */ export const RegisterNodeInjectionKey: InjectionKey<(id: string, element: HTMLElement) => void> = - Symbol("RegisterNode"); + Symbol("RegisterNode"); /** * An injection key that a {@link Context} will use to provide a function that unregisters a {@link FeatureNode} with the given id. */ @@ -196,7 +196,9 @@ export function createLayer( const layer = {} as T & Partial; const emitter = (layer.emitter = createNanoEvents()); layer.on = emitter.on.bind(emitter); - layer.emit = emitter.emit.bind(emitter); + layer.emit = emitter.emit.bind(emitter) as ( + ...args: [K, ...Parameters] + ) => void; layer.nodes = ref({}); layer.id = id;