Skip to content

Commit

Permalink
fix: make source.data be any
Browse files Browse the repository at this point in the history
  • Loading branch information
0b5vr committed Feb 22, 2022
1 parent d55cc7c commit cb6cd9c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
13 changes: 2 additions & 11 deletions types/three/src/textures/Source.d.ts
Original file line number Diff line number Diff line change
@@ -1,25 +1,16 @@
import { DataTexture } from './DataTexture';

export type SourceData =
| HTMLImageElement
| HTMLCanvasElement
| ImageBitmap
| ImageData
| (HTMLImageElement | DataTexture)[];

/**
* Represents the data source of a texture.
*/
export class Source {
/**
* @param [data] The data definition of a texture. default is **null**.
*/
constructor(data: SourceData);
constructor(data: any);

/**
* The actual data of a texture. The type of this property depends on the texture that uses this instance.
*/
data: SourceData;
data: any;

/**
* Set this to **true** to trigger a data upload to the GPU next time the source is used.
Expand Down
6 changes: 3 additions & 3 deletions types/three/src/textures/Texture.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Vector2 } from './../math/Vector2';
import { Matrix3 } from './../math/Matrix3';
import { Source, SourceData } from './Source';
import { Source } from './Source';
import { EventDispatcher } from './../core/EventDispatcher';
import {
Mapping,
Expand Down Expand Up @@ -61,7 +61,7 @@ export class Texture extends EventDispatcher {
* video element as a source for your texture image and continuously update this texture
* as long as video is playing - the {@link VideoTexture} class handles this automatically.
*/
get image(): SourceData | HTMLVideoElement;
get image(): any;

/**
* An image object, typically created using the {@link TextureLoader.load} method.
Expand All @@ -71,7 +71,7 @@ export class Texture extends EventDispatcher {
* video element as a source for your texture image and continuously update this texture
* as long as video is playing - the {@link VideoTexture} class handles this automatically.
*/
set image(data: SourceData | HTMLVideoElement);
set image(data: any);

/**
* @default []
Expand Down

0 comments on commit cb6cd9c

Please sign in to comment.