Fix typing errors
This commit is contained in:
parent
f90e226fe1
commit
717f13ebe0
2 changed files with 5 additions and 3 deletions
|
@ -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) {
|
||||
|
|
|
@ -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<T extends LayerOptions>(
|
|||
const layer = {} as T & Partial<BaseLayer>;
|
||||
const emitter = (layer.emitter = createNanoEvents<LayerEvents>());
|
||||
layer.on = emitter.on.bind(emitter);
|
||||
layer.emit = emitter.emit.bind(emitter);
|
||||
layer.emit = emitter.emit.bind(emitter) as <K extends keyof LayerEvents>(
|
||||
...args: [K, ...Parameters<LayerEvents[K]>]
|
||||
) => void;
|
||||
layer.nodes = ref({});
|
||||
layer.id = id;
|
||||
|
||||
|
|
Loading…
Reference in a new issue