diff --git a/types/three/examples/jsm/loaders/GLTFLoader.d.ts b/types/three/examples/jsm/loaders/GLTFLoader.d.ts index 21b112551..bafdf1893 100644 --- a/types/three/examples/jsm/loaders/GLTFLoader.d.ts +++ b/types/three/examples/jsm/loaders/GLTFLoader.d.ts @@ -36,7 +36,7 @@ export interface GLTF { extras?: any; }; parser: GLTFParser; - userData: any; + userData: Record; } export class GLTFLoader extends Loader { diff --git a/types/three/examples/jsm/loaders/SVGLoader.d.ts b/types/three/examples/jsm/loaders/SVGLoader.d.ts index ccc8ea586..fb28592d5 100644 --- a/types/three/examples/jsm/loaders/SVGLoader.d.ts +++ b/types/three/examples/jsm/loaders/SVGLoader.d.ts @@ -1,11 +1,7 @@ import { Loader, LoadingManager, ShapePath, BufferGeometry, Vector3, Shape, Vector2 } from '../../../src/Three.js'; export interface SVGResultPaths extends ShapePath { - userData?: - | { - [key: string]: any; - } - | undefined; + userData?: Record | undefined; } export interface SVGResult { diff --git a/types/three/examples/jsm/nodes/core/constants.d.ts b/types/three/examples/jsm/nodes/core/constants.d.ts index 98aa0c066..fc2bf8b15 100644 --- a/types/three/examples/jsm/nodes/core/constants.d.ts +++ b/types/three/examples/jsm/nodes/core/constants.d.ts @@ -54,9 +54,7 @@ export type NodeTypeOption = export type SwizzleOption = string; /** Should be the same type as Object3D.userData */ -export interface NodeUserData { - [key: string]: any; -} +export type NodeUserData = Record; /** generic key value type,curretly used by nodes */ export interface AnyObject { diff --git a/types/three/src/core/BufferGeometry.d.ts b/types/three/src/core/BufferGeometry.d.ts index ecab628bc..cf40ba1fe 100644 --- a/types/three/src/core/BufferGeometry.d.ts +++ b/types/three/src/core/BufferGeometry.d.ts @@ -188,7 +188,7 @@ export class BufferGeometry< * An object that can be used to store custom data about the BufferGeometry. It should not hold references to functions as these will not be cloned. * @defaultValue `{}` */ - userData: { [key: string]: any }; + userData: Record; /** * Read-only flag to check if a given object is of type {@link BufferGeometry}. diff --git a/types/three/src/core/Object3D.d.ts b/types/three/src/core/Object3D.d.ts index 96c1356e8..7784a5a84 100644 --- a/types/three/src/core/Object3D.d.ts +++ b/types/three/src/core/Object3D.d.ts @@ -208,7 +208,7 @@ export class Object3D ext * @remarks It should not hold references to _functions_ as these **will not** be cloned. * @default `{}` */ - userData: { [key: string]: any }; // TODO Replace this to a Record? + userData: Record; /** * Custom depth material to be used when rendering to the depth map. diff --git a/types/three/src/materials/Material.d.ts b/types/three/src/materials/Material.d.ts index 59d476634..6d79f5724 100644 --- a/types/three/src/materials/Material.d.ts +++ b/types/three/src/materials/Material.d.ts @@ -60,7 +60,7 @@ export interface MaterialParameters { stencilFail?: StencilOp | undefined; stencilZFail?: StencilOp | undefined; stencilZPass?: StencilOp | undefined; - userData?: any; + userData?: Record | undefined; } /** @@ -379,7 +379,7 @@ export class Material extends EventDispatcher<{ dispose: {} }> { * An object that can be used to store custom data about the Material. It should not hold references to functions as these will not be cloned. * @default {} */ - userData: any; + userData: Record; /** * This starts at 0 and counts how many times .needsUpdate is set to true. diff --git a/types/three/src/textures/Texture.d.ts b/types/three/src/textures/Texture.d.ts index c90626664..3db15f285 100644 --- a/types/three/src/textures/Texture.d.ts +++ b/types/three/src/textures/Texture.d.ts @@ -366,7 +366,7 @@ export class Texture extends EventDispatcher<{ dispose: {} }> { * @remarks It should not hold references to functions as these will not be cloned. * @defaultValue `{}` */ - userData: any; + userData: Record; /** * This starts at `0` and counts how many times {@link needsUpdate | .needsUpdate} is set to `true`.