Skip to content

Commit

Permalink
Remove types.d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
Methuselah96 committed Jul 30, 2023
1 parent 47f952a commit 8ad4218
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 36 deletions.
3 changes: 1 addition & 2 deletions types/three/src/core/BufferGeometry.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import { Vector2 } from '../math/Vector2.js';
import { Vector3 } from '../math/Vector3.js';
import { EventDispatcher } from './EventDispatcher.js';
import { GLBufferAttribute } from './GLBufferAttribute.js';
import { DisposableEventMap } from '../types.js';

export type NormalBufferAttributes = Record<string, BufferAttribute | InterleavedBufferAttribute>;
export type NormalOrGLBufferAttributes = Record<
Expand Down Expand Up @@ -76,7 +75,7 @@ export type NormalOrGLBufferAttributes = Record<
*/
export class BufferGeometry<
Attributes extends NormalOrGLBufferAttributes = NormalBufferAttributes,
> extends EventDispatcher<DisposableEventMap> {
> extends EventDispatcher<{ dispose: {} }> {
/**
* This creates a new {@link THREE.BufferGeometry | BufferGeometry} object.
*/
Expand Down
8 changes: 1 addition & 7 deletions types/three/src/core/RenderTarget.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import {
MagnificationTextureFilter,
ColorSpace,
} from '../constants.js';
import { Disposable, DisposableEventMap } from '../types.js';

export interface RenderTargetOptions {
wrapS?: Wrapping | undefined;
Expand All @@ -34,12 +33,7 @@ export interface RenderTargetOptions {
encoding?: TextureEncoding | undefined;
}

/* tslint:disable:one-line */
export class RenderTarget<TTexture extends Texture | Texture[] = Texture>
extends EventDispatcher<DisposableEventMap>
implements Disposable
{
/* tslint:enable:one-line */
export class RenderTarget<TTexture extends Texture | Texture[] = Texture> extends EventDispatcher<{ dispose: {} }> {
constructor(width?: number, height?: number, options?: RenderTargetOptions);

readonly isRenderTarget: true;
Expand Down
3 changes: 1 addition & 2 deletions types/three/src/core/UniformsGroup.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { EventDispatcher } from './EventDispatcher.js';
import { Uniform } from './Uniform.js';
import { Usage } from '../constants.js';
import { Disposable, DisposableEventMap } from '../types.js';

/**
* @see Example: {@link https://threejs.org/examples/#webgl2_ubo | WebGL2 / UBO}
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/core/UniformsGroup.js | Source}
*/
export class UniformsGroup extends EventDispatcher<DisposableEventMap> implements Disposable {
export class UniformsGroup extends EventDispatcher<{ dispose: {} }> {
constructor();

readonly isUniformsGroup: true;
Expand Down
3 changes: 1 addition & 2 deletions types/three/src/materials/Material.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
StencilOp,
PixelFormat,
} from '../constants.js';
import { Disposable, DisposableEventMap } from '../types.js';

export interface MaterialParameters {
alphaHash?: boolean | undefined;
Expand Down Expand Up @@ -64,7 +63,7 @@ export interface MaterialParameters {
/**
* Materials describe the appearance of objects. They are defined in a (mostly) renderer-independent way, so you don't have to rewrite materials if you decide to use a different renderer.
*/
export class Material extends EventDispatcher<DisposableEventMap> implements Disposable {
export class Material extends EventDispatcher<{ dispose: {} }> {
constructor();

alphaHash: boolean;
Expand Down
14 changes: 6 additions & 8 deletions types/three/src/objects/InstancedMesh.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import { Color } from '../math/Color.js';
import { Object3DEventMap } from '../core/Object3D.js';
import { Box3 } from '../math/Box3.js';
import { Sphere } from '../math/Sphere.js';
import { Disposable, DisposableEventMap } from '../types.js';
import { BaseEvent, EventListener, EventTypeValidator } from '../core/EventDispatcher.js';

export interface InstancedMeshEventMap extends Object3DEventMap, DisposableEventMap {}
export interface InstancedMeshEventMap extends Object3DEventMap {
dispose: {};
}

/**
* A special version of {@link THREE.Mesh | Mesh} with instanced rendering support
Expand All @@ -27,12 +28,9 @@ export interface InstancedMeshEventMap extends Object3DEventMap, DisposableEvent
*/
/* tslint:disable:one-line */
export class InstancedMesh<
TGeometry extends BufferGeometry = BufferGeometry,
TMaterial extends Material | Material[] = Material | Material[],
>
extends Mesh<TGeometry, TMaterial>
implements Disposable
{
TGeometry extends BufferGeometry = BufferGeometry,
TMaterial extends Material | Material[] = Material | Material[],
> extends Mesh<TGeometry, TMaterial> {
/* tslint:enable:one-line */
/**
* Create a new instance of {@link InstancedMesh}
Expand Down
3 changes: 1 addition & 2 deletions types/three/src/textures/Texture.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ import {
AnyMapping,
ColorSpace,
} from '../constants.js';
import { DisposableEventMap, Disposable } from '../types.js';

/** Shim for OffscreenCanvas. */
// tslint:disable-next-line:no-empty-interface
Expand All @@ -39,7 +38,7 @@ export interface OffscreenCanvas extends EventTarget {}
* @see {@link https://threejs.org/docs/index.html#api/en/textures/Texture | Official Documentation}
* @see {@link https://github.com/mrdoob/three.js/blob/master/src/Textures/Texture.js | Source}
*/
export class Texture extends EventDispatcher<DisposableEventMap> implements Disposable {
export class Texture extends EventDispatcher<{ dispose: {} }> {
/**
* This creates a new {@link THREE.Texture | Texture} object.
* @param image See {@link Texture.image | .image}. Default {@link THREE.Texture.DEFAULT_IMAGE}
Expand Down
13 changes: 0 additions & 13 deletions types/three/src/types.d.ts

This file was deleted.

0 comments on commit 8ad4218

Please sign in to comment.