Skip to content

Commit

Permalink
🤖 Merge PR DefinitelyTyped#71433 [three] r171 by @Methuselah96
Browse files Browse the repository at this point in the history
  • Loading branch information
Methuselah96 authored Dec 15, 2024
1 parent 40a91c1 commit 7f6d332
Show file tree
Hide file tree
Showing 112 changed files with 1,399 additions and 783 deletions.
1 change: 1 addition & 0 deletions types/three/build/three.core.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "../src/Three.Core.js";
1 change: 1 addition & 0 deletions types/three/build/three.core.min.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "../src/Three.Core.js";
1 change: 1 addition & 0 deletions types/three/build/three.tsl.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "../src/Three.TSL.js";
1 change: 1 addition & 0 deletions types/three/build/three.tsl.min.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from "../src/Three.TSL.js";
5 changes: 5 additions & 0 deletions types/three/examples/jsm/controls/ArcballControls.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,11 @@ declare class ArcballControls extends Controls<ArcballControlsEventMap> {
*/
enableAnimations: boolean;

/**
* Enable or disable camera focusing on double-tap (or click) operations. Default is true.
*/
enableFocus: boolean;

/**
* When set to true, a grid will appear when panning operation is being performed (desktop interaction only). Default is false.
*/
Expand Down
2 changes: 1 addition & 1 deletion types/three/examples/jsm/controls/TransformControls.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Camera, Controls, Mesh, Object3D, Quaternion, Raycaster, Vector3 } from "three";

type TransformControlsMode = "translate" | "rotate" | "scale";
export type TransformControlsMode = "translate" | "rotate" | "scale";

export interface TransformControlsEventMap {
/**
Expand Down
3 changes: 1 addition & 2 deletions types/three/examples/jsm/csm/CSMShadowNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Camera, DirectionalLightShadow, Light, Object3D } from "three";
import { Node } from "three/tsl";
import { Camera, DirectionalLightShadow, Light, Node, Object3D } from "three/webgpu";
import { CSMFrustum } from "./CSMFrustum.js";

export type CSMShadowNodeMode = "uniform" | "logarithmic" | "practical" | "custom";
Expand Down
30 changes: 23 additions & 7 deletions types/three/examples/jsm/exporters/GLTFExporter.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ declare class GLTFExporter {
*/
parse(
input: Object3D | Object3D[],
onDone: (gltf: ArrayBuffer | { [key: string]: any }) => void,
onDone: (gltf: ArrayBuffer | { [key: string]: unknown }) => void,
onError: (error: ErrorEvent) => void,
options?: GLTFExporterOptions,
): void;
Expand All @@ -101,18 +101,34 @@ declare class GLTFExporter {
parseAsync(
input: Object3D | Object3D[],
options?: GLTFExporterOptions,
): Promise<ArrayBuffer | { [key: string]: any }>;
): Promise<ArrayBuffer | { [key: string]: unknown }>;
}

declare class GLTFWriter {
textureUtils: TextureUtils | null;

extensionsUsed: { [name: string]: boolean };
extensionsRequired: { [name: string]: boolean };

constructor();

setPlugins(plugins: GLTFExporterPlugin[]): void;

setTextureUtils(utils: TextureUtils | null): this;

/**
* Process texture
* @param map Map to process
* @return Index of the processed texture in the "textures" array
*/
processTextureAsync(map: Texture): Promise<number>;

/**
* Applies a texture transform, if present, to the map definition. Requires
* the KHR_texture_transform extension.
*/
applyTextureTransform(mapDef: { [key: string]: unknown }, texture: Texture): void;

/**
* Parse scenes and generate GLTF output
*
Expand All @@ -122,16 +138,16 @@ declare class GLTFWriter {
*/
writeAsync(
input: Object3D | Object3D[],
onDone: (gltf: ArrayBuffer | { [key: string]: any }) => void,
onDone: (gltf: ArrayBuffer | { [key: string]: unknown }) => void,
options?: GLTFExporterOptions,
): Promise<void>;
}

export interface GLTFExporterPlugin {
writeTexture?: (map: Texture, textureDef: { [key: string]: any }) => void;
writeMaterial?: (material: Material, materialDef: { [key: string]: any }) => void;
writeMesh?: (mesh: Mesh, meshDef: { [key: string]: any }) => void;
writeNode?: (object: Object3D, nodeDef: { [key: string]: any }) => void;
writeTexture?: (map: Texture, textureDef: { [key: string]: unknown }) => void;
writeMaterialAsync?: (material: Material, materialDef: { [key: string]: unknown }) => Promise<void>;
writeMesh?: (mesh: Mesh, meshDef: { [key: string]: unknown }) => void;
writeNode?: (object: Object3D, nodeDef: { [key: string]: unknown }) => void;
beforeParse?: (input: Object3D | Object3D[]) => void;
afterParse?: (input: Object3D | Object3D[]) => void;
}
Expand Down
2 changes: 1 addition & 1 deletion types/three/examples/jsm/geometries/DecalGeometry.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { BufferGeometry, Euler, Mesh, Vector3 } from "three";

declare class DecalGeometry extends BufferGeometry {
constructor(mesh: Mesh, position: Vector3, orientation: Euler, size: Vector3);
constructor(mesh?: Mesh, position?: Vector3, orientation?: Euler, size?: Vector3);
}

declare class DecalVertex {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { NodeMaterial, NodeMaterialParameters } from "three/tsl";
import { NodeMaterial, NodeMaterialParameters } from "three/webgpu";

declare class LDrawConditionalLineMaterial extends NodeMaterial {
readonly isLDrawConditionalLineMaterial: true;
Expand Down
4 changes: 2 additions & 2 deletions types/three/examples/jsm/objects/SkyMesh.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { ShaderNodeObject, UniformNode } from "three/tsl";
import { BoxGeometry, Mesh, NodeMaterial, Vector3 } from "three/webgpu";
import { ShaderNodeObject } from "three/tsl";
import { BoxGeometry, Mesh, NodeMaterial, UniformNode, Vector3 } from "three/webgpu";

declare class SkyMesh extends Mesh<BoxGeometry, NodeMaterial> {
turbidity: ShaderNodeObject<UniformNode<number>>;
Expand Down
15 changes: 13 additions & 2 deletions types/three/examples/jsm/objects/Water2Mesh.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
import { TempNode, TextureNode, UniformNode, Vector2, Vector3 } from "three/tsl";
import { BufferGeometry, Color, ColorRepresentation, Mesh, NodeMaterial, Texture } from "three/webgpu";
import {
BufferGeometry,
Color,
ColorRepresentation,
Mesh,
NodeMaterial,
TempNode,
Texture,
TextureNode,
UniformNode,
Vector2,
Vector3,
} from "three/webgpu";

export interface WaterMeshOptions {
normalMap0: Texture;
Expand Down
13 changes: 11 additions & 2 deletions types/three/examples/jsm/objects/WaterMesh.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import { TextureNode, UniformNode } from "three/tsl";
import { BufferGeometry, Color, ColorRepresentation, Mesh, NodeMaterial, Texture, Vector3 } from "three/webgpu";
import {
BufferGeometry,
Color,
ColorRepresentation,
Mesh,
NodeMaterial,
Texture,
TextureNode,
UniformNode,
Vector3,
} from "three/webgpu";

export interface WaterMeshOptions {
resolution?: number | undefined;
Expand Down
3 changes: 2 additions & 1 deletion types/three/examples/jsm/tsl/display/AfterImageNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Node, ShaderNodeObject, TempNode, TextureNode, UniformNode } from "three/tsl";
import { ShaderNodeObject } from "three/tsl";
import { Node, TempNode, TextureNode, UniformNode } from "three/webgpu";

export default class AfterImageNode extends TempNode {
textureNode: TextureNode;
Expand Down
2 changes: 1 addition & 1 deletion types/three/examples/jsm/tsl/display/AnaglyphPassNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Camera, Scene } from "three";
import { ShaderNodeObject } from "three/tsl";
import { Camera, Scene } from "three/webgpu";
import StereoCompositePassNode from "./StereoCompositePassNode.js";

declare class AnaglyphPassNode extends StereoCompositePassNode {
Expand Down
4 changes: 2 additions & 2 deletions types/three/examples/jsm/tsl/display/AnamorphicNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Vector2 } from "three";
import { Node, NodeRepresentation, ShaderNodeObject, TempNode } from "three/tsl";
import { NodeRepresentation, ShaderNodeObject } from "three/tsl";
import { Node, TempNode, Vector2 } from "three/webgpu";

export default class AnamorphicNode extends TempNode {
textureNode: Node;
Expand Down
3 changes: 2 additions & 1 deletion types/three/examples/jsm/tsl/display/BleachBypass.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Node, NodeRepresentation, ShaderNodeObject } from "three/tsl";
import { NodeRepresentation, ShaderNodeObject } from "three/tsl";
import { Node } from "three/webgpu";

export const bleach: (color: NodeRepresentation, opacity?: number) => ShaderNodeObject<Node>;
3 changes: 2 additions & 1 deletion types/three/examples/jsm/tsl/display/BloomNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Node, NodeRepresentation, ShaderNodeObject, TempNode, TextureNode, UniformNode } from "three/tsl";
import { NodeRepresentation, ShaderNodeObject } from "three/tsl";
import { Node, TempNode, TextureNode, UniformNode } from "three/webgpu";

declare class BloomNode extends TempNode {
inputNode: Node;
Expand Down
7 changes: 3 additions & 4 deletions types/three/examples/jsm/tsl/display/DenoiseNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import { Camera, Matrix4 } from "three";
import { Node, NodeRepresentation, ShaderNodeObject, TempNode, UniformNode } from "three/tsl";
import { NodeRepresentation, ShaderNodeObject } from "three/tsl";
import { Camera, Node, TempNode, UniformNode } from "three/webgpu";

declare class DenoiseNode extends TempNode {
textureNode: Node;
depthNode: Node;
normalNode: Node;

noiseNode: Node;

cameraProjectionMatrixInversion: UniformNode<Matrix4>;
lumaPhi: UniformNode<number>;
depthPhi: UniformNode<number>;
normalPhi: UniformNode<number>;
Expand All @@ -23,6 +23,5 @@ export const denoise: (
node: NodeRepresentation,
depthNode: NodeRepresentation,
normalNode: NodeRepresentation,
noiseNode: NodeRepresentation,
camera: Camera,
) => ShaderNodeObject<DenoiseNode>;
3 changes: 2 additions & 1 deletion types/three/examples/jsm/tsl/display/DepthOfFieldNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Node, NodeRepresentation, ShaderNodeObject, TempNode, TextureNode, UniformNode } from "three/tsl";
import { NodeRepresentation, ShaderNodeObject } from "three/tsl";
import { Node, TempNode, TextureNode, UniformNode } from "three/webgpu";

declare class DepthOfFieldNode extends TempNode {
textureNode: TextureNode;
Expand Down
4 changes: 2 additions & 2 deletions types/three/examples/jsm/tsl/display/DotScreenNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Vector2 } from "three";
import { Node, NodeRepresentation, ShaderNodeObject, TempNode, UniformNode } from "three/tsl";
import { NodeRepresentation, ShaderNodeObject } from "three/tsl";
import { Node, TempNode, UniformNode, Vector2 } from "three/webgpu";

declare class DotScreenNode extends TempNode {
inputNode: Node;
Expand Down
3 changes: 2 additions & 1 deletion types/three/examples/jsm/tsl/display/FXAANode.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { NodeRepresentation, ShaderNodeObject, TempNode, TextureNode } from "three/tsl";
import { NodeRepresentation, ShaderNodeObject } from "three/tsl";
import { TempNode, TextureNode } from "three/webgpu";

declare class FXAANode extends TempNode {
textureNode: TextureNode;
Expand Down
3 changes: 2 additions & 1 deletion types/three/examples/jsm/tsl/display/FilmNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Node, NodeRepresentation, ShaderNodeObject, TempNode } from "three/tsl";
import { NodeRepresentation, ShaderNodeObject } from "three/tsl";
import { Node, TempNode } from "three/webgpu";

declare class FilmNode extends TempNode {
inputNode: Node;
Expand Down
13 changes: 5 additions & 8 deletions types/three/examples/jsm/tsl/display/GTAONode.d.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
import { Camera, Matrix4, Vector2 } from "three";
import { Node, NodeRepresentation, ShaderNodeObject, TempNode, TextureNode, UniformNode } from "three/tsl";
import { NodeRepresentation, ShaderNodeObject } from "three/tsl";
import { Camera, Node, TempNode, TextureNode, UniformNode, Vector2 } from "three/webgpu";

declare class GTAONode extends TempNode {
depthNode: Node;
normalNode: Node;

resolutionScale: number;

radius: ShaderNodeObject<UniformNode<number>>;
resolution: ShaderNodeObject<UniformNode<Vector2>>;
thickness: ShaderNodeObject<UniformNode<number>>;
distanceExponent: ShaderNodeObject<UniformNode<number>>;
distanceFallOff: ShaderNodeObject<UniformNode<number>>;
scale: ShaderNodeObject<UniformNode<number>>;
noiseNode: ShaderNodeObject<TextureNode>;

cameraProjectionMatrix: ShaderNodeObject<UniformNode<Matrix4>>;
cameraProjectionMatrixInverse: ShaderNodeObject<UniformNode<Matrix4>>;

SAMPLES: ShaderNodeObject<UniformNode<number>>;
samples: ShaderNodeObject<UniformNode<number>>;

constructor(depthNode: Node, normalNode: Node, camera: Camera);

Expand Down
4 changes: 2 additions & 2 deletions types/three/examples/jsm/tsl/display/GaussianBlurNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Vector2 } from "three";
import { Node, NodeRepresentation, ShaderNodeObject, TempNode, TextureNode } from "three/tsl";
import { NodeRepresentation, ShaderNodeObject } from "three/tsl";
import { Node, TempNode, TextureNode, Vector2 } from "three/webgpu";

declare class GaussianBlurNode extends TempNode {
textureNode: TextureNode;
Expand Down
4 changes: 2 additions & 2 deletions types/three/examples/jsm/tsl/display/LensflareNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Vector3 } from "three";
import { NodeRepresentation, ShaderNodeObject, TempNode, TextureNode, UniformNode } from "three/tsl";
import { NodeRepresentation, ShaderNodeObject } from "three/tsl";
import { TempNode, TextureNode, UniformNode, Vector3 } from "three/webgpu";

interface LensflareNodeParams {
ghostTint?: NodeRepresentation | undefined;
Expand Down
4 changes: 2 additions & 2 deletions types/three/examples/jsm/tsl/display/Lut3DNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Data3DTexture } from "three";
import { Node, NodeRepresentation, ShaderNodeObject, TempNode, Texture3DNode, UniformNode } from "three/tsl";
import { NodeRepresentation, ShaderNodeObject } from "three/tsl";
import { Data3DTexture, Node, TempNode, Texture3DNode, UniformNode } from "three/webgpu";

declare class Lut3DNode extends TempNode {
inputNode: Node;
Expand Down
3 changes: 2 additions & 1 deletion types/three/examples/jsm/tsl/display/MotionBlur.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Node, NodeRepresentation, ShaderNodeObject } from "three/tsl";
import { NodeRepresentation, ShaderNodeObject } from "three/tsl";
import { Node } from "three/webgpu";

export const motionBlur: (
inputNode: NodeRepresentation,
Expand Down
4 changes: 2 additions & 2 deletions types/three/examples/jsm/tsl/display/OutlineNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Node, NodeRepresentation, ShaderNodeObject, TempNode, TextureNode, UniformNode } from "three/tsl";
import { Camera, Object3D, Scene } from "three/webgpu";
import { NodeRepresentation, ShaderNodeObject } from "three/tsl";
import { Camera, Node, Object3D, Scene, TempNode, TextureNode, UniformNode } from "three/webgpu";

export interface OutlineNodeParams {
selectedObjects?: Object3D[] | undefined;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Camera, Scene } from "three";
import { ShaderNodeObject } from "three/tsl";
import { Camera, Scene } from "three/webgpu";
import StereoCompositePassNode from "./StereoCompositePassNode.js";

declare class ParallaxBarrierPassNode extends StereoCompositePassNode {
Expand Down
4 changes: 2 additions & 2 deletions types/three/examples/jsm/tsl/display/PixelationPassNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Camera, Scene } from "three";
import { PassNode, ShaderNodeObject, UniformNode } from "three/tsl";
import { ShaderNodeObject } from "three/tsl";
import { Camera, PassNode, Scene, UniformNode } from "three/webgpu";

declare class PixelationPassNode extends PassNode {
pixelSize: UniformNode<number>;
Expand Down
3 changes: 2 additions & 1 deletion types/three/examples/jsm/tsl/display/RGBShiftNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { NodeRepresentation, ShaderNodeObject, TempNode, TextureNode, UniformNode } from "three/tsl";
import { NodeRepresentation, ShaderNodeObject } from "three/tsl";
import { TempNode, TextureNode, UniformNode } from "three/webgpu";

export default class RGBShiftNode extends TempNode {
textureNode: TextureNode;
Expand Down
3 changes: 2 additions & 1 deletion types/three/examples/jsm/tsl/display/SMAANode.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { NodeRepresentation, ShaderNodeObject, TempNode, TextureNode } from "three/tsl";
import { NodeRepresentation, ShaderNodeObject } from "three/tsl";
import { TempNode, TextureNode } from "three/webgpu";

declare class SMAANode extends TempNode {
textureNode: TextureNode;
Expand Down
4 changes: 2 additions & 2 deletions types/three/examples/jsm/tsl/display/SSAAPassNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Camera, Color, RenderTarget, Scene } from "three";
import { PassNode, ShaderNodeObject, UniformNode } from "three/tsl";
import { ShaderNodeObject } from "three/tsl";
import { Camera, Color, PassNode, RenderTarget, Scene, UniformNode } from "three/webgpu";

declare class SSAAPassNode extends PassNode {
readonly isSSAAPassNode: boolean;
Expand Down
4 changes: 2 additions & 2 deletions types/three/examples/jsm/tsl/display/SSRNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Node, NodeRepresentation, ShaderNodeObject, TempNode, TextureNode, UniformNode } from "three/tsl";
import { Camera } from "three/webgpu";
import { NodeRepresentation, ShaderNodeObject } from "three/tsl";
import { Camera, Node, TempNode, TextureNode, UniformNode } from "three/webgpu";

declare class SSRNode extends TempNode {
colorNode: ShaderNodeObject<Node>;
Expand Down
3 changes: 2 additions & 1 deletion types/three/examples/jsm/tsl/display/Sepia.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Node, NodeRepresentation, ShaderNodeObject } from "three/tsl";
import { NodeRepresentation, ShaderNodeObject } from "three/tsl";
import { Node } from "three/webgpu";

export const sepia: (color: NodeRepresentation) => ShaderNodeObject<Node>;
3 changes: 2 additions & 1 deletion types/three/examples/jsm/tsl/display/SobelOperatorNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { NodeRepresentation, ShaderNodeObject, TempNode, TextureNode } from "three/tsl";
import { NodeRepresentation, ShaderNodeObject } from "three/tsl";
import { TempNode, TextureNode } from "three/webgpu";

declare class SobelOperatorNode extends TempNode {
textureNode: TextureNode;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Camera, CoordinateSystem, Scene, StereoCamera } from "three";
import { PassNode } from "three/tsl";
import { Camera, CoordinateSystem, PassNode, Scene, StereoCamera } from "three/webgpu";

declare class StereoCompositePassNode extends PassNode {
readonly isStereoCompositePassNode: true;
Expand Down
4 changes: 2 additions & 2 deletions types/three/examples/jsm/tsl/display/StereoPassNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Camera, Scene, StereoCamera } from "three";
import { PassNode, ShaderNodeObject } from "three/tsl";
import { ShaderNodeObject } from "three/tsl";
import { Camera, PassNode, Scene, StereoCamera } from "three/webgpu";

declare class StereoPassNode extends PassNode {
readonly isStereoPassNode: true;
Expand Down
4 changes: 2 additions & 2 deletions types/three/examples/jsm/tsl/display/TRAAPassNode.d.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Camera, ColorRepresentation, Scene } from "three";
import { PassNode, ShaderNodeObject } from "three/tsl";
import { ShaderNodeObject } from "three/tsl";
import { Camera, ColorRepresentation, PassNode, Scene } from "three/webgpu";

declare class TRAAPassNode extends PassNode {
readonly isTRAAPassNode: true;
Expand Down
Loading

0 comments on commit 7f6d332

Please sign in to comment.