Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@types/three

Package Overview
Dependencies
Maintainers
1
Versions
231
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@types/three - npm Package Compare versions

Comparing version 0.151.0 to 0.152.0

three/build/three.min.d.ts

1

three/examples/jsm/nodes/core/constants.d.ts

@@ -12,2 +12,3 @@ import { Color, Matrix3, Matrix4, Vector2, Vector3, Vector4 } from '../../../../src/Three';

FRAME: 'frame';
RENDER: 'render';
OBJECT: 'object';

@@ -14,0 +15,0 @@ };

8

three/examples/jsm/nodes/core/NodeBuilder.d.ts

@@ -48,3 +48,2 @@ import {

scene: Scene;
lightsNode: LightsNode;

@@ -89,9 +88,2 @@ fogNode: FogNode;

abstract getTexture(textureProperty: string, uvSnippet: string): string;
abstract getTextureLevel(textureProperty: string, uvSnippet: string, levelSnippet: string): string;
abstract getCubeTexture(textureProperty: string, uvSnippet: string): string;
abstract getCubeTextureLevel(textureProperty: string, uvSnippet: string, levelSnippet: string): string;
// @TODO: rename to .generateConst()

@@ -98,0 +90,0 @@ getConst(type: NodeTypeOption, value?: unknown): Node;

import NodeMaterial from './NodeMaterial';
import { ShaderMaterialParameters } from '../../../../src/Three';
import { Node } from '../Nodes';

@@ -8,10 +7,4 @@ export default class LineBasicNodeMaterial extends NodeMaterial {

colorNode: Node | null;
opacityNode: Node | null;
alphaTestNode: Node | null;
lightNode: Node | null;
positionNode: Node | null;
constructor(parameters?: ShaderMaterialParameters);
copy(source: LineBasicNodeMaterial): this;
}
import NodeMaterial from './NodeMaterial';
import Node from '../core/Node';
import { ShaderMaterialParameters } from '../../../../src/Three';

@@ -9,12 +8,4 @@

colorNode: Node | null;
opacityNode: Node | null;
alphaTestNode: Node | null;
lightNode: Node | null;
positionNode: Node | null;
constructor(paramters?: ShaderMaterialParameters);
copy(source: MeshBasicNodeMaterial): this;
}

@@ -8,6 +8,2 @@ import { ShaderMaterialParameters } from '../../../../src/Three';

colorNode: Node | null;
opacityNode: Node | null;
alphaTestNode: Node | null;
normalNode: Node | null;
emissiveNode: Node | null;

@@ -21,9 +17,4 @@

envNode: Node | null;
lightsNode: Node | null;
positionNode: Node | null;
constructor(paramters?: ShaderMaterialParameters);
copy(source: MeshStandardNodeMaterial): this;
}

@@ -8,4 +8,20 @@ import { Material, ShaderMaterial } from '../../../../src/Three';

isNodeMaterial: true;
type: string;
lights: true;
type: string;
normals: true;
lightsNode: Node | null;
envNode: Node | null;
colorNode: Node | null;
normalNode: Node | null;
opacityNode: Node | null;
backdropNode: Node | null;
backdropAlphaNode: Node | null;
alphaTestNode: Node | null;
positionNode: Node | null;
constructor();

@@ -12,0 +28,0 @@

@@ -30,3 +30,4 @@ // constants

export * as NodeUtils from './core/NodeUtils.js';
import * as NodeUtils from './core/NodeUtils.js';
export { NodeUtils };

@@ -145,3 +146,3 @@ // math

export { default as getDistanceAttenuation } from './functions/light/getDistanceAttenuation';
export { getDistanceAttenuation } from './lighting/LightUtils';

@@ -148,0 +149,0 @@ export { default as getGeometryRoughness } from './functions/material/getGeometryRoughness';

@@ -59,4 +59,2 @@ import Node from '../core/Node';

export { default as getDistanceAttenuation } from '../functions/light/getDistanceAttenuation';
export { default as getGeometryRoughness } from '../functions/material/getGeometryRoughness';

@@ -63,0 +61,0 @@ export { default as getRoughness } from '../functions/material/getRoughness';

@@ -15,5 +15,5 @@ import { Object3D, Scene, Camera } from '../../../src/Three';

export type CSS3DParameters = {
export interface CSS3DParameters {
element?: HTMLElement;
};
}

@@ -20,0 +20,0 @@ export class CSS3DRenderer {

@@ -16,21 +16,2 @@ import NodeBuilder from '../../../nodes/core/NodeBuilder';

getTexture(textureProperty: string, uvSnippet: string): string;
getTextureBias(textureProperty: string, uvSnippet: string, biasSnippet: string): string;
getTextureLevel(
textureProperty: string,
uvSnippet: string,
biasSnippet: string,
shaderStage?: NodeShaderStageOption,
): string;
getCubeTexture(texturePropert: string, uvSnippet: string, shaderStage?: NodeShaderStageOption): string;
getCubeTextureLevel(
textureProperty: string,
uvSnippet: string,
biasSnippet: string,
shaderStage?: NodeShaderStageOption,
): string;
getCubeTextureBias(textureProperty: string, uvSnippet: string, biasSnippet: string): string;
getUniforms(shaderStage: string): string;

@@ -37,0 +18,0 @@

@@ -1,3 +0,5 @@

import { AnimationClip, Bone, Matrix4, Object3D, Skeleton, SkeletonHelper } from '../../../src/Three';
import { AnimationClip, Object3D, Skeleton } from '../../../src/Three';
export function clone(source: Object3D): Object3D;
export function retarget(target: Object3D | Skeleton, source: Object3D | Skeleton, options: {}): void;

@@ -11,19 +13,1 @@

): AnimationClip;
export function getHelperFromSkeleton(skeleton: Skeleton): SkeletonHelper;
export function getSkeletonOffsets(target: Object3D | Skeleton, source: Object3D | Skeleton, options: {}): Matrix4[];
export function renameBones(skeleton: Skeleton, names: {}): any;
export function getBones(skeleton: Skeleton | Bone[]): Bone[];
export function getBoneByName(name: string, skeleton: Skeleton): Bone;
export function getNearestBone(bone: Bone, names: {}): Bone;
export function findBoneTrackData(name: string, tracks: any[]): {};
export function getEqualsBonesNames(skeleton: Skeleton, targetSkeleton: Skeleton): string[];
export function clone(source: Object3D): Object3D;

@@ -1,2 +0,2 @@

// Type definitions for three 0.151
// Type definitions for three 0.152
// Project: https://threejs.org/

@@ -3,0 +3,0 @@ // Definitions by: Josh Ellis <https://github.com/joshuaellis>

{
"name": "@types/three",
"version": "0.151.0",
"version": "0.152.0",
"description": "TypeScript definitions for three",

@@ -28,2 +28,3 @@ "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/three",

"dependencies": {
"@tweenjs/tween.js": "~18.6.4",
"@types/stats.js": "*",

@@ -34,3 +35,3 @@ "@types/webxr": "*",

},
"typesPublisherContentHash": "d8fac10d09ead80aa5112cb6407ef75e354363f34bdd002bfb12b3c5d40cb691",
"typesPublisherContentHash": "c206b6e9fcb60fc53d60b9c172bf339b663fa61d521aa358641f9b16d55913ed",
"typeScriptVersion": "4.4",

@@ -37,0 +38,0 @@ "exports": {

@@ -11,4 +11,4 @@ # Installation

### Additional Details
* Last updated: Fri, 28 Apr 2023 20:02:51 GMT
* Dependencies: [@types/fflate](https://npmjs.com/package/@types/fflate), [@types/lil-gui](https://npmjs.com/package/@types/lil-gui), [@types/stats.js](https://npmjs.com/package/@types/stats.js), [@types/webxr](https://npmjs.com/package/@types/webxr)
* Last updated: Thu, 04 May 2023 00:02:50 GMT
* Dependencies: [@types/fflate](https://npmjs.com/package/@types/fflate), [@types/lil-gui](https://npmjs.com/package/@types/lil-gui), [@types/stats.js](https://npmjs.com/package/@types/stats.js), [@types/tweenjs__tween.js](https://npmjs.com/package/@types/tweenjs__tween.js), [@types/webxr](https://npmjs.com/package/@types/webxr)
* Global values: `THREE`

@@ -15,0 +15,0 @@

@@ -684,3 +684,5 @@ export const REVISION: string;

/** @deprecated Use {@link LinearSRGBColorSpace} or {@link NoColorSpace} in three.js r152+. */
export const LinearEncoding: 3000;
/** @deprecated Use {@link SRGBColorSpace} in three.js r152+. */
export const sRGBEncoding: 3001;

@@ -690,2 +692,3 @@ /**

* @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
* @deprecated Use {@link ColorSpace} in three.js r152+.
*/

@@ -906,24 +909,1 @@ export type TextureEncoding = typeof LinearEncoding | typeof sRGBEncoding;

| 'DEPTH32F_STENCIL8';
///////////////////////////////////////////////////////////////////////////////
export type BuiltinShaderAttributeName =
| 'position'
| 'normal'
| 'uv'
| 'color'
| 'skinIndex'
| 'skinWeight'
| 'instanceMatrix'
| 'morphTarget0'
| 'morphTarget1'
| 'morphTarget2'
| 'morphTarget3'
| 'morphTarget4'
| 'morphTarget5'
| 'morphTarget6'
| 'morphTarget7'
| 'morphNormal0'
| 'morphNormal1'
| 'morphNormal2'
| 'morphNormal3';
import { BufferAttribute } from './BufferAttribute';
import { InterleavedBufferAttribute } from './InterleavedBufferAttribute';
import { Box3 } from '../math/Box3';
import { Sphere } from '../math/Sphere';
import { Matrix4 } from '../math/Matrix4';
import { Quaternion } from '../math/Quaternion';
import { Vector2 } from '../math/Vector2';
import { Vector3 } from '../math/Vector3';
import { EventDispatcher } from './EventDispatcher';
import { GLBufferAttribute } from './GLBufferAttribute';
import { Box3 } from './../math/Box3';
import { Sphere } from './../math/Sphere';
import { Matrix4 } from './../math/Matrix4';
import { Quaternion } from './../math/Quaternion';
import { Vector2 } from './../math/Vector2';
import { Vector3 } from './../math/Vector3';
import { EventDispatcher } from './EventDispatcher';
import { BuiltinShaderAttributeName } from '../constants';
import * as BufferGeometryUtils from '../../examples/jsm/utils/BufferGeometryUtils';
export type NormalBufferAttributes = Record<string, BufferAttribute | InterleavedBufferAttribute>;
export type NormalOrGLBufferAttributes = Record<
string,
BufferAttribute | InterleavedBufferAttribute | GLBufferAttribute
>;
/**

@@ -22,17 +26,43 @@ * A representation of mesh, line, or point geometry

* const geometry = new THREE.BufferGeometry();
*
* // create a simple square shape. We duplicate the top left and bottom right
* // vertices because each vertex needs to appear once per triangle.
* const vertices = new Float32Array([
* -1.0, -1.0, 1.0,
* 1.0, -1.0, 1.0,
* 1.0, 1.0, 1.0,
* const vertices = new Float32Array( [
* -1.0, -1.0, 1.0, // v0
* 1.0, -1.0, 1.0, // v1
* 1.0, 1.0, 1.0, // v2
*
* 1.0, 1.0, 1.0,
* -1.0, 1.0, 1.0,
* -1.0, -1.0, 1.0]);
* 1.0, 1.0, 1.0, // v3
* -1.0, 1.0, 1.0, // v4
* -1.0, -1.0, 1.0 // v5
* ] );
*
* // itemSize = 3 because there are 3 values (components) per vertex
* geometry.setAttribute('position', new THREE.BufferAttribute(vertices, 3));
* const material = new THREE.MeshBasicMaterial({ color: 0xff0000 });
* const mesh = new THREE.Mesh(geometry, material);
* geometry.setAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
* const material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
* const mesh = new THREE.Mesh( geometry, material );
* ```
* @example
* ```typescript
* const geometry = new THREE.BufferGeometry();
*
* const vertices = new Float32Array( [
* -1.0, -1.0, 1.0, // v0
* 1.0, -1.0, 1.0, // v1
* 1.0, 1.0, 1.0, // v2
* -1.0, 1.0, 1.0, // v3
* ] );
* geometry.setAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
*
* const indices = [
* 0, 1, 2,
* 2, 3, 0,
* ];
*
* geometry.setIndex( indices );
* geometry.setAttribute( 'position', new THREE.BufferAttribute( vertices, 3 ) );
*
* const material = new THREE.MeshBasicMaterial( { color: 0xff0000 } );
* const mesh = new THREE.Mesh( geometry, material );
* ```
* @see Example: {@link https://threejs.org/examples/#webgl_buffergeometry | Mesh with non-indexed faces}

@@ -47,3 +77,5 @@ * @see Example: {@link https://threejs.org/examples/#webgl_buffergeometry_indexed | Mesh with indexed faces}

*/
export class BufferGeometry extends EventDispatcher {
export class BufferGeometry<
Attributes extends NormalOrGLBufferAttributes = NormalBufferAttributes,
> extends EventDispatcher {
/**

@@ -92,5 +124,3 @@ * This creates a new {@link THREE.BufferGeometry | BufferGeometry} object.

*/
attributes: {
[name: string]: BufferAttribute | InterleavedBufferAttribute | GLBufferAttribute; // TODO Replace for 'Record<>'
};
attributes: Attributes;

@@ -191,6 +221,3 @@ /**

*/
setAttribute(
name: BuiltinShaderAttributeName | (string & {}),
attribute: BufferAttribute | InterleavedBufferAttribute | GLBufferAttribute,
): this;
setAttribute<K extends keyof Attributes>(name: K, attribute: Attributes[K]): this;

@@ -201,5 +228,3 @@ /**

*/
getAttribute(
name: BuiltinShaderAttributeName | (string & {}),
): BufferAttribute | InterleavedBufferAttribute | GLBufferAttribute;
getAttribute<K extends keyof Attributes>(name: K): Attributes[K];

@@ -210,3 +235,3 @@ /**

*/
deleteAttribute(name: BuiltinShaderAttributeName | (string & {})): BufferGeometry;
deleteAttribute(name: keyof Attributes): this;

@@ -217,3 +242,3 @@ /**

*/
hasAttribute(name: BuiltinShaderAttributeName | (string & {})): boolean;
hasAttribute(name: keyof Attributes): boolean;

@@ -339,3 +364,5 @@ /**

/**
* Computes vertex normals by averaging face normals.
* Computes vertex normals for the given vertex data. For indexed geometries, the method sets each vertex normal to
* be the average of the face normals of the faces that share that vertex. For non-indexed geometries, vertices are
* not shared, and the method sets each vertex normal to be the same as the face normal.
*/

@@ -342,0 +369,0 @@ computeVertexNormals(): void;

@@ -30,3 +30,3 @@ import { Vector3 } from './../math/Vector3';

uv?: Vector2 | undefined;
uv2?: Vector2 | undefined;
uv1?: Vector2 | undefined;
normal?: Vector3;

@@ -33,0 +33,0 @@ /** The index number of the instance where the ray intersects the {@link THREE.InstancedMesh | InstancedMesh } */

@@ -92,3 +92,3 @@ import { IUniform } from '../renderers/shaders/UniformsLib';

/**
* @default { 'color': [ 1, 1, 1 ], 'uv': [ 0, 0 ], 'uv2': [ 0, 0 ] }
* @default { 'color': [ 1, 1, 1 ], 'uv': [ 0, 0 ], 'uv1': [ 0, 0 ] }
*/

@@ -95,0 +95,0 @@ defaultAttributeValues: any;

@@ -1,6 +0,7 @@

import { Material } from './../materials/Material';
import { Raycaster } from './../core/Raycaster';
import { Object3D } from './../core/Object3D';
import { BufferGeometry } from '../core/BufferGeometry';
import { Intersection } from '../core/Raycaster';
import { Material } from '../materials/Material';
import { Object3D } from '../core/Object3D';
import { BufferGeometry, NormalOrGLBufferAttributes } from '../core/BufferGeometry';
import { BufferAttribute } from '../core/BufferAttribute';
import { InterleavedBufferAttribute } from '../core/InterleavedBufferAttribute';
import { GLBufferAttribute } from '../core/GLBufferAttribute';

@@ -15,3 +16,3 @@ /**

export class Points<
TGeometry extends BufferGeometry = BufferGeometry,
TGeometry extends BufferGeometry<NormalOrGLBufferAttributes> = BufferGeometry,
TMaterial extends Material | Material[] = Material | Material[],

@@ -18,0 +19,0 @@ > extends Object3D {

@@ -17,3 +17,3 @@ import { Scene } from './../scenes/Scene';

import { Material } from './../materials/Material';
import { ToneMapping, ShadowMapType, CullFace, TextureEncoding } from '../constants';
import { ToneMapping, ShadowMapType, CullFace, TextureEncoding, ColorSpace } from '../constants';
import { WebXRManager } from '../renderers/webxr/WebXRManager';

@@ -193,2 +193,3 @@ import { BufferGeometry } from './../core/BufferGeometry';

* @default THREE.LinearEncoding
* @deprecated Use {@link WebGLRenderer.outputColorSpace .outputColorSpace} in three.js r152+.
*/

@@ -198,2 +199,9 @@ outputEncoding: TextureEncoding;

/**
* Color space used for output to HTMLCanvasElement. Supported values are
* {@link SRGBColorSpace} and {@link LinearSRGBColorSpace}.
* @default THREE.SRGBColorSpace.
*/
outputColorSpace: ColorSpace;
/**
* @default true

@@ -200,0 +208,0 @@ */

@@ -11,2 +11,3 @@ import { Vector4 } from './../math/Vector4';

MagnificationTextureFilter,
ColorSpace,
} from '../constants';

@@ -26,3 +27,5 @@

depthTexture?: DepthTexture | undefined;
/** @deprecated Use 'colorSpace' in three.js r152+. */
encoding?: TextureEncoding | undefined;
colorSpace?: ColorSpace | undefined;

@@ -29,0 +32,0 @@ /**

@@ -32,3 +32,2 @@ import { OffscreenCanvas, Texture } from './Texture';

* @param anisotropy See {@link Texture.anisotropy | .anisotropy}. Default {@link THREE.Texture.DEFAULT_ANISOTROPY}
* @param encoding See {@link Texture.encoding | .encoding}. Default {@link THREE.LinearEncoding}
*/

@@ -35,0 +34,0 @@ constructor(

@@ -7,5 +7,5 @@ import { Texture } from './Texture';

TextureDataType,
TextureEncoding,
MagnificationTextureFilter,
MinificationTextureFilter,
ColorSpace,
} from '../constants';

@@ -34,2 +34,3 @@

* @param anisotropy See {@link Texture.anisotropy | .anisotropy}. Default {@link THREE.Texture.DEFAULT_ANISOTROPY}
* @param colorSpace See {@link Texture.colorSpace .colorSpace}. Default {@link NoColorSpace}
*/

@@ -48,3 +49,3 @@ constructor(

anisotropy?: number,
encoding?: TextureEncoding,
colorSpace?: ColorSpace,
);

@@ -51,0 +52,0 @@

import { Texture } from './Texture';
import {
Mapping,
Wrapping,
PixelFormat,
TextureDataType,
TextureEncoding,
MagnificationTextureFilter,
MinificationTextureFilter,
CubeTextureMapping,
ColorSpace,
} from '../constants';

@@ -44,3 +43,3 @@

* @param anisotropy See {@link Texture.anisotropy | .anisotropy}. Default {@link THREE.Texture.DEFAULT_ANISOTROPY}
* @param encoding See {@link Texture.encoding | .encoding}. Default {@link THREE.LinearEncoding}
* @param colorSpace See {@link Texture.colorSpace | .colorSpace}. Default {@link NoColorSpace}
*/

@@ -57,3 +56,3 @@ constructor(

anisotropy?: number,
encoding?: TextureEncoding,
colorSpace?: ColorSpace,
);

@@ -60,0 +59,0 @@

@@ -7,5 +7,5 @@ import { Texture } from './Texture';

TextureDataType,
TextureEncoding,
MagnificationTextureFilter,
MinificationTextureFilter,
ColorSpace,
} from '../constants';

@@ -54,3 +54,3 @@ import { TextureImageData } from './types';

* @param anisotropy See {@link Texture.anisotropy | .anisotropy}. Default {@link THREE.Texture.DEFAULT_ANISOTROPY}
* @param encoding See {@link Texture.encoding | .encoding}. Default {@link THREE.LinearEncoding}
* @param colorSpace See {@link Texture.colorSpace | .colorSpace}. Default {@link NoColorSpace}
*/

@@ -69,3 +69,3 @@ constructor(

anisotropy?: number,
encoding?: TextureEncoding,
colorSpace?: ColorSpace,
);

@@ -72,0 +72,0 @@

@@ -16,2 +16,3 @@ import { Vector2 } from './../math/Vector2';

AnyMapping,
ColorSpace,
} from '../constants';

@@ -53,3 +54,3 @@

* @param anisotropy See {@link Texture.anisotropy | .anisotropy}. Default {@link THREE.Texture.DEFAULT_ANISOTROPY}
* @param encoding See {@link Texture.encoding | .encoding}. Default {@link THREE.LinearEncoding}
* @param colorSpace See {@link Texture.colorSpace | .colorSpace}. Default {@link THREE.NoColorSpace}
*/

@@ -66,6 +67,22 @@ constructor(

anisotropy?: number,
encoding?: TextureEncoding,
colorSpace?: ColorSpace,
);
/**
* @deprecated
*/
constructor(
image: TexImageSource | OffscreenCanvas,
mapping: Mapping,
wrapS: Wrapping,
wrapT: Wrapping,
magFilter: MagnificationTextureFilter,
minFilter: MinificationTextureFilter,
format: PixelFormat,
type: TextureDataType,
anisotropy: number,
encoding: TextureEncoding,
);
/**
* Read-only flag to check if a given object is of type {@link Texture}.

@@ -130,3 +147,4 @@ * @remarks This is a _constant_ value

/**
* Lets you select the uv attribute to map the texture to. `0` for `uv` and `1` for `uv2`.
* Lets you select the uv attribute to map the texture to. `0` for `uv`, `1` for `uv1`, `2` for `uv2` and `3` for
* `uv3`.
*/

@@ -322,2 +340,3 @@ channel: number;

* @defaultValue {@link THREE.LinearEncoding}
* @deprecated Use {@link Texture.colorSpace .colorSpace} in three.js r152+.
*/

@@ -327,2 +346,13 @@ encoding: TextureEncoding;

/**
* The {@link Textures | {@link Texture} constants} page for details of other color spaces.
* @remarks
* Textures containing color data should be annotated with {@link SRGBColorSpace THREE.SRGBColorSpace} or
* {@link LinearSRGBColorSpace THREE.LinearSRGBColorSpace}.
* @see {@link https://threejs.org/docs/index.html#api/en/constants/Textures | Texture Constants}
* @see {@link THREE.TextureDataType}
* @defaultValue {@link THREE.NoColorSpace}
*/
colorSpace: ColorSpace;
/**
* Indicates whether a texture belongs to a render target or not

@@ -329,0 +359,0 @@ * @defaultValue `false`

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc