From 5562d5f496cb714e4f31a287d1f3860152790c6b Mon Sep 17 00:00:00 2001 From: Kevin Levron Date: Mon, 26 Apr 2021 18:36:57 +0200 Subject: [PATCH] improve meshes ts --- src/meshes/Mesh.ts | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/meshes/Mesh.ts b/src/meshes/Mesh.ts index 2e593a0..9d2f84c 100644 --- a/src/meshes/Mesh.ts +++ b/src/meshes/Mesh.ts @@ -69,7 +69,7 @@ const Mesh = defineComponent({ this.initObject3D(mesh) }, createGeometry() {}, - addGeometryWatchers(props: ComponentPropsOptions) { + addGeometryWatchers(props: Readonly) { Object.keys(props).forEach(prop => { // @ts-ignore watch(() => this[prop], () => { @@ -105,15 +105,16 @@ const Mesh = defineComponent({ export default Mesh -// @ts-ignore -export function meshComponent(name, props, createGeometry) { +// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types +export function meshComponent

>( + name: string, + props: P, + createGeometry: {(c: any): BufferGeometry} +) { return defineComponent({ name, extends: Mesh, props, - setup(): MeshSetupInterface { - return {} - }, created() { this.createGeometry() this.addGeometryWatchers(props) @@ -123,6 +124,5 @@ export function meshComponent(name, props, createGeometry) { this.geometry = createGeometry(this) }, }, - // __hmrId: name, }) }