threepipe
Version:
A modern 3D viewer framework built on top of three.js, written in TypeScript, designed to make creating high-quality, modular, and extensible 3D experiences on the web simple and enjoyable.
62 lines • 2.1 kB
TypeScript
import { IMaterial } from './IMaterial';
import { Source, Texture, TextureEventMap } from 'three';
import { IRenderTarget } from '../rendering';
import { ChangeEvent, UiObjectConfig } from 'uiconfig.js';
import { IObject3D } from './IObject';
export interface ITextureUserData {
mimeType?: string;
embedUrlImagePreviews?: boolean;
/**
* Automatically dispose texture when not used by any material that's applied to some object in the scene.
* Works only after it's applied to a material once.
*/
disposeOnIdle?: boolean;
timeline?: {
enabled: boolean;
delay?: number;
scale?: number;
start?: number;
end?: number;
};
[key: string]: any;
}
export type ITextureEventMap = TextureEventMap;
declare module 'three' {
interface TextureEventMap {
textureUpdate: {
texture: Texture;
bubbleToObject?: boolean;
bubbleToParent?: boolean;
uiChangeEvent?: ChangeEvent;
};
}
}
export interface ITexture<TE extends ITextureEventMap = ITextureEventMap> extends Texture<TE> {
assetType?: 'texture';
userData: ITextureUserData;
readonly isTexture: true;
isDataTexture?: boolean;
isCubeTexture?: boolean;
isVideoTexture?: boolean;
isCanvasTexture?: boolean;
isCompressedTexture?: boolean;
is3DDataTexture?: boolean;
setDirty?(): void;
source: Source & {
_sourceImgBuffer?: ArrayBuffer | Uint8Array;
_canSerialize?: boolean;
};
/**
* Objects/Materials in the scene that are using this texture.
* This is set in the {@link Object3DManager} when the objects are added/removed from the scene. Do not modify this set directly.
*/
appliedObjects?: Set<IObject3D | IMaterial>;
uiConfig?: UiObjectConfig;
/**
* for internal use only. refers to the render target that this texture is attached to
* @internal
*/
['_target']?: IRenderTarget;
}
export declare function upgradeTexture(this: ITexture): void;
//# sourceMappingURL=../src/core/ITexture.d.ts.map