Browse Source

fix(types-(fix-#427)): vueprops change ref to vnoderef and key add number and symbol (#428)

Updated `ref` in VueProps to use `VNodeRef` type from vue, to support using a function ref. Also updated key to accept numbers and symbols

#427 https://github.com/Tresjs/tres/issues/427

Co-authored-by: Patrick Byrn <pbyrn@asu.edu>
Patrick Byrn 1 year ago
parent
commit
45aeafd41c
1 changed files with 3 additions and 3 deletions
  1. 3 3
      src/types/index.ts

+ 3 - 3
src/types/index.ts

@@ -1,5 +1,5 @@
 /* eslint-disable @typescript-eslint/ban-types */
-import type { DefineComponent, Ref, VNode } from 'vue'
+import type { DefineComponent, VNode, VNodeRef } from 'vue'
 
 import type * as THREE from 'three'
 import type { EventProps as PointerEventHandlerEventProps } from '../composables/usePointerEventHandler'
@@ -160,8 +160,8 @@ type EventProps<P> = P extends RaycastableRepresentation ? Partial<EventHandlers
 
 export interface VueProps<P> {
   children?: VNode[]
-  ref?: string | null | Ref<P>
-  key?: string
+  ref?: VNodeRef
+  key?: string | number | symbol
 }
 
 type ElementProps<T extends ConstructorRepresentation, P = InstanceType<T>> = Partial<