瀏覽代碼

fix: fake a `VNodeRef` on types to accept strings and null (#344)

* fix: fake a `VNodeRef` on types to accept strings and null

* chore: remove unused VNodeRef import
Alvaro Saburido 1 年之前
父節點
當前提交
c069f6423d
共有 1 個文件被更改,包括 4 次插入4 次删除
  1. 4 4
      src/types/index.ts

+ 4 - 4
src/types/index.ts

@@ -144,7 +144,7 @@ type EventProps<P> = P extends RaycastableRepresentation ? Partial<EventHandlers
 
 
 export interface VueProps<P> {
 export interface VueProps<P> {
   children?: VNode[]
   children?: VNode[]
-  ref?: Ref<P>
+  ref?: string | null | Ref<P>
   key?: string
   key?: string
 }
 }
 
 
@@ -159,8 +159,8 @@ export type ThreeElement<T extends ConstructorRepresentation> = Mutable<
 type ThreeExports = typeof THREE
 type ThreeExports = typeof THREE
 type ThreeInstancesImpl = {
 type ThreeInstancesImpl = {
   [K in keyof ThreeExports as Uncapitalize<K>]: ThreeExports[K] extends ConstructorRepresentation
   [K in keyof ThreeExports as Uncapitalize<K>]: ThreeExports[K] extends ConstructorRepresentation
-    ? ThreeElement<ThreeExports[K]>
-    : never
+  ? ThreeElement<ThreeExports[K]>
+  : never
 }
 }
 
 
 export interface ThreeInstances extends ThreeInstancesImpl {
 export interface ThreeInstances extends ThreeInstancesImpl {
@@ -172,5 +172,5 @@ type TresComponents = {
 }
 }
 
 
 declare module 'vue' {
 declare module 'vue' {
-  export interface GlobalComponents extends TresComponents {}
+  export interface GlobalComponents extends TresComponents { }
 }
 }