void) | boolean | 'default'
export type ConstructorRepresentation = new (...args: any[]) => any
+// eslint-disable-next-line ts/no-unsafe-function-type
export type NonFunctionKeys = { [K in keyof P]-?: P[K] extends Function ? never : K }[keyof P]
export type Overwrite
= Omit
> & O
export type Properties = Pick>
@@ -25,12 +27,17 @@ export type EmitEventName = 'render' | 'ready' | 'click' | 'double-click' | 'con
export type EmitEventFn = (event: EmitEventName, ...args: any[]) => void
export type TresCamera = THREE.OrthographicCamera | THREE.PerspectiveCamera
+/**
+ * Represents the properties of an instance.
+ *
+ * @template T - The type of the object.
+ * @template P - The type of the arguments.
+ */
export interface InstanceProps {
args?: Args
object?: T
visible?: boolean
dispose?: null
- [prop: string]: any
}
interface TresBaseObject {
@@ -155,10 +162,10 @@ export interface EventHandlers {
}
interface MathRepresentation {
- set: (...args: number[] | [THREE.ColorRepresentation]) => any
+ set(...args: number[] | [THREE.ColorRepresentation]): any
}
interface VectorRepresentation extends MathRepresentation {
- setScalar: (s: number) => any
+ setScalar(s: number): any
}
export interface VectorCoordinates {
@@ -195,14 +202,14 @@ interface RaycastableRepresentation {
}
type EventProps
= P extends RaycastableRepresentation ? Partial : unknown
-export interface VueProps {
- children?: VNode
[]
+export interface VueProps {
+ children?: VNode[]
ref?: VNodeRef
key?: string | number | symbol
}
type ElementProps> = Partial<
- Overwrite, VueProps & EventProps
>
+ Overwrite
& VueProps & EventProps
>
>
export type ThreeElement = Mutable<
diff --git a/src/utils/createPriorityEventHook.test.ts b/src/utils/createPriorityEventHook.test.ts
index d7be2d2f4..79444594d 100644
--- a/src/utils/createPriorityEventHook.test.ts
+++ b/src/utils/createPriorityEventHook.test.ts
@@ -1,3 +1,4 @@
+/* eslint-disable unicorn/consistent-function-scoping */
import { createPriorityEventHook } from './createPriorityEventHook'
let updateHook = createPriorityEventHook()
diff --git a/src/utils/index.ts b/src/utils/index.ts
index f5ac470f9..5ab5bdbe3 100644
--- a/src/utils/index.ts
+++ b/src/utils/index.ts
@@ -451,7 +451,7 @@ export function invalidateInstance(instance: TresObject) {
}
export function noop(fn: string): any {
- // eslint-disable-next-line no-unused-expressions
+ // eslint-disable-next-line ts/no-unused-expressions
fn
}
diff --git a/src/utils/is.ts b/src/utils/is.ts
index 551844a02..639377767 100644
--- a/src/utils/is.ts
+++ b/src/utils/is.ts
@@ -21,6 +21,7 @@ export function bool(u: unknown): u is boolean {
return u === true || u === false
}
+// eslint-disable-next-line ts/no-unsafe-function-type
export function fun(u: unknown): u is Function {
return typeof u === 'function'
}