From d465553461b1f0d17e2b2ff2955cc4a1e33c5d73 Mon Sep 17 00:00:00 2001 From: Alan Vinicius Silva Date: Wed, 3 Sep 2025 14:34:41 -0300 Subject: [PATCH 1/7] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#73608=20fix=20?= =?UTF-8?q?(vtex.js):=20BREAKING=20CHANGE=20-=20Update=20OrderFormMarketin?= =?UTF-8?q?gData=20properties=20to=20be=20required=20and=20change=20types?= =?UTF-8?q?=20by=20@AlanVncs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/vtex.js/index.d.ts | 16 ++++++++-------- types/vtex.js/vtex.js-tests.ts | 6 ++++++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/types/vtex.js/index.d.ts b/types/vtex.js/index.d.ts index 794581335ef07c..a90c354e34ee70 100644 --- a/types/vtex.js/index.d.ts +++ b/types/vtex.js/index.d.ts @@ -129,14 +129,14 @@ declare namespace vtexjs { } interface OrderFormMarketingData { - utmCampaign?: string; - utmMedium?: string; - utmSource?: string; - utmiCampaign?: string; - utmiPart?: string; - utmipage?: string; - marketingTags?: string; - coupon?: string; + utmCampaign: string | null; + utmMedium: string | null; + utmSource: string | null; + utmiCampaign: string | null; + utmiPart: string | null; + utmipage: string | null; + marketingTags: string[]; + coupon: string | null; } interface CheckoutAddress { diff --git a/types/vtex.js/vtex.js-tests.ts b/types/vtex.js/vtex.js-tests.ts index 2f32c36b3d2821..c4b11c4ea645be 100644 --- a/types/vtex.js/vtex.js-tests.ts +++ b/types/vtex.js/vtex.js-tests.ts @@ -15,3 +15,9 @@ vtexjs.Checkout.getOrderForm(); // $ExpectType Promise globalThis.vtexjs.checkout.getOrderForm(); + +globalThis.vtexjs.checkout.getOrderForm().then((orderForm) => { + // $ExpectType OrderFormMarketingData | undefined + orderForm.marketingData +}); + From c6fce6de7c513e5fb74914bf47f7e4f586c88c9b Mon Sep 17 00:00:00 2001 From: TypeScript Bot Date: Wed, 3 Sep 2025 17:35:22 +0000 Subject: [PATCH 2/7] =?UTF-8?q?=F0=9F=A4=96=20dprint=20fmt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/vtex.js/vtex.js-tests.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/types/vtex.js/vtex.js-tests.ts b/types/vtex.js/vtex.js-tests.ts index c4b11c4ea645be..db95f989631195 100644 --- a/types/vtex.js/vtex.js-tests.ts +++ b/types/vtex.js/vtex.js-tests.ts @@ -18,6 +18,5 @@ globalThis.vtexjs.checkout.getOrderForm(); globalThis.vtexjs.checkout.getOrderForm().then((orderForm) => { // $ExpectType OrderFormMarketingData | undefined - orderForm.marketingData + orderForm.marketingData; }); - From 549619fdc1a992ada4871788e148b8c14a3e23c6 Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Wed, 3 Sep 2025 14:11:01 -0400 Subject: [PATCH 3/7] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#73606=20[three?= =?UTF-8?q?]=20r180=20by=20@Methuselah96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/three/examples/jsm/Addons.d.ts | 2 +- .../examples/jsm/controls/DragControls.d.ts | 30 ------ .../jsm/controls/PointerLockControls.d.ts | 5 - .../examples/jsm/exporters/DRACOExporter.d.ts | 2 +- .../examples/jsm/exporters/EXRExporter.d.ts | 4 +- .../examples/jsm/exporters/KTX2Exporter.d.ts | 4 +- .../examples/jsm/exporters/STLExporter.d.ts | 4 +- .../examples/jsm/exporters/USDZExporter.d.ts | 4 +- .../jsm/loaders/HDRCubeTextureLoader.d.ts | 4 +- .../three/examples/jsm/loaders/HDRLoader.d.ts | 22 ++++ .../examples/jsm/loaders/LDrawLoader.d.ts | 6 +- .../examples/jsm/loaders/RGBELoader.d.ts | 24 ++--- .../examples/jsm/loaders/RGBMLoader.d.ts | 37 ------- .../jsm/materials/WoodNodeMaterial.d.ts | 75 +++++++++++++ .../three/examples/jsm/math/ColorSpaces.d.ts | 4 + .../examples/jsm/postprocessing/SSRPass.d.ts | 35 ++---- .../jsm/tsl/display/AnamorphicNode.d.ts | 11 +- .../jsm/tsl/display/DepthOfFieldNode.d.ts | 22 ++-- .../jsm/tsl/display/GaussianBlurNode.d.ts | 32 ++++-- .../examples/jsm/tsl/display/SSRNode.d.ts | 11 +- .../examples/jsm/tsl/display/boxBlur.d.ts | 11 ++ .../examples/jsm/tsl/display/hashBlur.d.ts | 2 +- types/three/package.json | 2 +- types/three/src/Three.Core.d.ts | 1 + types/three/src/Three.TSL.d.ts | 33 +++++- types/three/src/animation/AnimationClip.d.ts | 5 + types/three/src/constants.d.ts | 4 +- .../src/materials/LineBasicMaterial.d.ts | 1 + .../src/materials/LineDashedMaterial.d.ts | 1 + .../src/materials/MeshBasicMaterial.d.ts | 1 + .../src/materials/MeshDepthMaterial.d.ts | 1 + .../src/materials/MeshDistanceMaterial.d.ts | 3 +- .../src/materials/MeshLambertMaterial.d.ts | 1 + .../src/materials/MeshMatcapMaterial.d.ts | 1 + .../src/materials/MeshNormalMaterial.d.ts | 1 + .../src/materials/MeshPhongMaterial.d.ts | 1 + .../three/src/materials/MeshToonMaterial.d.ts | 1 + types/three/src/materials/PointsMaterial.d.ts | 1 + types/three/src/materials/ShaderMaterial.d.ts | 1 + types/three/src/materials/ShadowMaterial.d.ts | 1 + types/three/src/materials/SpriteMaterial.d.ts | 1 + .../materials/nodes/Line2NodeMaterial.d.ts | 1 + .../nodes/LineBasicNodeMaterial.d.ts | 1 + .../nodes/LineDashedNodeMaterial.d.ts | 1 + .../nodes/MeshBasicNodeMaterial.d.ts | 1 + .../nodes/MeshLambertNodeMaterial.d.ts | 1 + .../nodes/MeshMatcapNodeMaterial.d.ts | 1 + .../nodes/MeshNormalNodeMaterial.d.ts | 1 + .../nodes/MeshPhongNodeMaterial.d.ts | 1 + .../nodes/MeshPhysicalNodeMaterial.d.ts | 1 + .../materials/nodes/MeshSSSNodeMaterial.d.ts | 1 + .../nodes/MeshStandardNodeMaterial.d.ts | 1 + .../materials/nodes/MeshToonNodeMaterial.d.ts | 1 + .../src/materials/nodes/NodeMaterial.d.ts | 1 + .../materials/nodes/PointsNodeMaterial.d.ts | 17 +++ .../materials/nodes/ShadowNodeMaterial.d.ts | 1 + .../materials/nodes/SpriteNodeMaterial.d.ts | 1 + .../materials/nodes/VolumeNodeMaterial.d.ts | 1 + .../nodes/manager/NodeMaterialObserver.d.ts | 2 +- types/three/src/math/ColorManagement.d.ts | 2 +- types/three/src/nodes/Nodes.d.ts | 3 + types/three/src/nodes/TSL.d.ts | 3 + types/three/src/nodes/accessors/Camera.d.ts | 2 + .../src/nodes/accessors/TextureNode.d.ts | 2 + types/three/src/nodes/core/ContextNode.d.ts | 4 + types/three/src/nodes/core/Node.d.ts | 15 +-- types/three/src/nodes/core/UniformNode.d.ts | 8 +- types/three/src/nodes/core/VarNode.d.ts | 14 --- types/three/src/nodes/display/ScreenNode.d.ts | 5 +- .../src/nodes/display/ToneMappingNode.d.ts | 4 +- .../display/ViewportDepthTextureNode.d.ts | 3 + .../display/ViewportSharedTextureNode.d.ts | 3 + .../nodes/display/ViewportTextureNode.d.ts | 4 + .../src/nodes/gpgpu/SubgroupFunctionNode.d.ts | 100 ++++++++++++++++++ types/three/src/nodes/math/BitcastNode.d.ts | 25 +++++ types/three/src/nodes/math/MathNode.d.ts | 3 - .../three/src/nodes/utils/ReflectorNode.d.ts | 17 ++- types/three/src/nodes/utils/SampleNode.d.ts | 5 +- types/three/src/nodes/utils/Timer.d.ts | 15 --- types/three/src/objects/InstancedMesh.d.ts | 5 +- types/three/src/renderers/WebGLRenderer.d.ts | 25 ----- .../src/renderers/common/Attributes.d.ts | 2 +- .../three/src/renderers/common/Renderer.d.ts | 6 +- .../three/src/renderers/common/Textures.d.ts | 2 +- .../renderers/common/TimestampQueryPool.d.ts | 7 +- .../three/src/renderers/common/XRManager.d.ts | 10 ++ .../renderers/common/nodes/NodeLibrary.d.ts | 10 +- .../webgpu/utils/WebGPUConstants.d.ts | 2 +- .../three/src/textures/CompressedTexture.d.ts | 8 +- types/three/src/textures/Data3DTexture.d.ts | 3 +- types/three/src/textures/DataTexture.d.ts | 5 +- types/three/src/textures/ExternalTexture.d.ts | 4 +- types/three/src/textures/Texture.d.ts | 2 +- .../examples/jsm/exporters/STLExporter.ts | 4 +- 94 files changed, 514 insertions(+), 265 deletions(-) create mode 100644 types/three/examples/jsm/loaders/HDRLoader.d.ts delete mode 100644 types/three/examples/jsm/loaders/RGBMLoader.d.ts create mode 100644 types/three/examples/jsm/materials/WoodNodeMaterial.d.ts create mode 100644 types/three/examples/jsm/tsl/display/boxBlur.d.ts create mode 100644 types/three/src/nodes/gpgpu/SubgroupFunctionNode.d.ts create mode 100644 types/three/src/nodes/math/BitcastNode.d.ts diff --git a/types/three/examples/jsm/Addons.d.ts b/types/three/examples/jsm/Addons.d.ts index 73dca0a60f34f0..a901ce0e811759 100644 --- a/types/three/examples/jsm/Addons.d.ts +++ b/types/three/examples/jsm/Addons.d.ts @@ -89,6 +89,7 @@ export * from "./loaders/FontLoader.js"; export * from "./loaders/GCodeLoader.js"; export * from "./loaders/GLTFLoader.js"; export * from "./loaders/HDRCubeTextureLoader.js"; +export * from "./loaders/HDRLoader.js"; export * from "./loaders/IESLoader.js"; export * from "./loaders/KMZLoader.js"; export * from "./loaders/KTX2Loader.js"; @@ -108,7 +109,6 @@ export * from "./loaders/PDBLoader.js"; export * from "./loaders/PLYLoader.js"; export * from "./loaders/PVRLoader.js"; export * from "./loaders/RGBELoader.js"; -export * from "./loaders/RGBMLoader.js"; export * from "./loaders/STLLoader.js"; export * from "./loaders/SVGLoader.js"; export * from "./loaders/TDSLoader.js"; diff --git a/types/three/examples/jsm/controls/DragControls.d.ts b/types/three/examples/jsm/controls/DragControls.d.ts index 8235eac56d03cf..4c28f85c0ece62 100644 --- a/types/three/examples/jsm/controls/DragControls.d.ts +++ b/types/three/examples/jsm/controls/DragControls.d.ts @@ -76,36 +76,6 @@ declare class DragControls extends Controls { * @param domElement The HTML element used for event listeners. (optional) */ constructor(objects: Object3D[], camera: Camera, domElement?: HTMLElement | null); - - /** - * Returns the internal {@link Raycaster} instance that is used for intersection tests. - * @deprecated getRaycaster() has been deprecated. Use controls.raycaster instead. - */ - getRaycaster(): Raycaster; - - /** - * Sets an array of draggable objects by overwriting the existing one. - * @deprecated setObjects() has been deprecated. Use controls.objects instead. - */ - setObjects(objects: readonly Object3D[]): void; - - /** - * Returns the array of draggable objects. - * @deprecated getObjects() has been deprecated. Use controls.objects instead. - */ - getObjects(): Object3D[]; - - /** - * Adds the event listeners of the controls. - * @deprecated activate() has been renamed to connect(). - */ - activate(): void; - - /** - * Removes the event listeners of the controls. - * @deprecated deactivate() has been renamed to disconnect(). - */ - deactivate(): void; } export { DragControls }; diff --git a/types/three/examples/jsm/controls/PointerLockControls.d.ts b/types/three/examples/jsm/controls/PointerLockControls.d.ts index 89b488da8b711b..c05c95c29d8da0 100644 --- a/types/three/examples/jsm/controls/PointerLockControls.d.ts +++ b/types/three/examples/jsm/controls/PointerLockControls.d.ts @@ -49,11 +49,6 @@ declare class PointerLockControls extends Controls */ constructor(camera: Camera, domElement?: HTMLElement | null); - /** - * @deprecated getObject() has been deprecated. Use controls.object instead. - */ - getObject(): Camera; - /** * Returns the look direction of the camera. * @param v The target vector. diff --git a/types/three/examples/jsm/exporters/DRACOExporter.d.ts b/types/three/examples/jsm/exporters/DRACOExporter.d.ts index e9a87c120f19a3..fa73d0fbf817f4 100644 --- a/types/three/examples/jsm/exporters/DRACOExporter.d.ts +++ b/types/three/examples/jsm/exporters/DRACOExporter.d.ts @@ -13,5 +13,5 @@ export interface DRACOExporterOptions { export class DRACOExporter { constructor(); - parse(object: Mesh | Points, options?: DRACOExporterOptions): Int8Array; + parse(object: Mesh | Points, options?: DRACOExporterOptions): Int8Array; } diff --git a/types/three/examples/jsm/exporters/EXRExporter.d.ts b/types/three/examples/jsm/exporters/EXRExporter.d.ts index 34fe1f445b4876..000f33f0adb303 100644 --- a/types/three/examples/jsm/exporters/EXRExporter.d.ts +++ b/types/three/examples/jsm/exporters/EXRExporter.d.ts @@ -22,6 +22,6 @@ export class EXRExporter { renderer: WebGLRenderer | WebGPURenderer, renderTarget: WebGLRenderTarget, options?: EXRExporterParseOptions, - ): Promise; - parse(dataTexture: DataTexture, options?: EXRExporterParseOptions): Promise; + ): Promise>; + parse(dataTexture: DataTexture, options?: EXRExporterParseOptions): Promise>; } diff --git a/types/three/examples/jsm/exporters/KTX2Exporter.d.ts b/types/three/examples/jsm/exporters/KTX2Exporter.d.ts index f24b17838bde7d..27b5fb09cf4c29 100644 --- a/types/three/examples/jsm/exporters/KTX2Exporter.d.ts +++ b/types/three/examples/jsm/exporters/KTX2Exporter.d.ts @@ -2,6 +2,6 @@ import { Data3DTexture, DataTexture, WebGLRenderer, WebGLRenderTarget } from "th import { WebGPURenderer } from "three/webgpu"; export class KTX2Exporter { - parse(renderer: WebGLRenderer | WebGPURenderer, rtt?: WebGLRenderTarget): Promise; - parse(texture: Data3DTexture | DataTexture): Promise; + parse(renderer: WebGLRenderer | WebGPURenderer, rtt?: WebGLRenderTarget): Promise>; + parse(texture: Data3DTexture | DataTexture): Promise>; } diff --git a/types/three/examples/jsm/exporters/STLExporter.d.ts b/types/three/examples/jsm/exporters/STLExporter.d.ts index 9b7bc5f22c1a5d..98934536111532 100644 --- a/types/three/examples/jsm/exporters/STLExporter.d.ts +++ b/types/three/examples/jsm/exporters/STLExporter.d.ts @@ -15,7 +15,7 @@ export interface STLExporterOptions { export class STLExporter { constructor(); - parse(scene: Object3D, options: STLExporterOptionsBinary): DataView; + parse(scene: Object3D, options: STLExporterOptionsBinary): DataView; parse(scene: Object3D, options?: STLExporterOptionsString): string; - parse(scene: Object3D, options?: STLExporterOptions): string | DataView; + parse(scene: Object3D, options?: STLExporterOptions): string | DataView; } diff --git a/types/three/examples/jsm/exporters/USDZExporter.d.ts b/types/three/examples/jsm/exporters/USDZExporter.d.ts index 3fc9ac6730d6df..9e153df4daf651 100644 --- a/types/three/examples/jsm/exporters/USDZExporter.d.ts +++ b/types/three/examples/jsm/exporters/USDZExporter.d.ts @@ -17,10 +17,10 @@ export class USDZExporter { parse( scene: Object3D, - onDone: (result: Uint8Array) => void, + onDone: (result: Uint8Array) => void, onError: (error: unknown) => void, options?: USDZExporterOptions, ): void; - parseAsync(scene: Object3D, options?: USDZExporterOptions): Promise; + parseAsync(scene: Object3D, options?: USDZExporterOptions): Promise>; } diff --git a/types/three/examples/jsm/loaders/HDRCubeTextureLoader.d.ts b/types/three/examples/jsm/loaders/HDRCubeTextureLoader.d.ts index 7197528867396e..4d09d21e206c30 100644 --- a/types/three/examples/jsm/loaders/HDRCubeTextureLoader.d.ts +++ b/types/three/examples/jsm/loaders/HDRCubeTextureLoader.d.ts @@ -1,10 +1,10 @@ import { CubeTexture, Loader, LoadingManager, TextureDataType } from "three"; -import { RGBELoader } from "./RGBELoader.js"; +import { HDRLoader } from "./HDRLoader.js"; export class HDRCubeTextureLoader extends Loader { constructor(manager?: LoadingManager); - hdrLoader: RGBELoader; + hdrLoader: HDRLoader; type: TextureDataType; load( diff --git a/types/three/examples/jsm/loaders/HDRLoader.d.ts b/types/three/examples/jsm/loaders/HDRLoader.d.ts new file mode 100644 index 00000000000000..14d8d41a0d387b --- /dev/null +++ b/types/three/examples/jsm/loaders/HDRLoader.d.ts @@ -0,0 +1,22 @@ +import { DataTextureLoader, LoadingManager, TextureDataType } from "three"; + +export interface HDR { + width: number; + height: number; + data: Float32Array | Uint8Array; + header: string; + gamma: number; + exposure: number; + type: TextureDataType; +} + +declare class HDRLoader extends DataTextureLoader { + type: TextureDataType; + + constructor(manager?: LoadingManager); + + parse(buffer: ArrayBuffer): HDR; + setDataType(type: TextureDataType): this; +} + +export { HDRLoader }; diff --git a/types/three/examples/jsm/loaders/LDrawLoader.d.ts b/types/three/examples/jsm/loaders/LDrawLoader.d.ts index dc6ca526d7c4ff..3867b219216cc2 100644 --- a/types/three/examples/jsm/loaders/LDrawLoader.d.ts +++ b/types/three/examples/jsm/loaders/LDrawLoader.d.ts @@ -10,17 +10,21 @@ export class LDrawLoader extends Loader { smoothNormals: boolean; + partsLibraryPath: string; + ConditionalLineMaterial: typeof LDrawConditionalLineMaterial | typeof LDrawConditionalLineNodeMaterial | null; constructor(manager?: LoadingManager); + setPartsLibraryPath(path: string): this; + setConditionalLineMaterial( type: typeof LDrawConditionalLineMaterial | typeof LDrawConditionalLineNodeMaterial, ): this; preloadMaterials(url: string): Promise; - parse(text: string, path: string, onLoad: (data: Group) => void, onError?: (error: unknown) => void): void; + parse(text: string, onLoad: (data: Group) => void, onError?: (error: unknown) => void): void; setMaterials(materials: Material[]): this; clearMaterials(): this; diff --git a/types/three/examples/jsm/loaders/RGBELoader.d.ts b/types/three/examples/jsm/loaders/RGBELoader.d.ts index 7ee821225669e1..5819174c8c183f 100644 --- a/types/three/examples/jsm/loaders/RGBELoader.d.ts +++ b/types/three/examples/jsm/loaders/RGBELoader.d.ts @@ -1,19 +1,13 @@ -import { DataTextureLoader, LoadingManager, PixelFormat, TextureDataType } from "three"; +import { HDR, HDRLoader } from "./HDRLoader.js"; -export interface RGBE { - width: number; - height: number; - data: Float32Array | Uint8Array; - header: string; - gamma: number; - exposure: number; - type: TextureDataType; +/** + * @deprecated RGBELoader has been deprecated. Please use HDRLoader instead. + */ +export interface RGBE extends HDR { } -export class RGBELoader extends DataTextureLoader { - constructor(manager?: LoadingManager); - type: TextureDataType; - - parse(buffer: ArrayBuffer): RGBE; - setDataType(type: TextureDataType): this; +/** + * @deprecated RGBELoader has been deprecated. Please use HDRLoader instead. + */ +export class RGBELoader extends HDRLoader { } diff --git a/types/three/examples/jsm/loaders/RGBMLoader.d.ts b/types/three/examples/jsm/loaders/RGBMLoader.d.ts deleted file mode 100644 index f579e2ed31e9ae..00000000000000 --- a/types/three/examples/jsm/loaders/RGBMLoader.d.ts +++ /dev/null @@ -1,37 +0,0 @@ -import { CubeTexture, DataTextureLoader, LoadingManager, PixelFormat, TextureDataType } from "three"; - -export interface RGBM { - width: number; - height: number; - data: Uint16Array | Float32Array; - header: string; - format: PixelFormat; - type: TextureDataType; - flipY: boolean; -} - -export class RGBMLoader extends DataTextureLoader { - type: TextureDataType; - - maxRange: number; - - constructor(manager?: LoadingManager); - - loadCubemap( - urls: string[], - onLoad?: (texture: CubeTexture) => void, - onProgress?: (event: ProgressEvent) => void, - onError?: (event: ErrorEvent) => void, - ): CubeTexture; - - loadCubemapAsync( - urls: string[], - onProgress?: (event: ProgressEvent) => void, - ): Promise; - - parse(buffer: ArrayBuffer): RGBM; - - setDataType(dataType: TextureDataType): this; - - setMaxRange(value: number): this; -} diff --git a/types/three/examples/jsm/materials/WoodNodeMaterial.d.ts b/types/three/examples/jsm/materials/WoodNodeMaterial.d.ts new file mode 100644 index 00000000000000..27677f95db02f7 --- /dev/null +++ b/types/three/examples/jsm/materials/WoodNodeMaterial.d.ts @@ -0,0 +1,75 @@ +import * as THREE from "three"; + +export type WoodGenus = + | "teak" + | "walnut" + | "white_oak" + | "pine" + | "poplar" + | "maple" + | "red_oak" + | "cherry" + | "cedar" + | "mahogany"; +export type WoodFinish = "raw" | "matte" | "semigloss" | "gloss"; + +export const WoodGenuses: WoodGenus[]; +export const Finishes: WoodFinish[]; + +export interface WoodParameters { + transformationMatrix: THREE.Matrix4; + centerSize: number; + largeWarpScale: number; + largeGrainStretch: number; + smallWarpStrength: number; + smallWarpScale: number; + fineWarpStrength: number; + fineWarpScale: number; + ringThickness: number; + ringBias: number; + ringSizeVariance: number; + ringVarianceScale: number; + barkThickness: number; + splotchScale: number; + splotchIntensity: number; + cellScale: number; + cellSize: number; + darkGrainColor: string | THREE.Color; + lightGrainColor: string | THREE.Color; + genus: WoodGenus; + finish: WoodFinish; + clearcoat: number; + clearcoatRoughness: number; + clearcoatDarken: number; +} + +export function GetWoodPreset(genus: WoodGenus, finish: WoodFinish): WoodParameters; + +export class WoodNodeMaterial extends THREE.MeshPhysicalMaterial { + readonly isWoodNodeMaterial: true; + + transformationMatrix: THREE.Matrix4; + centerSize: number; + largeWarpScale: number; + largeGrainStretch: number; + smallWarpStrength: number; + smallWarpScale: number; + fineWarpStrength: number; + fineWarpScale: number; + ringThickness: number; + ringBias: number; + ringSizeVariance: number; + ringVarianceScale: number; + barkThickness: number; + splotchScale: number; + splotchIntensity: number; + cellScale: number; + cellSize: number; + darkGrainColor: THREE.Color; + lightGrainColor: THREE.Color; + clearcoatDarken: number; + + constructor(params?: Partial); + + static fromPreset(genus?: WoodGenus, finish?: WoodFinish): WoodNodeMaterial; +} diff --git a/types/three/examples/jsm/math/ColorSpaces.d.ts b/types/three/examples/jsm/math/ColorSpaces.d.ts index 23720fe522f3f7..58d4885a19bb7b 100644 --- a/types/three/examples/jsm/math/ColorSpaces.d.ts +++ b/types/three/examples/jsm/math/ColorSpaces.d.ts @@ -9,3 +9,7 @@ export const LinearDisplayP3ColorSpaceImpl: ColorSpaceDefinition; export const LinearRec2020ColorSpace: "rec2020-linear"; export const LinearRec2020ColorSpaceImpl: ColorSpaceDefinition; + +export const ExtendedSRGBColorSpace: "extended-srgb"; + +export const ExtendedSRGBColorSpaceImpl: ColorSpaceDefinition; diff --git a/types/three/examples/jsm/postprocessing/SSRPass.d.ts b/types/three/examples/jsm/postprocessing/SSRPass.d.ts index f3d02f1be63d9a..069f1d34060e32 100644 --- a/types/three/examples/jsm/postprocessing/SSRPass.d.ts +++ b/types/three/examples/jsm/postprocessing/SSRPass.d.ts @@ -1,8 +1,6 @@ import { Camera, Color, - ColorRepresentation, - Material, Mesh, MeshBasicMaterial, MeshNormalMaterial, @@ -12,7 +10,7 @@ import { WebGLRenderTarget, } from "three"; import { ReflectorForSSRPass } from "../objects/ReflectorForSSRPass.js"; -import { FullScreenQuad, Pass } from "../postprocessing/Pass.js"; +import { FullScreenQuad, Pass } from "./Pass.js"; export interface SSRPassParams { renderer: WebGLRenderer; @@ -26,7 +24,7 @@ export interface SSRPassParams { groundReflector: ReflectorForSSRPass | null; } -export class SSRPass extends Pass { +declare class SSRPass extends Pass { width: number; height: number; clear: boolean; @@ -94,29 +92,8 @@ export class SSRPass extends Pass { constructor(params: SSRPassParams); - dispose: () => void; - - renderPass: ( - renderer: WebGLRenderer, - passMaterial: Material, - renderTarget: WebGLRenderTarget, - clearColor: ColorRepresentation, - clearAlpha: ColorRepresentation, - ) => void; - - renderOverride: ( - renderer: WebGLRenderer, - passMaterial: Material, - renderTarget: WebGLRenderTarget, - clearColor: ColorRepresentation, - clearAlpha: ColorRepresentation, - ) => void; - - renderMetalness: ( - renderer: WebGLRenderer, - passMaterial: Material, - renderTarget: WebGLRenderTarget, - clearColor: ColorRepresentation, - clearAlpha: ColorRepresentation, - ) => void; + get resolutionScale(): number; + set resolutionScale(value: number); } + +export { SSRPass }; diff --git a/types/three/examples/jsm/tsl/display/AnamorphicNode.d.ts b/types/three/examples/jsm/tsl/display/AnamorphicNode.d.ts index c39de6faebadb3..26c8fc804883ef 100644 --- a/types/three/examples/jsm/tsl/display/AnamorphicNode.d.ts +++ b/types/three/examples/jsm/tsl/display/AnamorphicNode.d.ts @@ -6,13 +6,22 @@ export default class AnamorphicNode extends TempNode { thresholdNode: Node; scaleNode: Node; samples: number; - resolution: Vector2; + resolutionScale: number; constructor(textureNode: Node, thresholdNode: Node, scaleNode: Node, samples: number); getTextureNode(): Node; setSize(width: number, height: number): void; + + /** + * @deprecated The "resolution" property has been renamed to "resolutionScale" and is now of type `number`. + */ + get resolution(): Vector2; + /** + * @deprecated The "resolution" property has been renamed to "resolutionScale" and is now of type `number`. + */ + set resolution(value: Vector2); } export const anamorphic: ( diff --git a/types/three/examples/jsm/tsl/display/DepthOfFieldNode.d.ts b/types/three/examples/jsm/tsl/display/DepthOfFieldNode.d.ts index e781c045fb6a41..80f9a065e4bea0 100644 --- a/types/three/examples/jsm/tsl/display/DepthOfFieldNode.d.ts +++ b/types/three/examples/jsm/tsl/display/DepthOfFieldNode.d.ts @@ -1,15 +1,21 @@ import { ShaderNodeObject } from "three/tsl"; -import { Node, TempNode, TextureNode, UniformNode } from "three/webgpu"; +import { Node, TempNode, TextureNode } from "three/webgpu"; declare class DepthOfFieldNode extends TempNode { textureNode: TextureNode; viewZNode: Node; - focus: UniformNode; - aperture: UniformNode; - maxblur: UniformNode; + focusDistanceNode: Node; + focalLengthNode: Node; + bokehScaleNode: Node; - constructor(textureNode: TextureNode, viewZNode: Node, focusNode: Node, apertureNode: Node, maxblurNode: Node); + constructor( + textureNode: TextureNode, + viewZNode: Node, + focusDistanceNode: Node, + focalLengthNode: Node, + bokehScaleNode: Node, + ); } export default DepthOfFieldNode; @@ -17,7 +23,7 @@ export default DepthOfFieldNode; export const dof: ( node: Node, viewZNode: Node, - focus?: Node, - aperture?: Node, - maxblur?: Node, + focusDistance?: Node | number, + focalLength?: Node | number, + bokehScale?: Node | number, ) => ShaderNodeObject; diff --git a/types/three/examples/jsm/tsl/display/GaussianBlurNode.d.ts b/types/three/examples/jsm/tsl/display/GaussianBlurNode.d.ts index afcd26ab7f297f..39842fe2386cef 100644 --- a/types/three/examples/jsm/tsl/display/GaussianBlurNode.d.ts +++ b/types/three/examples/jsm/tsl/display/GaussianBlurNode.d.ts @@ -1,24 +1,39 @@ import { ShaderNodeObject } from "three/tsl"; import { Node, TempNode, TextureNode, Vector2 } from "three/webgpu"; +export interface GaussianBlurNodeOptions { + premultipliedAlpha?: boolean | undefined; + resolution?: Vector2 | undefined; +} + declare class GaussianBlurNode extends TempNode { textureNode: TextureNode; directionNode: Node | null; sigma: number; - resolution: Vector2; + resolutionScale: number; premultipliedAlpha: boolean; - constructor(textureNode: TextureNode, directionNode?: Node | null, sigma?: number); - - setPremultipliedAlpha(value: boolean): this; - - getPremultipliedAlpha(): boolean; + constructor( + textureNode: TextureNode, + directionNode?: Node | null, + sigma?: number, + options?: GaussianBlurNodeOptions, + ); setSize(width: number, height: number): void; getTextureNode(): TextureNode; + + /** + * @deprecated The "resolution" property has been renamed to "resolutionScale" and is now of type `number`. + */ + get resolution(): Vector2; + /** + * @deprecated The "resolution" property has been renamed to "resolutionScale" and is now of type `number`. + */ + set resolution(value: Vector2); } export default GaussianBlurNode; @@ -27,7 +42,12 @@ export const gaussianBlur: ( node: Node, directionNode?: Node | number | null, sigma?: number, + options?: GaussianBlurNodeOptions, ) => ShaderNodeObject; + +/** + * @deprecated "premultipliedGaussianBlur()" is deprecated. Use "gaussianBlur()" with "premultipliedAlpha: true" option instead. + */ export const premultipliedGaussianBlur: ( node: Node, directionNode?: Node | number | null, diff --git a/types/three/examples/jsm/tsl/display/SSRNode.d.ts b/types/three/examples/jsm/tsl/display/SSRNode.d.ts index 1c60434f8f026c..dc10791d7332f0 100644 --- a/types/three/examples/jsm/tsl/display/SSRNode.d.ts +++ b/types/three/examples/jsm/tsl/display/SSRNode.d.ts @@ -6,20 +6,24 @@ declare class SSRNode extends TempNode { depthNode: ShaderNodeObject; normalNode: ShaderNodeObject; metalnessNode: ShaderNodeObject; - camera: Camera; + roughnessNode: ShaderNodeObject | null; + camera: Camera | null; resolutionScale: number; maxDistance: UniformNode; thickness: UniformNode; opacity: UniformNode; + quality: UniformNode; + blurQuality: UniformNode; constructor( colorNode: ShaderNodeObject, depthNode: ShaderNodeObject, normalNode: ShaderNodeObject, metalnessNode: ShaderNodeObject, - camera: Camera, + roughnessNode?: ShaderNodeObject | null, + camera?: Camera | null, ); getTextureNode(): ShaderNodeObject; @@ -34,5 +38,6 @@ export const ssr: ( depthNode: Node, normalNode: Node, metalnessNode: Node, - camera: Camera, + roughnessNode?: Node | null, + camera?: Camera | null, ) => ShaderNodeObject; diff --git a/types/three/examples/jsm/tsl/display/boxBlur.d.ts b/types/three/examples/jsm/tsl/display/boxBlur.d.ts new file mode 100644 index 00000000000000..aa57bc8e39bfff --- /dev/null +++ b/types/three/examples/jsm/tsl/display/boxBlur.d.ts @@ -0,0 +1,11 @@ +import { ShaderNodeObject } from "three/tsl"; +import { Node } from "three/webgpu"; + +export interface BoxBlurOptions { + size?: Node | undefined; + separation?: Node | undefined; + mask?: Node | null | undefined; + premultipliedAlpha?: boolean | undefined; +} + +export const boxBlur: (textureNode: Node, options?: BoxBlurOptions) => ShaderNodeObject; diff --git a/types/three/examples/jsm/tsl/display/hashBlur.d.ts b/types/three/examples/jsm/tsl/display/hashBlur.d.ts index 29160c2702fed1..461f0455f5a0c2 100644 --- a/types/three/examples/jsm/tsl/display/hashBlur.d.ts +++ b/types/three/examples/jsm/tsl/display/hashBlur.d.ts @@ -2,7 +2,7 @@ import { ShaderNodeObject } from "three/tsl"; import { Node } from "three/webgpu"; interface HashBlurOptions { - repeats?: Node | undefined; + size?: Node | undefined; mask?: Node | null | undefined; premultipliedAlpha?: boolean | undefined; } diff --git a/types/three/package.json b/types/three/package.json index 6f318919cf7bf7..13e8f4f95978bc 100644 --- a/types/three/package.json +++ b/types/three/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/three", - "version": "0.179.9999", + "version": "0.180.9999", "projects": [ "https://threejs.org/" ], diff --git a/types/three/src/Three.Core.d.ts b/types/three/src/Three.Core.d.ts index b335d0dd16253d..54fe3a4b99bce4 100644 --- a/types/three/src/Three.Core.d.ts +++ b/types/three/src/Three.Core.d.ts @@ -154,6 +154,7 @@ export * from "./textures/Data3DTexture.js"; export * from "./textures/DataArrayTexture.js"; export * from "./textures/DataTexture.js"; export * from "./textures/DepthTexture.js"; +export * from "./textures/ExternalTexture.js"; export * from "./textures/FramebufferTexture.js"; export * from "./textures/Source.js"; export * from "./textures/Texture.js"; diff --git a/types/three/src/Three.TSL.d.ts b/types/three/src/Three.TSL.d.ts index 80e620840c5c9f..becbe83a141128 100644 --- a/types/three/src/Three.TSL.d.ts +++ b/types/three/src/Three.TSL.d.ts @@ -97,6 +97,7 @@ export const buffer: typeof TSL.buffer; export const bufferAttribute: typeof TSL.bufferAttribute; export const bumpMap: typeof TSL.bumpMap; export const burn: typeof TSL.burn; +export const builtin: typeof TSL.builtin; export const bvec2: typeof TSL.bvec2; export const bvec3: typeof TSL.bvec3; export const bvec4: typeof TSL.bvec4; @@ -111,6 +112,7 @@ export const cameraPosition: typeof TSL.cameraPosition; export const cameraProjectionMatrix: typeof TSL.cameraProjectionMatrix; export const cameraProjectionMatrixInverse: typeof TSL.cameraProjectionMatrixInverse; export const cameraViewMatrix: typeof TSL.cameraViewMatrix; +export const cameraViewport: typeof TSL.cameraViewport; export const cameraWorldMatrix: typeof TSL.cameraWorldMatrix; export const cbrt: typeof TSL.cbrt; export const cdl: typeof TSL.cdl; @@ -177,6 +179,8 @@ export const faceDirection: typeof TSL.faceDirection; export const faceForward: typeof TSL.faceForward; export const faceforward: typeof TSL.faceforward; export const float: typeof TSL.float; +export const floatBitsToInt: typeof TSL.floatBitsToInt; +export const floatBitsToUint: typeof TSL.floatBitsToUint; export const floor: typeof TSL.floor; export const fog: typeof TSL.fog; export const fract: typeof TSL.fract; @@ -219,6 +223,7 @@ export const instancedBufferAttribute: typeof TSL.instancedBufferAttribute; export const instancedDynamicBufferAttribute: typeof TSL.instancedDynamicBufferAttribute; export const instancedMesh: typeof TSL.instancedMesh; export const int: typeof TSL.int; +export const intBitsToFloat: typeof TSL.intBitsToFloat; export const inverse: typeof TSL.inverse; export const inverseSqrt: typeof TSL.inverseSqrt; export const inversesqrt: typeof TSL.inversesqrt; @@ -465,6 +470,7 @@ export const saturate: typeof TSL.saturate; export const saturation: typeof TSL.saturation; export const screen: typeof TSL.screen; export const screenCoordinate: typeof TSL.screenCoordinate; +export const screenDPR: typeof TSL.screenDPR; export const screenSize: typeof TSL.screenSize; export const screenUV: typeof TSL.screenUV; export const scriptable: typeof TSL.scriptable; @@ -504,15 +510,35 @@ export const storageTexture: typeof TSL.storageTexture; export const string: typeof TSL.string; export const struct: typeof TSL.struct; export const sub: typeof TSL.sub; +export const subgroupAdd: typeof TSL.subgroupAdd; +export const subgroupAll: typeof TSL.subgroupAll; +export const subgroupAnd: typeof TSL.subgroupAnd; +export const subgroupAny: typeof TSL.subgroupAny; +export const subgroupBallot: typeof TSL.subgroupBallot; +export const subgroupBroadcast: typeof TSL.subgroupBroadcast; +export const subgroupBroadcastFirst: typeof TSL.subgroupBroadcastFirst; export const subBuild: typeof TSL.subBuild; +export const subgroupElect: typeof TSL.subgroupElect; +export const subgroupExclusiveAdd: typeof TSL.subgroupExclusiveAdd; +export const subgroupExclusiveMul: typeof TSL.subgroupExclusiveMul; +export const subgroupInclusiveAdd: typeof TSL.subgroupInclusiveAdd; +export const subgroupInclusiveMul: typeof TSL.subgroupInclusiveMul; export const subgroupIndex: typeof TSL.subgroupIndex; +export const subgroupMax: typeof TSL.subgroupMax; +export const subgroupMin: typeof TSL.subgroupMin; +export const subgroupMul: typeof TSL.subgroupMul; +export const subgroupOr: typeof TSL.subgroupOr; +export const subgroupShuffle: typeof TSL.subgroupShuffle; +export const subgroupShuffleDown: typeof TSL.subgroupShuffleDown; +export const subgroupShuffleUp: typeof TSL.subgroupShuffleUp; +export const subgroupShuffleXor: typeof TSL.subgroupShuffleXor; export const subgroupSize: typeof TSL.subgroupSize; +export const subgroupXor: typeof TSL.subgroupXor; export const tan: typeof TSL.tan; export const tangentGeometry: typeof TSL.tangentGeometry; export const tangentLocal: typeof TSL.tangentLocal; export const tangentView: typeof TSL.tangentView; export const tangentWorld: typeof TSL.tangentWorld; -export const temp: typeof TSL.temp; export const texture: typeof TSL.texture; export const texture3D: typeof TSL.texture3D; export const textureBarrier: typeof TSL.textureBarrier; @@ -524,9 +550,6 @@ export const textureSize: typeof TSL.textureSize; export const textureStore: typeof TSL.textureStore; export const thickness: typeof TSL.thickness; export const time: typeof TSL.time; -export const timerDelta: typeof TSL.timerDelta; -export const timerGlobal: typeof TSL.timerGlobal; -export const timerLocal: typeof TSL.timerLocal; export const toneMapping: typeof TSL.toneMapping; export const toneMappingExposure: typeof TSL.toneMappingExposure; export const toonOutlinePass: typeof TSL.toonOutlinePass; @@ -543,10 +566,12 @@ export const triplanarTexture: typeof TSL.triplanarTexture; export const triplanarTextures: typeof TSL.triplanarTextures; export const trunc: typeof TSL.trunc; export const uint: typeof TSL.uint; +export const uintBitsToFloat: typeof TSL.uintBitsToFloat; export const uniform: typeof TSL.uniform; export const uniformArray: typeof TSL.uniformArray; export const uniformCubeTexture: typeof TSL.uniformCubeTexture; export const uniformGroup: typeof TSL.uniformGroup; +export const uniformFlow: typeof TSL.uniformFlow; export const uniformTexture: typeof TSL.uniformTexture; export const unpremultiplyAlpha: typeof TSL.unpremultiplyAlpha; export const userData: typeof TSL.userData; diff --git a/types/three/src/animation/AnimationClip.d.ts b/types/three/src/animation/AnimationClip.d.ts index 40f7d621ff9fd8..2f019fb0eb760d 100644 --- a/types/three/src/animation/AnimationClip.d.ts +++ b/types/three/src/animation/AnimationClip.d.ts @@ -132,6 +132,11 @@ export class AnimationClip { * The UUID of the animation clip. */ readonly uuid: string; + /** + * An object that can be used to store custom data about the animation clip. + * It should not hold references to functions as these will not be cloned. + */ + userData: Record; /** * Sets the duration of this clip to the duration of its longest keyframe track. * diff --git a/types/three/src/constants.d.ts b/types/three/src/constants.d.ts index 03e9cdd917495a..72a2d3b5f84c65 100644 --- a/types/three/src/constants.d.ts +++ b/types/three/src/constants.d.ts @@ -337,6 +337,7 @@ export const UnsignedShort4444Type: 1017; export const UnsignedShort5551Type: 1018; export const UnsignedInt248Type: 1020; export const UnsignedInt5999Type: 35902; +export const UnsignedInt101111Type: 35899; export type AttributeGPUType = typeof FloatType | typeof IntType; @@ -358,7 +359,8 @@ export type TextureDataType = | typeof UnsignedShort4444Type | typeof UnsignedShort5551Type | typeof UnsignedInt248Type - | typeof UnsignedInt5999Type; + | typeof UnsignedInt5999Type + | typeof UnsignedInt101111Type; /////////////////////////////////////////////////////////////////////////////// // Pixel formats diff --git a/types/three/src/materials/LineBasicMaterial.d.ts b/types/three/src/materials/LineBasicMaterial.d.ts index 25409165c49637..32ebeefc7c12c1 100644 --- a/types/three/src/materials/LineBasicMaterial.d.ts +++ b/types/three/src/materials/LineBasicMaterial.d.ts @@ -81,6 +81,7 @@ export class LineBasicMaterial extends Material { * @default true */ readonly isLineBasicMaterial: boolean; + setValues(values?: LineBasicMaterialParameters): void; } // eslint-disable-next-line @typescript-eslint/no-empty-interface diff --git a/types/three/src/materials/LineDashedMaterial.d.ts b/types/three/src/materials/LineDashedMaterial.d.ts index 2183da1ee2ec90..1548d4d0a6f849 100644 --- a/types/three/src/materials/LineDashedMaterial.d.ts +++ b/types/three/src/materials/LineDashedMaterial.d.ts @@ -49,6 +49,7 @@ export class LineDashedMaterial extends LineBasicMaterial { * @default true */ readonly isLineDashedMaterial: boolean; + setValues(values?: LineDashedMaterialParameters): void; } // eslint-disable-next-line @typescript-eslint/no-empty-interface diff --git a/types/three/src/materials/MeshBasicMaterial.d.ts b/types/three/src/materials/MeshBasicMaterial.d.ts index f0e51cfce465cf..cfe54992a11131 100644 --- a/types/three/src/materials/MeshBasicMaterial.d.ts +++ b/types/three/src/materials/MeshBasicMaterial.d.ts @@ -167,6 +167,7 @@ export class MeshBasicMaterial extends Material { * @default true */ readonly isMeshBasicMaterial: boolean; + setValues(values?: MeshBasicMaterialParameters): void; } // eslint-disable-next-line @typescript-eslint/no-empty-interface diff --git a/types/three/src/materials/MeshDepthMaterial.d.ts b/types/three/src/materials/MeshDepthMaterial.d.ts index 169e78fed3de53..0ac60817ab3471 100644 --- a/types/three/src/materials/MeshDepthMaterial.d.ts +++ b/types/three/src/materials/MeshDepthMaterial.d.ts @@ -99,6 +99,7 @@ export class MeshDepthMaterial extends Material { * @default true */ readonly isMeshDepthMaterial: boolean; + setValues(values?: MeshDepthMaterialParameters): void; } // eslint-disable-next-line @typescript-eslint/no-empty-interface diff --git a/types/three/src/materials/MeshDistanceMaterial.d.ts b/types/three/src/materials/MeshDistanceMaterial.d.ts index 072549ba4501a2..b704fc907bbcdf 100644 --- a/types/three/src/materials/MeshDistanceMaterial.d.ts +++ b/types/three/src/materials/MeshDistanceMaterial.d.ts @@ -63,7 +63,7 @@ export interface MeshDistanceMaterialParameters * Can also be used to customize the shadow casting of an object by assigning * an instance of `MeshDistanceMaterial` to {@link Object3D#customDistanceMaterial}. * The following examples demonstrates this approach in order to ensure - * transparent parts of objects do no cast shadows. + * transparent parts of objects do not cast shadows. */ export class MeshDistanceMaterial extends Material { /** @@ -82,6 +82,7 @@ export class MeshDistanceMaterial extends Material { * @default true */ readonly isMeshDistanceMaterial: boolean; + setValues(values?: MeshDistanceMaterialParameters): void; } // eslint-disable-next-line @typescript-eslint/no-empty-interface diff --git a/types/three/src/materials/MeshLambertMaterial.d.ts b/types/three/src/materials/MeshLambertMaterial.d.ts index b4ae119288f02c..97e9115e989587 100644 --- a/types/three/src/materials/MeshLambertMaterial.d.ts +++ b/types/three/src/materials/MeshLambertMaterial.d.ts @@ -269,6 +269,7 @@ export class MeshLambertMaterial extends Material { * @default true */ readonly isMeshLambertMaterial: boolean; + setValues(values?: MeshLambertMaterialParameters): void; } // eslint-disable-next-line @typescript-eslint/no-empty-interface diff --git a/types/three/src/materials/MeshMatcapMaterial.d.ts b/types/three/src/materials/MeshMatcapMaterial.d.ts index 291300d02aa4c5..463cec31ad3539 100644 --- a/types/three/src/materials/MeshMatcapMaterial.d.ts +++ b/types/three/src/materials/MeshMatcapMaterial.d.ts @@ -148,6 +148,7 @@ export class MeshMatcapMaterial extends Material { * @default true */ readonly isMeshMatcapMaterial: boolean; + setValues(values?: MeshMatcapMaterialParameters): void; } // eslint-disable-next-line @typescript-eslint/no-empty-interface diff --git a/types/three/src/materials/MeshNormalMaterial.d.ts b/types/three/src/materials/MeshNormalMaterial.d.ts index 1d3d9405e6a246..2428b5bd015856 100644 --- a/types/three/src/materials/MeshNormalMaterial.d.ts +++ b/types/three/src/materials/MeshNormalMaterial.d.ts @@ -117,6 +117,7 @@ export class MeshNormalMaterial extends Material { * @default true */ readonly isMeshNormalMaterial: boolean; + setValues(values?: MeshNormalMaterialParameters): void; } // eslint-disable-next-line @typescript-eslint/no-empty-interface diff --git a/types/three/src/materials/MeshPhongMaterial.d.ts b/types/three/src/materials/MeshPhongMaterial.d.ts index 2704fda7ed0604..2a1add23bcf94b 100644 --- a/types/three/src/materials/MeshPhongMaterial.d.ts +++ b/types/three/src/materials/MeshPhongMaterial.d.ts @@ -281,6 +281,7 @@ export class MeshPhongMaterial extends Material { * @default true */ readonly isMeshPhongMaterial: boolean; + setValues(values?: MeshPhongMaterialParameters): void; } // eslint-disable-next-line @typescript-eslint/no-empty-interface diff --git a/types/three/src/materials/MeshToonMaterial.d.ts b/types/three/src/materials/MeshToonMaterial.d.ts index e4472ea6a20d1a..e7d42f7d7d1a99 100644 --- a/types/three/src/materials/MeshToonMaterial.d.ts +++ b/types/three/src/materials/MeshToonMaterial.d.ts @@ -216,6 +216,7 @@ export class MeshToonMaterial extends Material { * @default true */ readonly isMeshToonMaterial: boolean; + setValues(values?: MeshToonMaterialParameters): void; } // eslint-disable-next-line @typescript-eslint/no-empty-interface diff --git a/types/three/src/materials/PointsMaterial.d.ts b/types/three/src/materials/PointsMaterial.d.ts index 95dafc2f860d6c..fe69504f3a0bc7 100644 --- a/types/three/src/materials/PointsMaterial.d.ts +++ b/types/three/src/materials/PointsMaterial.d.ts @@ -97,6 +97,7 @@ export class PointsMaterial extends Material { * @default true */ readonly isPointsMaterial: boolean; + setValues(values?: PointsMaterialParameters): void; } // eslint-disable-next-line @typescript-eslint/no-empty-interface diff --git a/types/three/src/materials/ShaderMaterial.d.ts b/types/three/src/materials/ShaderMaterial.d.ts index bde9bb2d05e867..ca4adb7ac1c1dc 100644 --- a/types/three/src/materials/ShaderMaterial.d.ts +++ b/types/three/src/materials/ShaderMaterial.d.ts @@ -243,6 +243,7 @@ export class ShaderMaterial extends Material { * @default true */ readonly isShaderMaterial: boolean; + setValues(values?: ShaderMaterialParameters): void; toJSON(meta?: JSONMeta): ShaderMaterialJSON; } diff --git a/types/three/src/materials/ShadowMaterial.d.ts b/types/three/src/materials/ShadowMaterial.d.ts index 3704687a9a5c83..abbba674bc37ff 100644 --- a/types/three/src/materials/ShadowMaterial.d.ts +++ b/types/three/src/materials/ShadowMaterial.d.ts @@ -54,6 +54,7 @@ export class ShadowMaterial extends Material { * @default true */ readonly isShadowMaterial: boolean; + setValues(values?: ShadowMaterialParameters): void; } // eslint-disable-next-line @typescript-eslint/no-empty-interface diff --git a/types/three/src/materials/SpriteMaterial.d.ts b/types/three/src/materials/SpriteMaterial.d.ts index 3377cc7ac91ab3..e5fff0a18235f8 100644 --- a/types/three/src/materials/SpriteMaterial.d.ts +++ b/types/three/src/materials/SpriteMaterial.d.ts @@ -84,6 +84,7 @@ export class SpriteMaterial extends Material { * @default true */ readonly isSpriteMaterial: boolean; + setValues(values?: SpriteMaterialParameters): void; } // eslint-disable-next-line @typescript-eslint/no-empty-interface diff --git a/types/three/src/materials/nodes/Line2NodeMaterial.d.ts b/types/three/src/materials/nodes/Line2NodeMaterial.d.ts index 9263077a67285c..9d4234166dec40 100644 --- a/types/three/src/materials/nodes/Line2NodeMaterial.d.ts +++ b/types/three/src/materials/nodes/Line2NodeMaterial.d.ts @@ -87,6 +87,7 @@ declare class Line2NodeMaterial extends NodeMaterial { * @default true */ readonly isLine2NodeMaterial: boolean; + setValues(values?: Line2NodeMaterialParameters): void; } // eslint-disable-next-line @typescript-eslint/no-empty-interface diff --git a/types/three/src/materials/nodes/LineBasicNodeMaterial.d.ts b/types/three/src/materials/nodes/LineBasicNodeMaterial.d.ts index 0c883651439619..fe6b177a83e8a3 100644 --- a/types/three/src/materials/nodes/LineBasicNodeMaterial.d.ts +++ b/types/three/src/materials/nodes/LineBasicNodeMaterial.d.ts @@ -33,6 +33,7 @@ declare class LineBasicNodeMaterial extends NodeMaterial { * @default true */ readonly isLineBasicNodeMaterial: boolean; + setValues(values?: LineBasicNodeMaterialParameters): void; } // eslint-disable-next-line @typescript-eslint/no-empty-interface diff --git a/types/three/src/materials/nodes/LineDashedNodeMaterial.d.ts b/types/three/src/materials/nodes/LineDashedNodeMaterial.d.ts index 28b384e585f5c6..4ab90073a93d95 100644 --- a/types/three/src/materials/nodes/LineDashedNodeMaterial.d.ts +++ b/types/three/src/materials/nodes/LineDashedNodeMaterial.d.ts @@ -79,6 +79,7 @@ declare class LineDashedNodeMaterial extends NodeMaterial { * @default true */ readonly isLineDashedNodeMaterial: boolean; + setValues(values?: LineDashedNodeMaterialParameters): void; } // eslint-disable-next-line @typescript-eslint/no-empty-interface diff --git a/types/three/src/materials/nodes/MeshBasicNodeMaterial.d.ts b/types/three/src/materials/nodes/MeshBasicNodeMaterial.d.ts index 2c69d1573e3e72..a42ef14f1d9398 100644 --- a/types/three/src/materials/nodes/MeshBasicNodeMaterial.d.ts +++ b/types/three/src/materials/nodes/MeshBasicNodeMaterial.d.ts @@ -33,6 +33,7 @@ declare class MeshBasicNodeMaterial extends NodeMaterial { * @default true */ readonly isMeshBasicNodeMaterial: boolean; + setValues(values?: MeshBasicNodeMaterialParameters): void; /** * Overwritten since this type of material uses {@link BasicEnvironmentNode} * to implement the default environment mapping. diff --git a/types/three/src/materials/nodes/MeshLambertNodeMaterial.d.ts b/types/three/src/materials/nodes/MeshLambertNodeMaterial.d.ts index 61fd616a4aec40..88dd57330a75c5 100644 --- a/types/three/src/materials/nodes/MeshLambertNodeMaterial.d.ts +++ b/types/three/src/materials/nodes/MeshLambertNodeMaterial.d.ts @@ -34,6 +34,7 @@ declare class MeshLambertNodeMaterial extends NodeMaterial { * @default true */ readonly isMeshLambertNodeMaterial: boolean; + setValues(values?: MeshLambertNodeMaterialParameters): void; /** * Overwritten since this type of material uses {@link BasicEnvironmentNode} * to implement the default environment mapping. diff --git a/types/three/src/materials/nodes/MeshMatcapNodeMaterial.d.ts b/types/three/src/materials/nodes/MeshMatcapNodeMaterial.d.ts index ce3565ba68fa5d..20cff34fa9fc47 100644 --- a/types/three/src/materials/nodes/MeshMatcapNodeMaterial.d.ts +++ b/types/three/src/materials/nodes/MeshMatcapNodeMaterial.d.ts @@ -30,6 +30,7 @@ declare class MeshMatcapNodeMaterial extends NodeMaterial { * @default true */ readonly isMeshMatcapNodeMaterial: boolean; + setValues(values?: MeshMatcapNodeMaterialParameters): void; /** * Setups the matcap specific node variables. * diff --git a/types/three/src/materials/nodes/MeshNormalNodeMaterial.d.ts b/types/three/src/materials/nodes/MeshNormalNodeMaterial.d.ts index 5cf50482ae1b80..ce18f998329be3 100644 --- a/types/three/src/materials/nodes/MeshNormalNodeMaterial.d.ts +++ b/types/three/src/materials/nodes/MeshNormalNodeMaterial.d.ts @@ -29,6 +29,7 @@ declare class MeshNormalNodeMaterial extends NodeMaterial { * @type {boolean} */ readonly isMeshNormalNodeMaterial: boolean; + setValues(values?: MeshNormalNodeMaterialParameters): void; /** * Overwrites the default implementation by computing the diffuse color * based on the normal data. diff --git a/types/three/src/materials/nodes/MeshPhongNodeMaterial.d.ts b/types/three/src/materials/nodes/MeshPhongNodeMaterial.d.ts index f05ab31c7913c4..c678ec080c18cd 100644 --- a/types/three/src/materials/nodes/MeshPhongNodeMaterial.d.ts +++ b/types/three/src/materials/nodes/MeshPhongNodeMaterial.d.ts @@ -54,6 +54,7 @@ declare class MeshPhongNodeMaterial extends NodeMaterial { * @default true */ readonly isMeshPhongNodeMaterial: boolean; + setValues(values?: MeshPhongNodeMaterialParameters): void; /** * Overwritten since this type of material uses {@link BasicEnvironmentNode} * to implement the default environment mapping. diff --git a/types/three/src/materials/nodes/MeshPhysicalNodeMaterial.d.ts b/types/three/src/materials/nodes/MeshPhysicalNodeMaterial.d.ts index e1bf12a0760063..aff931a92e688c 100644 --- a/types/three/src/materials/nodes/MeshPhysicalNodeMaterial.d.ts +++ b/types/three/src/materials/nodes/MeshPhysicalNodeMaterial.d.ts @@ -212,6 +212,7 @@ declare class MeshPhysicalNodeMaterial extends MeshStandardNodeMaterial { * @default true */ readonly isMeshPhysicalNodeMaterial: boolean; + setValues(values?: MeshPhysicalNodeMaterialParameters): void; /** * Whether the lighting model should use clearcoat or not. * diff --git a/types/three/src/materials/nodes/MeshSSSNodeMaterial.d.ts b/types/three/src/materials/nodes/MeshSSSNodeMaterial.d.ts index 85f9f56bd0ae5b..45b86f3d985242 100644 --- a/types/three/src/materials/nodes/MeshSSSNodeMaterial.d.ts +++ b/types/three/src/materials/nodes/MeshSSSNodeMaterial.d.ts @@ -92,6 +92,7 @@ export interface MeshSSSNodeMaterialParameters */ declare class MeshSSSNodeMaterial extends MeshPhysicalNodeMaterial { constructor(parameters?: MeshSSSNodeMaterialParameters); + setValues(values?: MeshSSSNodeMaterialParameters): void; /** * Whether the lighting model should use SSS or not. * diff --git a/types/three/src/materials/nodes/MeshStandardNodeMaterial.d.ts b/types/three/src/materials/nodes/MeshStandardNodeMaterial.d.ts index 318b014f737887..81e03bd86bcbd2 100644 --- a/types/three/src/materials/nodes/MeshStandardNodeMaterial.d.ts +++ b/types/three/src/materials/nodes/MeshStandardNodeMaterial.d.ts @@ -65,6 +65,7 @@ declare class MeshStandardNodeMaterial extends NodeMaterial { * @default true */ readonly isMeshStandardNodeMaterial: boolean; + setValues(values?: MeshStandardNodeMaterialParameters): void; /** * Overwritten since this type of material uses {@link EnvironmentNode} * to implement the PBR (PMREM based) environment mapping. Besides, the diff --git a/types/three/src/materials/nodes/MeshToonNodeMaterial.d.ts b/types/three/src/materials/nodes/MeshToonNodeMaterial.d.ts index b2481379e5d8bd..c5c013981af7cf 100644 --- a/types/three/src/materials/nodes/MeshToonNodeMaterial.d.ts +++ b/types/three/src/materials/nodes/MeshToonNodeMaterial.d.ts @@ -34,6 +34,7 @@ declare class MeshToonNodeMaterial extends NodeMaterial { * @default true */ readonly isMeshToonNodeMaterial: boolean; + setValues(values?: MeshToonNodeMaterialParameters): void; /** * Setups the lighting model. * diff --git a/types/three/src/materials/nodes/NodeMaterial.d.ts b/types/three/src/materials/nodes/NodeMaterial.d.ts index 6581757375b2fb..04e828d9da639e 100644 --- a/types/three/src/materials/nodes/NodeMaterial.d.ts +++ b/types/three/src/materials/nodes/NodeMaterial.d.ts @@ -291,6 +291,7 @@ declare class NodeMaterial extends Material { * @default true */ readonly isNodeMaterial: boolean; + setValues(values?: NodeMaterialParameters): void; /** * Builds this material with the given node builder. * diff --git a/types/three/src/materials/nodes/PointsNodeMaterial.d.ts b/types/three/src/materials/nodes/PointsNodeMaterial.d.ts index 1b75cce7f410f6..15d6b4947ff7e0 100644 --- a/types/three/src/materials/nodes/PointsNodeMaterial.d.ts +++ b/types/three/src/materials/nodes/PointsNodeMaterial.d.ts @@ -26,6 +26,22 @@ export interface PointsNodeMaterialParameters /** * Node material version of {@link PointsMaterial}. + * + * This material can be used in two ways: + * + * - By rendering point primitives with {@link Points}. Since WebGPU only supports point primitives + * with a pixel size of `1`, it's not possible to define a size. + * + * ```js + * const pointCloud = new THREE.Points( geometry, new THREE.PointsNodeMaterial() ); + * ``` + * + * - By rendering point primitives with {@link Sprites}. In this case, size is honored, + * see {@link PointsNodeMaterial#sizeNode}. + * + * ```js + * const instancedPoints = new THREE.Sprite( new THREE.PointsNodeMaterial( { positionNode: instancedBufferAttribute( positionAttribute ) } ) ); + * ``` */ declare class PointsNodeMaterial extends SpriteNodeMaterial { constructor(parameters?: PointsNodeMaterialParameters); @@ -35,6 +51,7 @@ declare class PointsNodeMaterial extends SpriteNodeMaterial { * @default true */ readonly isPointsNodeMaterial: boolean; + setValues(values?: PointsNodeMaterialParameters): void; } // eslint-disable-next-line @typescript-eslint/no-empty-interface diff --git a/types/three/src/materials/nodes/ShadowNodeMaterial.d.ts b/types/three/src/materials/nodes/ShadowNodeMaterial.d.ts index 0751b9a4e48eeb..c6f764840c5879 100644 --- a/types/three/src/materials/nodes/ShadowNodeMaterial.d.ts +++ b/types/three/src/materials/nodes/ShadowNodeMaterial.d.ts @@ -30,6 +30,7 @@ declare class ShadowNodeMaterial extends NodeMaterial { * @default true */ readonly isShadowNodeMaterial: boolean; + setValues(values?: ShadowNodeMaterialParameters): void; /** * Setups the lighting model. * diff --git a/types/three/src/materials/nodes/SpriteNodeMaterial.d.ts b/types/three/src/materials/nodes/SpriteNodeMaterial.d.ts index c7206522975d9c..5e1543b3c6c851 100644 --- a/types/three/src/materials/nodes/SpriteNodeMaterial.d.ts +++ b/types/three/src/materials/nodes/SpriteNodeMaterial.d.ts @@ -60,6 +60,7 @@ declare class SpriteNodeMaterial extends NodeMaterial { * @default true */ readonly isSpriteNodeMaterial: boolean; + setValues(values?: SpriteNodeMaterialParameters): void; /** * Setups the position node in view space. This method implements * the sprite specific vertex shader. diff --git a/types/three/src/materials/nodes/VolumeNodeMaterial.d.ts b/types/three/src/materials/nodes/VolumeNodeMaterial.d.ts index c2b918d65b8afd..b988fe8b72e714 100644 --- a/types/three/src/materials/nodes/VolumeNodeMaterial.d.ts +++ b/types/three/src/materials/nodes/VolumeNodeMaterial.d.ts @@ -49,6 +49,7 @@ declare class VolumeNodeMaterial extends NodeMaterial { * @default true */ readonly isVolumeNodeMaterial: boolean; + setValues(values?: VolumeNodeMaterialParameters): void; setupLightingModel(): VolumetricLightingModel; } diff --git a/types/three/src/materials/nodes/manager/NodeMaterialObserver.d.ts b/types/three/src/materials/nodes/manager/NodeMaterialObserver.d.ts index fb5dafacbd1d72..e95b24b215139a 100644 --- a/types/three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +++ b/types/three/src/materials/nodes/manager/NodeMaterialObserver.d.ts @@ -171,7 +171,7 @@ declare class NodeMaterialObserver { * * @param {LightsNode} lightsNode - The lights node. * @param {number} renderId - The render ID. - * @return {Array} The lights for the given lights node and render ID. + * @return {Array} The lights for the given lights node and render ID. */ getLights(lightsNode: LightsNode, renderId: number): LightData[]; /** diff --git a/types/three/src/math/ColorManagement.d.ts b/types/three/src/math/ColorManagement.d.ts index a4e53cec5c8c4a..308c54495547b5 100644 --- a/types/three/src/math/ColorManagement.d.ts +++ b/types/three/src/math/ColorManagement.d.ts @@ -11,7 +11,7 @@ export interface ColorSpaceDefinition { fromXYZ: Matrix3; luminanceCoefficients: [number, number, number]; workingColorSpaceConfig?: { unpackColorSpace: string }; - outputColorSpaceConfig?: { drawingBufferColorSpace: string }; + outputColorSpaceConfig?: { drawingBufferColorSpace: string; toneMappingNode?: "extended" | "standard" }; } export interface ColorManagement { diff --git a/types/three/src/nodes/Nodes.d.ts b/types/three/src/nodes/Nodes.d.ts index c821202a2a1c7a..406cbdcb739334 100644 --- a/types/three/src/nodes/Nodes.d.ts +++ b/types/three/src/nodes/Nodes.d.ts @@ -68,6 +68,9 @@ export { default as SplitNode } from "./utils/SplitNode.js"; export { default as SpriteSheetUVNode } from "./utils/SpriteSheetUVNode.js"; export { default as StorageArrayElementNode } from "./utils/StorageArrayElementNode.js"; +// math +export { default as BitcastNode } from "./math/BitcastNode.js"; + // accessors export { default as BatchNode } from "./accessors/BatchNode.js"; export { default as BufferAttributeNode } from "./accessors/BufferAttributeNode.js"; diff --git a/types/three/src/nodes/TSL.d.ts b/types/three/src/nodes/TSL.d.ts index adfc665ab4aac1..a5b55bc2e9bb82 100644 --- a/types/three/src/nodes/TSL.d.ts +++ b/types/three/src/nodes/TSL.d.ts @@ -19,6 +19,7 @@ export * from "./core/UniformNode.js"; export * from "./core/VaryingNode.js"; // math +export * from "./math/BitcastNode.js"; export * from "./math/Hash.js"; export * from "./math/MathUtils.js"; export * from "./math/TriNoise3D.js"; @@ -55,6 +56,7 @@ export * from "./accessors/BatchNode.js"; export * from "./accessors/Bitangent.js"; export * from "./accessors/BufferAttributeNode.js"; export * from "./accessors/BufferNode.js"; +export * from "./accessors/BuiltinNode.js"; export * from "./accessors/Camera.js"; export * from "./accessors/CubeTextureNode.js"; export * from "./accessors/InstancedMeshNode.js"; @@ -128,6 +130,7 @@ export * from "./gpgpu/AtomicFunctionNode.js"; export * from "./gpgpu/BarrierNode.js"; export * from "./gpgpu/ComputeBuiltinNode.js"; export * from "./gpgpu/ComputeNode.js"; +export * from "./gpgpu/SubgroupFunctionNode.js"; export * from "./gpgpu/WorkgroupInfoNode.js"; // lighting diff --git a/types/three/src/nodes/accessors/Camera.d.ts b/types/three/src/nodes/accessors/Camera.d.ts index 79ad9346a887e2..f354479725603d 100644 --- a/types/three/src/nodes/accessors/Camera.d.ts +++ b/types/three/src/nodes/accessors/Camera.d.ts @@ -1,6 +1,7 @@ import { Matrix3 } from "../../math/Matrix3.js"; import { Matrix4 } from "../../math/Matrix4.js"; import { Vector3 } from "../../math/Vector3.js"; +import { Vector4 } from "../../math/Vector4.js"; import UniformNode from "../core/UniformNode.js"; import { ShaderNodeObject } from "../tsl/TSLCore.js"; @@ -13,3 +14,4 @@ export const cameraViewMatrix: ShaderNodeObject>; export const cameraWorldMatrix: ShaderNodeObject>; export const cameraNormalMatrix: ShaderNodeObject>; export const cameraPosition: ShaderNodeObject>; +export const cameraViewport: ShaderNodeObject>; diff --git a/types/three/src/nodes/accessors/TextureNode.d.ts b/types/three/src/nodes/accessors/TextureNode.d.ts index acbdcf95440eb1..b6cd68c1c3b983 100644 --- a/types/three/src/nodes/accessors/TextureNode.d.ts +++ b/types/three/src/nodes/accessors/TextureNode.d.ts @@ -48,6 +48,8 @@ export default class TextureNode extends UniformNode { bias(biasNode: Node): ShaderNodeObject; + getBase(): TextureNode; + compare(compareNode: Node): ShaderNodeObject; grad(gradeNodeX: Node, gradeNodeY: Node): ShaderNodeObject; diff --git a/types/three/src/nodes/core/ContextNode.d.ts b/types/three/src/nodes/core/ContextNode.d.ts index e5369294996566..7321e3018522aa 100644 --- a/types/three/src/nodes/core/ContextNode.d.ts +++ b/types/three/src/nodes/core/ContextNode.d.ts @@ -14,6 +14,9 @@ declare class ContextNode extends Node { export default ContextNode; export const context: (node: Node, context?: NodeBuilderContext) => ShaderNodeObject; + +export const uniformFlow: (node: Node) => ShaderNodeObject; + export const setName: (node: Node, label: string) => ShaderNodeObject; /** @@ -25,6 +28,7 @@ declare module "../tsl/TSLCore.js" { interface NodeElements { context: typeof context; label: typeof label; + uniformFlow: typeof uniformFlow; setName: typeof setName; } } diff --git a/types/three/src/nodes/core/Node.d.ts b/types/three/src/nodes/core/Node.d.ts index dd531e37a8889f..948bace5648a76 100644 --- a/types/three/src/nodes/core/Node.d.ts +++ b/types/three/src/nodes/core/Node.d.ts @@ -139,13 +139,6 @@ declare class Node extends EventDispatcher<{ * @return {Node} A reference to this node. */ onReference(callback: (this: this, frame: NodeBuilder | NodeFrame) => unknown): this; - /** - * The `this` reference might point to a Proxy so this method can be used - * to get the reference to the actual node instance. - * - * @return {Node} A reference to the node. - */ - getSelf(): this; /** * Nodes might refer to other objects like materials. This method allows to dynamically update the reference * to such objects based on a given state (e.g. the current node frame or builder). @@ -296,7 +289,7 @@ declare class Node extends EventDispatcher<{ * This state builds the output node and returns the resulting shader string. * * @param {NodeBuilder} builder - The current node builder. - * @param {?string} output - Can be used to define the output type. + * @param {?string} [output] - Can be used to define the output type. * @return {?string} The generated shader string. */ generate(builder: NodeBuilder, output?: string | null): string | null | undefined; @@ -334,14 +327,14 @@ declare class Node extends EventDispatcher<{ * - **generate**: Generates the shader code for the node. Returns the generated shader string. * * @param {NodeBuilder} builder - The current node builder. - * @param {string|Node|null} [output=null] - Can be used to define the output type. - * @return {Node|string|null} The result of the build process, depending on the build stage. + * @param {?(string|Node)} [output=null] - Can be used to define the output type. + * @return {?(Node|string)} The result of the build process, depending on the build stage. */ build(builder: NodeBuilder, output?: string | Node | null): Node | string | null; /** * Returns the child nodes as a JSON object. * - * @return {Array} An iterable list of serialized child objects as JSON. + * @return {Generator} An iterable list of serialized child objects as JSON. */ getSerializeChildren(): Generator; /** diff --git a/types/three/src/nodes/core/UniformNode.d.ts b/types/three/src/nodes/core/UniformNode.d.ts index eecfd4b811724b..53f2f181c30390 100644 --- a/types/three/src/nodes/core/UniformNode.d.ts +++ b/types/three/src/nodes/core/UniformNode.d.ts @@ -67,11 +67,11 @@ export default UniformNode; * * @tsl * @function - * @param {any} arg1 - The value of this node. Usually a JS primitive or three.js object (vector, matrix, color, texture). - * @param {string} [arg2] - The node type. If no explicit type is defined, the node tries to derive the type from its value. + * @param {any|string} value - The value of this uniform or your type. Usually a JS primitive or three.js object (vector, matrix, color, texture). + * @param {string} [type] - The node type. If no explicit type is defined, the node tries to derive the type from its value. * @returns {UniformNode} */ export declare const uniform: ( - arg1: InputNode | TValue, - arg2?: Node | string, + value: InputNode | TValue, + type?: Node | string, ) => import("../tsl/TSLCore.js").ShaderNodeObject>; diff --git a/types/three/src/nodes/core/VarNode.d.ts b/types/three/src/nodes/core/VarNode.d.ts index 048e33debda57e..58dd5f401f5dbb 100644 --- a/types/three/src/nodes/core/VarNode.d.ts +++ b/types/three/src/nodes/core/VarNode.d.ts @@ -32,17 +32,3 @@ declare module "../tsl/TSLCore.js" { toVarIntent: (node: Node) => Node; } } - -/** - * @deprecated Use ".toVar()" instead. - */ -export const temp: (node: Node, name?: string | null) => ShaderNodeObject; - -declare module "../tsl/TSLCore.js" { - interface NodeElements { - /** - * @deprecated Use ".toVar()" instead. - */ - temp: typeof temp; - } -} diff --git a/types/three/src/nodes/display/ScreenNode.d.ts b/types/three/src/nodes/display/ScreenNode.d.ts index 86c474a017ee70..64ddc23a0c3e1a 100644 --- a/types/three/src/nodes/display/ScreenNode.d.ts +++ b/types/three/src/nodes/display/ScreenNode.d.ts @@ -5,7 +5,8 @@ export type ScreenNodeScope = | typeof ScreenNode.COORDINATE | typeof ScreenNode.VIEWPORT | typeof ScreenNode.SIZE - | typeof ScreenNode.UV; + | typeof ScreenNode.UV + | typeof ScreenNode.DPR; declare class ScreenNode extends Node { scope: ScreenNodeScope; @@ -18,12 +19,14 @@ declare class ScreenNode extends Node { static VIEWPORT: "viewport"; static SIZE: "size"; static UV: "uv"; + static DPR: "dpr"; } export default ScreenNode; // Screen +export const screenDPR: ShaderNodeObject; export const screenUV: ShaderNodeObject; export const screenSize: ShaderNodeObject; export const screenCoordinate: ShaderNodeObject; diff --git a/types/three/src/nodes/display/ToneMappingNode.d.ts b/types/three/src/nodes/display/ToneMappingNode.d.ts index c187c54223c42d..090b481f05995c 100644 --- a/types/three/src/nodes/display/ToneMappingNode.d.ts +++ b/types/three/src/nodes/display/ToneMappingNode.d.ts @@ -16,7 +16,7 @@ export default ToneMappingNode; export const toneMapping: ( mapping: ToneMapping, - exposure: Node, + exposure: Node | number, color?: Node, ) => ShaderNodeObject; export const toneMappingExposure: ShaderNodeObject; @@ -26,7 +26,7 @@ declare module "../tsl/TSLCore.js" { toneMapping: ( color: Node, mapping?: ToneMapping, - exposure?: Node, + exposure?: Node | number, ) => ShaderNodeObject; } } diff --git a/types/three/src/nodes/display/ViewportDepthTextureNode.d.ts b/types/three/src/nodes/display/ViewportDepthTextureNode.d.ts index 6673aee30ef709..77b6920de2cfa0 100644 --- a/types/three/src/nodes/display/ViewportDepthTextureNode.d.ts +++ b/types/three/src/nodes/display/ViewportDepthTextureNode.d.ts @@ -1,9 +1,12 @@ +import { DepthTexture } from "../../textures/DepthTexture.js"; import Node from "../core/Node.js"; import { ShaderNodeObject } from "../tsl/TSLCore.js"; import ViewportTextureNode from "./ViewportTextureNode.js"; declare class ViewportDepthTextureNode extends ViewportTextureNode { constructor(uvNode?: Node, levelNode?: Node | null); + + getTextureForReference(): DepthTexture; } export default ViewportDepthTextureNode; diff --git a/types/three/src/nodes/display/ViewportSharedTextureNode.d.ts b/types/three/src/nodes/display/ViewportSharedTextureNode.d.ts index 307bfbde50c94b..8be4d9b6cc4682 100644 --- a/types/three/src/nodes/display/ViewportSharedTextureNode.d.ts +++ b/types/three/src/nodes/display/ViewportSharedTextureNode.d.ts @@ -1,9 +1,12 @@ +import { FramebufferTexture } from "../../textures/FramebufferTexture.js"; import Node from "../core/Node.js"; import { ShaderNodeObject } from "../tsl/TSLCore.js"; import ViewportTextureNode from "./ViewportTextureNode.js"; declare class ViewportSharedTextureNode extends ViewportTextureNode { constructor(uvNode?: Node, levelNode?: Node | null); + + getTextureForReference(): FramebufferTexture; } export default ViewportSharedTextureNode; diff --git a/types/three/src/nodes/display/ViewportTextureNode.d.ts b/types/three/src/nodes/display/ViewportTextureNode.d.ts index ade4ea51e74a86..1e6f67e5c5c8e4 100644 --- a/types/three/src/nodes/display/ViewportTextureNode.d.ts +++ b/types/three/src/nodes/display/ViewportTextureNode.d.ts @@ -1,4 +1,6 @@ +import { RenderTarget } from "../../core/RenderTarget.js"; import { FramebufferTexture } from "../../textures/FramebufferTexture.js"; +import { Texture } from "../../textures/Texture.js"; import TextureNode from "../accessors/TextureNode.js"; import { NodeUpdateType } from "../core/constants.js"; import Node from "../core/Node.js"; @@ -12,6 +14,8 @@ declare class ViewportTextureNode extends TextureNode { updateBeforeType: NodeUpdateType; constructor(uvNode?: Node, levelNode?: Node | null, framebufferTexture?: FramebufferTexture | null); + + getTextureForReference(reference?: RenderTarget | null): Texture; } export default ViewportTextureNode; diff --git a/types/three/src/nodes/gpgpu/SubgroupFunctionNode.d.ts b/types/three/src/nodes/gpgpu/SubgroupFunctionNode.d.ts new file mode 100644 index 00000000000000..e32de328ac40e8 --- /dev/null +++ b/types/three/src/nodes/gpgpu/SubgroupFunctionNode.d.ts @@ -0,0 +1,100 @@ +import Node from "../core/Node.js"; +import TempNode from "../core/TempNode.js"; +import { ShaderNodeObject } from "../tsl/TSLCore.js"; + +export type SubgroupFunctionNodeMethod0 = typeof SubgroupFunctionNode.SUBGROUP_ELECT; + +export type SubgroupFunctionNodeMethod1 = + | typeof SubgroupFunctionNode.SUBGROUP_BALLOT + | typeof SubgroupFunctionNode.SUBGROUP_ADD + | typeof SubgroupFunctionNode.SUBGROUP_INCLUSIVE_ADD + | typeof SubgroupFunctionNode.SUBGROUP_EXCLUSIVE_AND + | typeof SubgroupFunctionNode.SUBGROUP_MUL + | typeof SubgroupFunctionNode.SUBGROUP_INCLUSIVE_MUL + | typeof SubgroupFunctionNode.SUBGROUP_EXCLUSIVE_MUL + | typeof SubgroupFunctionNode.SUBGROUP_AND + | typeof SubgroupFunctionNode.SUBGROUP_OR + | typeof SubgroupFunctionNode.SUBGROUP_XOR + | typeof SubgroupFunctionNode.SUBGROUP_MIN + | typeof SubgroupFunctionNode.SUBGROUP_MAX + | typeof SubgroupFunctionNode.SUBGROUP_ALL + | typeof SubgroupFunctionNode.SUBGROUP_ANY + | typeof SubgroupFunctionNode.SUBGROUP_BROADCAST_FIRST + | typeof SubgroupFunctionNode.QUAD_SWAP_X + | typeof SubgroupFunctionNode.QUAD_SWAP_Y + | typeof SubgroupFunctionNode.QUAD_SWAP_DIAGONAL; + +export type SubgroupFunctionNodeMethod2 = + | typeof SubgroupFunctionNode.SUBGROUP_BROADCAST + | typeof SubgroupFunctionNode.SUBGROUP_SHUFFLE + | typeof SubgroupFunctionNode.SUBGROUP_SHUFFLE_XOR + | typeof SubgroupFunctionNode.SUBGROUP_SHUFFLE_UP + | typeof SubgroupFunctionNode.SUBGROUP_SHUFFLE_DOWN + | typeof SubgroupFunctionNode.QUAD_BROADCAST; + +declare class SubgroupFunctionNode extends TempNode { + constructor(method: SubgroupFunctionNodeMethod0); + constructor(method: SubgroupFunctionNodeMethod1, aNode: Node); + constructor(method: SubgroupFunctionNodeMethod2, aNode: Node, bNode: Node); + + // 0 inputs + static SUBGROUP_ELECT: "subgroupElect"; + + // 1 input + static SUBGROUP_BALLOT: "subgroupBallot"; + static SUBGROUP_ADD: "subgroupAdd"; + static SUBGROUP_INCLUSIVE_ADD: "subgroupInclusiveAdd"; + static SUBGROUP_EXCLUSIVE_AND: "subgroupExclusiveAdd"; + static SUBGROUP_MUL: "subgroupMul"; + static SUBGROUP_INCLUSIVE_MUL: "subgroupInclusiveMul"; + static SUBGROUP_EXCLUSIVE_MUL: "subgroupExclusiveMul"; + static SUBGROUP_AND: "subgroupAnd"; + static SUBGROUP_OR: "subgroupOr"; + static SUBGROUP_XOR: "subgroupXor"; + static SUBGROUP_MIN: "subgroupMin"; + static SUBGROUP_MAX: "subgroupMax"; + static SUBGROUP_ALL: "subgroupAll"; + static SUBGROUP_ANY: "subgroupAny"; + static SUBGROUP_BROADCAST_FIRST: "subgroupBroadcastFirst"; + static QUAD_SWAP_X: "quadSwapX"; + static QUAD_SWAP_Y: "quadSwapY"; + static QUAD_SWAP_DIAGONAL: "quadSwapDiagonal"; + + // 2 inputs + static SUBGROUP_BROADCAST: "subgroupBroadcast"; + static SUBGROUP_SHUFFLE: "subgroupShuffle"; + static SUBGROUP_SHUFFLE_XOR: "subgroupShuffleXor"; + static SUBGROUP_SHUFFLE_UP: "subgroupShuffleUp"; + static SUBGROUP_SHUFFLE_DOWN: "subgroupShuffleDown"; + static QUAD_BROADCAST: "quadBroadcast"; +} + +export default SubgroupFunctionNode; + +export const subgroupElect: () => ShaderNodeObject; + +export const subgroupBallot: (pred: Node) => ShaderNodeObject; +export const subgroupAdd: (e: Node) => ShaderNodeObject; +export const subgroupInclusiveAdd: (e: Node) => ShaderNodeObject; +export const subgroupExclusiveAdd: (e: Node) => ShaderNodeObject; +export const subgroupMul: (e: Node) => ShaderNodeObject; +export const subgroupInclusiveMul: (e: Node) => ShaderNodeObject; +export const subgroupExclusiveMul: (e: Node) => ShaderNodeObject; +export const subgroupAnd: (e: Node) => ShaderNodeObject; +export const subgroupOr: (e: Node) => ShaderNodeObject; +export const subgroupXor: (e: Node) => ShaderNodeObject; +export const subgroupMin: (e: Node) => ShaderNodeObject; +export const subgroupMax: (e: Node) => ShaderNodeObject; +export const subgroupAll: () => ShaderNodeObject; +export const subgroupAny: () => ShaderNodeObject; +export const subgroupBroadcastFirst: (e: Node, id: Node) => ShaderNodeObject; +export const quadSwapX: (e: Node) => ShaderNodeObject; +export const quadSwapY: (e: Node) => ShaderNodeObject; +export const quadSwapDiagonal: (e: Node) => ShaderNodeObject; + +export const subgroupBroadcast: (e: Node, id: Node) => ShaderNodeObject; +export const subgroupShuffle: (v: Node, id: Node) => ShaderNodeObject; +export const subgroupShuffleXor: (v: Node, mask: Node) => ShaderNodeObject; +export const subgroupShuffleUp: (v: Node, delta: Node) => ShaderNodeObject; +export const subgroupShuffleDown: (v: Node, delta: Node) => ShaderNodeObject; +export const quadBroadcast: (e: Node) => ShaderNodeObject; diff --git a/types/three/src/nodes/math/BitcastNode.d.ts b/types/three/src/nodes/math/BitcastNode.d.ts new file mode 100644 index 00000000000000..6f39871a545340 --- /dev/null +++ b/types/three/src/nodes/math/BitcastNode.d.ts @@ -0,0 +1,25 @@ +import Node from "../core/Node.js"; +import TempNode from "../core/TempNode.js"; +import { ShaderNodeObject } from "../tsl/TSLCore.js"; + +declare class BitcastNode extends TempNode { + valueNode: Node; + conversionType: string; + inputType: string | null; + + readonly isBitcastNode: true; + + constructor(valueNode: Node, conversionType: string, inputType: string | null); +} + +export default BitcastNode; + +export const bitcast: (x: Node | number, y: string) => ShaderNodeObject; + +export const floatBitsToInt: (value: Node) => ShaderNodeObject; + +export const floatBitsToUint: (value: Node) => ShaderNodeObject; + +export const intBitsToFloat: (value: Node) => ShaderNodeObject; + +export const uintBitsToFloat: (value: Node) => ShaderNodeObject; diff --git a/types/three/src/nodes/math/MathNode.d.ts b/types/three/src/nodes/math/MathNode.d.ts index aa42c259fef595..7fe2a6c847fede 100644 --- a/types/three/src/nodes/math/MathNode.d.ts +++ b/types/three/src/nodes/math/MathNode.d.ts @@ -34,7 +34,6 @@ export type MathNodeMethod1 = | typeof MathNode.RECIPROCAL | typeof MathNode.TRUNC | typeof MathNode.FWIDTH - | typeof MathNode.BITCAST | typeof MathNode.TRANSPOSE | typeof MathNode.DETERMINANT | typeof MathNode.INVERSE; @@ -95,7 +94,6 @@ export default class MathNode extends TempNode { static RECIPROCAL: "reciprocal"; static TRUNC: "trunc"; static FWIDTH: "fwidth"; - static BITCAST: "bitcast"; static TRANSPOSE: "transpose"; static DETERMINANT: "determinant"; static INVERSE: "inverse"; @@ -184,7 +182,6 @@ export const inverse: (x: Node) => ShaderNodeObject; type Binary = (a: MathNodeParameter, b: MathNodeParameter) => ShaderNodeObject; -export const bitcast: Binary; export const min: ( x: MathNodeParameter, y: MathNodeParameter, diff --git a/types/three/src/nodes/utils/ReflectorNode.d.ts b/types/three/src/nodes/utils/ReflectorNode.d.ts index 7a657665344b2c..54775034120a59 100644 --- a/types/three/src/nodes/utils/ReflectorNode.d.ts +++ b/types/three/src/nodes/utils/ReflectorNode.d.ts @@ -7,9 +7,15 @@ import { ShaderNodeObject } from "../tsl/TSLCore.js"; export interface ReflectorNodeParameters { target?: Object3D | undefined; + /** + * @deprecated The "resolution" parameter has been renamed to "resolutionScale". + */ resolution?: number | undefined; + resolutionScale?: number | undefined; generateMipmaps?: boolean | undefined; bounces?: boolean | undefined; + depth?: boolean | undefined; + samples?: number | undefined; } declare class ReflectorNode extends TextureNode { @@ -26,7 +32,7 @@ declare class ReflectorBaseNode extends Node { textureNode: TextureNode; target: Object3D; - resolution: number; + resolutionScale: number; generateMipmaps: boolean; bounces: boolean; @@ -40,6 +46,15 @@ declare class ReflectorBaseNode extends Node { getVirtualCamera(camera: Camera): Camera; getRenderTarget(camera: Camera): RenderTarget; + + /** + * @deprecated The "resolution" property has been renamed to "resolutionScale" and is now of type `number`. + */ + get resolution(): number; + /** + * @deprecated The "resolution" property has been renamed to "resolutionScale" and is now of type `number`. + */ + set resolution(value: number); } export const reflector: (parameters?: ReflectorNodeParameters) => ShaderNodeObject; diff --git a/types/three/src/nodes/utils/SampleNode.d.ts b/types/three/src/nodes/utils/SampleNode.d.ts index aa47a47fe84620..bdbed256449495 100644 --- a/types/three/src/nodes/utils/SampleNode.d.ts +++ b/types/three/src/nodes/utils/SampleNode.d.ts @@ -3,14 +3,15 @@ import { ShaderNodeObject } from "../tsl/TSLCore.js"; declare class SampleNode extends Node { callback: (uv: Node) => Node; + uvNode: Node | null; readonly isSampleNode: true; - constructor(callback: (uv: Node) => Node); + constructor(callback: (uv: Node) => Node, uvNode?: Node | null); sample(uv: Node): Node; } export default SampleNode; -export const sample: (callback: (uv: Node) => Node) => ShaderNodeObject; +export const sample: (callback: (uv: Node) => Node, uv?: Node | null) => ShaderNodeObject; diff --git a/types/three/src/nodes/utils/Timer.d.ts b/types/three/src/nodes/utils/Timer.d.ts index ffad3ed7f2352f..8241395e5a7614 100644 --- a/types/three/src/nodes/utils/Timer.d.ts +++ b/types/three/src/nodes/utils/Timer.d.ts @@ -4,18 +4,3 @@ import { ShaderNodeObject } from "../tsl/TSLCore.js"; export const time: ShaderNodeObject; export const deltaTime: ShaderNodeObject; export const frameId: ShaderNodeObject; - -/** - * @deprecated Use "time" instead. - */ -export const timerLocal: (timeScale?: number) => ShaderNodeObject; - -/** - * @deprecated Use "time" instead. - */ -export const timerGlobal: (timeScale?: number) => ShaderNodeObject; - -/** - * @deprecated Use "deltaTime" instead. - */ -export const timerDelta: (timeScale?: number) => ShaderNodeObject; diff --git a/types/three/src/objects/InstancedMesh.d.ts b/types/three/src/objects/InstancedMesh.d.ts index 55b60576267e43..007674e349b61c 100644 --- a/types/three/src/objects/InstancedMesh.d.ts +++ b/types/three/src/objects/InstancedMesh.d.ts @@ -28,7 +28,6 @@ export interface InstancedMeshEventMap extends Object3DEventMap { * A special version of {@link THREE.Mesh | Mesh} with instanced rendering support * @remarks * Use {@link InstancedMesh} if you have to render a large number of objects with the same geometry and material(s) but with different world transformations - * @remarks * The usage of {@link InstancedMesh} will help you to reduce the number of draw calls and thus improve the overall rendering performance in your application. * @see Example: {@link https://threejs.org/examples/#webgl_instancing_dynamic | WebGL / instancing / dynamic} * @see Example: {@link https://threejs.org/examples/#webgl_instancing_performance | WebGL / instancing / performance} @@ -76,8 +75,8 @@ export class InstancedMesh< * @remarks * The `count` value passed into the {@link InstancedMesh | constructor} represents the **maximum** number of instances of this mesh. * You can change the number of instances at runtime to an integer value in the range `[0, count]`. - * @remarks If you need more instances than the original `count` value, you have to create a new InstancedMesh. - * @remarks Expects a `Integer` + * If you need more instances than the original `count` value, you have to create a new InstancedMesh. + * Expects a `Integer` */ count: number; diff --git a/types/three/src/renderers/WebGLRenderer.d.ts b/types/three/src/renderers/WebGLRenderer.d.ts index 795996098eb065..ef7b5e3180f675 100644 --- a/types/three/src/renderers/WebGLRenderer.d.ts +++ b/types/three/src/renderers/WebGLRenderer.d.ts @@ -12,8 +12,6 @@ import { Vector2 } from "../math/Vector2.js"; import { Vector3 } from "../math/Vector3.js"; import { Vector4 } from "../math/Vector4.js"; import { Scene } from "../scenes/Scene.js"; -import { Data3DTexture } from "../textures/Data3DTexture.js"; -import { DataArrayTexture } from "../textures/DataArrayTexture.js"; import { OffscreenCanvas, Texture } from "../textures/Texture.js"; import { WebGLCapabilities, WebGLCapabilitiesParameters } from "./webgl/WebGLCapabilities.js"; import { WebGLExtensions } from "./webgl/WebGLExtensions.js"; @@ -456,29 +454,6 @@ export class WebGLRenderer { dstLevel?: number, ): void; - /** - * @deprecated Use "copyTextureToTexture" instead. - * - * Copies the pixels of a texture in the bounds `srcRegion` in the destination texture starting from the given - * position. The `depthTexture` and `texture` property of 3D render targets are supported as well. - * - * When using render target textures as `srcTexture` and `dstTexture`, you must make sure both render targets are - * initialized e.g. via {@link .initRenderTarget}(). - * - * @param srcTexture Specifies the source texture. - * @param dstTexture Specifies the destination texture. - * @param srcRegion Specifies the bounds - * @param dstPosition Specifies the pixel offset into the dstTexture where the copy will occur. - * @param level Specifies the destination mipmap level of the texture. - */ - copyTextureToTexture3D( - srcTexture: Texture, - dstTexture: Data3DTexture | DataArrayTexture, - srcRegion?: Box3 | null, - dstPosition?: Vector3 | null, - level?: number, - ): void; - /** * Initializes the given WebGLRenderTarget memory. Useful for initializing a render target so data can be copied * into it using {@link WebGLRenderer.copyTextureToTexture} before it has been rendered to. diff --git a/types/three/src/renderers/common/Attributes.d.ts b/types/three/src/renderers/common/Attributes.d.ts index 639e95f3183c9e..9bc739d8e6d1c5 100644 --- a/types/three/src/renderers/common/Attributes.d.ts +++ b/types/three/src/renderers/common/Attributes.d.ts @@ -30,7 +30,7 @@ declare class Attributes extends DataMap<{ * Deletes the data for the given attribute. * * @param {BufferAttribute} attribute - The attribute. - * @return {Object|null} The deleted attribute data. + * @return {?Object} The deleted attribute data. */ delete(attribute: BufferAttribute | InterleavedBufferAttribute): Data; /** diff --git a/types/three/src/renderers/common/Renderer.d.ts b/types/three/src/renderers/common/Renderer.d.ts index 4bcf01774d731b..5e8c139c2a92ed 100644 --- a/types/three/src/renderers/common/Renderer.d.ts +++ b/types/three/src/renderers/common/Renderer.d.ts @@ -742,7 +742,7 @@ declare class Renderer { * if the renderer has been initialized. * * @param {Node|Array} computeNodes - The compute node(s). - * @param {Array|number} [dispatchSizeOrCount=null] - Array with [ x, y, z ] values for dispatch or a single number for the count. + * @param {?(Array|number)} [dispatchSizeOrCount=null] - Array with [ x, y, z ] values for dispatch or a single number for the count. * @return {Promise|undefined} A Promise that resolve when the compute has finished. Only returned when the renderer has not been initialized. */ compute( @@ -754,7 +754,7 @@ declare class Renderer { * * @async * @param {Node|Array} computeNodes - The compute node(s). - * @param {Array|number} [dispatchSizeOrCount=null] - Array with [ x, y, z ] values for dispatch or a single number for the count. + * @param {?(Array|number)} [dispatchSizeOrCount=null] - Array with [ x, y, z ] values for dispatch or a single number for the count. * @return {Promise} A Promise that resolve when the compute has finished. */ computeAsync( @@ -806,7 +806,7 @@ declare class Renderer { * Copies the current bound framebuffer into the given texture. * * @param {FramebufferTexture} framebufferTexture - The texture. - * @param {?Vector2|Vector4} [rectangle=null] - A two or four dimensional vector that defines the rectangular portion of the framebuffer that should be copied. + * @param {?(Vector2|Vector4)} [rectangle=null] - A two or four dimensional vector that defines the rectangular portion of the framebuffer that should be copied. */ copyFramebufferToTexture(framebufferTexture: FramebufferTexture, rectangle?: Rectangle | null): void; /** diff --git a/types/three/src/renderers/common/Textures.d.ts b/types/three/src/renderers/common/Textures.d.ts index d8a91f4ad99d95..ac4ac7f931c0a4 100644 --- a/types/three/src/renderers/common/Textures.d.ts +++ b/types/three/src/renderers/common/Textures.d.ts @@ -110,7 +110,7 @@ declare class Textures extends DataMap<{ */ getMipLevels(texture: Texture, width: number, height: number): number; /** - * Returns `true` if the given texture requires mipmaps. + * Returns `true` if the given texture makes use of mipmapping. * * @param {Texture} texture - The texture. * @return {boolean} Whether mipmaps are required or not. diff --git a/types/three/src/renderers/common/TimestampQueryPool.d.ts b/types/three/src/renderers/common/TimestampQueryPool.d.ts index 5babb74674ede2..8fe992eef8b892 100644 --- a/types/three/src/renderers/common/TimestampQueryPool.d.ts +++ b/types/three/src/renderers/common/TimestampQueryPool.d.ts @@ -1,4 +1,3 @@ -import RenderContext from "./RenderContext.js"; /** * Abstract base class of a timestamp query pool. * @@ -19,13 +18,13 @@ declare abstract class TimestampQueryPool { */ constructor(maxQueries?: number); /** - * Allocate queries for a specific renderContext. + * Allocate queries for a specific uid. * * @abstract - * @param {Object} renderContext - The render context to allocate queries for. + * @param {string} uid - A unique identifier for the render context. * @returns {?number} */ - abstract allocateQueriesForContext(renderContext: RenderContext): number | null; + abstract allocateQueriesForContext(uid: string): number | null; /** * Resolve all timestamps and return data (or process them). * diff --git a/types/three/src/renderers/common/XRManager.d.ts b/types/three/src/renderers/common/XRManager.d.ts index b6c5f8e21745df..ed12c0d97337ea 100644 --- a/types/three/src/renderers/common/XRManager.d.ts +++ b/types/three/src/renderers/common/XRManager.d.ts @@ -78,6 +78,7 @@ declare class XRManager extends EventDispatcher { _controllerInputSources: (XRInputSource | null)[]; _xrRenderTarget: XRRenderTarget | null; _layers: XRLayerObject[]; + _sessionUsesLayers: boolean; _supportsLayers: boolean; _supportsGlBinding: boolean; _frameBufferTargets: @@ -208,6 +209,15 @@ declare class XRManager extends EventDispatcher { * @return {'opaque'|'additive'|'alpha-blend'|undefined} The environment blend mode. Returns `undefined` when used outside of a XR session. */ getEnvironmentBlendMode(): XREnvironmentBlendMode | undefined; + /** + * Returns the current XR binding. + * + * Creates a new binding if needed and the browser is + * capable of doing so. + * + * @return {?XRWebGLBinding} The XR binding. Returns `null` if one cannot be created. + */ + getBinding(): XRWebGLBinding | null; /** * Returns the current XR frame. * diff --git a/types/three/src/renderers/common/nodes/NodeLibrary.d.ts b/types/three/src/renderers/common/nodes/NodeLibrary.d.ts index 8e27db617d51b7..5fd9eabbec30d5 100644 --- a/types/three/src/renderers/common/nodes/NodeLibrary.d.ts +++ b/types/three/src/renderers/common/nodes/NodeLibrary.d.ts @@ -92,17 +92,17 @@ declare class NodeLibrary { /** * Adds a node class definition for the given type to the provided type library. * - * @param {any} nodeClass - The node class definition. + * @param {Node.constructor} nodeClass - The node class definition. * @param {number|string} type - The object type. - * @param {Map} library - The type library. + * @param {Map} library - The type library. */ addType(nodeClass: TNodeClass, type: TType, library: Map): void; /** * Adds a node class definition for the given class definition to the provided type library. * - * @param {any} nodeClass - The node class definition. - * @param {any} baseClass - The class definition. - * @param {WeakMap} library - The type library. + * @param {Node.constructor} nodeClass - The node class definition. + * @param {Node.constructor} baseClass - The class definition. + * @param {WeakMap} library - The type library. */ addClass( nodeClass: TNodeClass, diff --git a/types/three/src/renderers/webgpu/utils/WebGPUConstants.d.ts b/types/three/src/renderers/webgpu/utils/WebGPUConstants.d.ts index 9b5f5a4e744c3d..65adaf938fbf00 100644 --- a/types/three/src/renderers/webgpu/utils/WebGPUConstants.d.ts +++ b/types/three/src/renderers/webgpu/utils/WebGPUConstants.d.ts @@ -112,7 +112,7 @@ export enum GPUTextureFormat { // Packed 32-bit formats RGB9E5UFloat = "rgb9e5ufloat", RGB10A2Unorm = "rgb10a2unorm", - RG11B10UFloat = "rgb10a2unorm", + RG11B10UFloat = "rg11b10ufloat", // 64-bit formats diff --git a/types/three/src/textures/CompressedTexture.d.ts b/types/three/src/textures/CompressedTexture.d.ts index 33ec5b17d984f3..8112f90ee0ebda 100644 --- a/types/three/src/textures/CompressedTexture.d.ts +++ b/types/three/src/textures/CompressedTexture.d.ts @@ -39,9 +39,9 @@ export class CompressedTexture extends Texture { * @param colorSpace See {@link Texture.colorSpace .colorSpace}. Default {@link NoColorSpace} */ constructor( - mipmaps?: CompressedTextureMipmap[], - width?: number, - height?: number, + mipmaps: CompressedTextureMipmap[], + width: number, + height: number, format?: CompressedPixelFormat, type?: TextureDataType, mapping?: Mapping, @@ -71,7 +71,7 @@ export class CompressedTexture extends Texture { * The mipmaps array should contain objects with data, width and height. The mipmaps should be of the correct * format and type. */ - mipmaps: CompressedTextureMipmap[] | undefined; + mipmaps: CompressedTextureMipmap[]; /** * @override diff --git a/types/three/src/textures/Data3DTexture.d.ts b/types/three/src/textures/Data3DTexture.d.ts index 76a4db9df10ad7..99ef5ce0dd7126 100644 --- a/types/three/src/textures/Data3DTexture.d.ts +++ b/types/three/src/textures/Data3DTexture.d.ts @@ -1,4 +1,5 @@ import { MagnificationTextureFilter, MinificationTextureFilter, Wrapping } from "../constants.js"; +import { TypedArray } from "../core/BufferAttribute.js"; import { TextureImageData } from "./DataTexture.js"; import { Texture } from "./Texture.js"; @@ -40,7 +41,7 @@ export class Data3DTexture extends Texture { * @param height Height of the texture. Default `1`. * @param depth Depth of the texture. Default `1`. */ - constructor(data?: BufferSource | null, width?: number, height?: number, depth?: number); + constructor(data?: TypedArray | null, width?: number, height?: number, depth?: number); /** * Read-only flag to check if a given object is of type {@link Data3DTexture}. diff --git a/types/three/src/textures/DataTexture.d.ts b/types/three/src/textures/DataTexture.d.ts index 4b828ef18d83bc..51d2b1b982b9c2 100644 --- a/types/three/src/textures/DataTexture.d.ts +++ b/types/three/src/textures/DataTexture.d.ts @@ -6,6 +6,7 @@ import { TextureDataType, Wrapping, } from "../constants.js"; +import { TypedArray } from "../core/BufferAttribute.js"; import { Texture } from "./Texture.js"; /** @@ -51,7 +52,7 @@ export class DataTexture extends Texture { * @param colorSpace See {@link Texture.colorSpace | .colorSpace}. Default {@link NoColorSpace} */ constructor( - data?: ArrayBufferView | null, + data?: TypedArray | null, width?: number, height?: number, format?: PixelFormat, @@ -111,7 +112,7 @@ export class DataTexture extends Texture { } export interface TextureImageData { - data: ArrayBufferView; + data: TypedArray; height: number; width: number; } diff --git a/types/three/src/textures/ExternalTexture.d.ts b/types/three/src/textures/ExternalTexture.d.ts index ee84884d06d62c..8f62cacbb1cab5 100644 --- a/types/three/src/textures/ExternalTexture.d.ts +++ b/types/three/src/textures/ExternalTexture.d.ts @@ -1,11 +1,11 @@ import { Texture } from "./Texture.js"; declare class ExternalTexture extends Texture { - sourceTexture: WebGLTexture | null; + sourceTexture: WebGLTexture | GPUTexture | null; readonly isExternalTexture: true; - constructor(sourceTexture?: WebGLTexture | null); + constructor(sourceTexture?: WebGLTexture | GPUTexture | null); } export { ExternalTexture }; diff --git a/types/three/src/textures/Texture.d.ts b/types/three/src/textures/Texture.d.ts index 8c82c4694bcafc..a9e9ba2dea06db 100644 --- a/types/three/src/textures/Texture.d.ts +++ b/types/three/src/textures/Texture.d.ts @@ -207,7 +207,7 @@ export class Texture extends EventDispatcher<{ dispose: {} }> { * Array of user-specified mipmaps * @defaultValue `[]` */ - mipmaps: CompressedTextureMipmap[] | CubeTexture[] | HTMLCanvasElement[] | undefined; + mipmaps: CompressedTextureMipmap[] | CubeTexture[] | HTMLCanvasElement[]; /** * How the image is applied to the object. diff --git a/types/three/test/unit/examples/jsm/exporters/STLExporter.ts b/types/three/test/unit/examples/jsm/exporters/STLExporter.ts index c6bbb3f2579156..973df426a3b4ec 100644 --- a/types/three/test/unit/examples/jsm/exporters/STLExporter.ts +++ b/types/three/test/unit/examples/jsm/exporters/STLExporter.ts @@ -11,8 +11,8 @@ function exportASCII() { } function exportBinary() { - const result = exporter.parse(mesh, { binary: true }); // $ExpectType DataView || DataView - saveArrayBuffer(result as BufferSource, "box.stl"); + const result = exporter.parse(mesh, { binary: true }); + saveArrayBuffer(result, "box.stl"); } const link = document.createElement("a"); From 60c5021317114c9d3d757d2dd33febf1b0ec0d47 Mon Sep 17 00:00:00 2001 From: Erwan Jugand <47392755+erwanjugand@users.noreply.github.com> Date: Wed, 3 Sep 2025 20:56:05 +0200 Subject: [PATCH 4/7] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#73565=20[chrom?= =?UTF-8?q?e]=20update=20idle=20namespace=20by=20@erwanjugand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/chrome/index.d.ts | 33 +++++++++++++++++++-------------- types/chrome/test/index.ts | 28 ++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 14 deletions(-) diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index 0877bb81b81536..17437884f2aa8f 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -6121,38 +6121,43 @@ declare namespace chrome { * Permissions: "idle" */ export namespace idle { - export type IdleState = "active" | "idle" | "locked"; - export interface IdleStateChangedEvent extends chrome.events.Event<(newState: IdleState) => void> {} + /** @since Chrome 44 */ + export enum IdleState { + ACTIVE = "active", + IDLE = "idle", + LOCKED = "locked", + } /** * Returns "locked" if the system is locked, "idle" if the user has not generated any input for a specified number of seconds, or "active" otherwise. * @param detectionIntervalInSeconds The system is considered idle if detectionIntervalInSeconds seconds have elapsed since the last user input detected. - * @since Chrome 116 - */ - export function queryState(detectionIntervalInSeconds: number): Promise; - /** - * Returns "locked" if the system is locked, "idle" if the user has not generated any input for a specified number of seconds, or "active" otherwise. - * @param detectionIntervalInSeconds The system is considered idle if detectionIntervalInSeconds seconds have elapsed since the last user input detected. - * @since Chrome 25 + * + * Can return its result via Promise in Manifest V3 or later since Chrome 116. */ - export function queryState(detectionIntervalInSeconds: number, callback: (newState: IdleState) => void): void; + export function queryState(detectionIntervalInSeconds: number): Promise<`${IdleState}`>; + export function queryState( + detectionIntervalInSeconds: number, + callback: (newState: `${IdleState}`) => void, + ): void; /** * Sets the interval, in seconds, used to determine when the system is in an idle state for onStateChanged events. The default interval is 60 seconds. - * @since Chrome 25 * @param intervalInSeconds Threshold, in seconds, used to determine when the system is in an idle state. */ export function setDetectionInterval(intervalInSeconds: number): void; /** - * Gets the time, in seconds, it takes until the screen is locked automatically while idle. Returns a zero duration if the screen is never locked automatically. Currently supported on Chrome OS only. - * Parameter delay: Time, in seconds, until the screen is locked automatically while idle. This is zero if the screen never locks automatically. + * Gets the time, in seconds, it takes until the screen is locked automatically while idle. Returns a zero duration if the screen is never locked automatically. + * + * Can return its result via Promise in Manifest V3 or later since Chrome 116. + * @since Chrome 73 + * @platform ChromeOS only */ export function getAutoLockDelay(): Promise; export function getAutoLockDelay(callback: (delay: number) => void): void; /** Fired when the system changes to an active, idle or locked state. The event fires with "locked" if the screen is locked or the screensaver activates, "idle" if the system is unlocked and the user has not generated any input for a specified number of seconds, and "active" when the user generates input on an idle system. */ - export var onStateChanged: IdleStateChangedEvent; + export const onStateChanged: events.Event<(newState: `${IdleState}`) => void>; } //////////////////// diff --git a/types/chrome/test/index.ts b/types/chrome/test/index.ts index fcf3e28396ea07..8a7839c482bec4 100644 --- a/types/chrome/test/index.ts +++ b/types/chrome/test/index.ts @@ -4476,6 +4476,34 @@ function testIdentity() { chrome.identity.removeCachedAuthToken(invalidTokenDetails, () => void 0).then(() => void 0); } +// https://developer.chrome.com/docs/extensions/reference/api/idle +function testIdle() { + chrome.idle.IdleState.ACTIVE === "active"; + chrome.idle.IdleState.IDLE === "idle"; + chrome.idle.IdleState.LOCKED === "locked"; + + chrome.idle.getAutoLockDelay(); // $ExpectType Promise + chrome.idle.getAutoLockDelay(delay => { // $ExpectType void + delay; // $ExpectType number + }); + // @ts-expect-error + chrome.idle.getAutoLockDelay(() => {}).then(() => {}); + + const intervalInSeconds = 2; + chrome.idle.queryState(intervalInSeconds); // $ExpectType Promise<"active" | "idle" | "locked"> + chrome.idle.queryState(intervalInSeconds, (newState) => { // $ExpectType void + newState; // $ExpectType "active" | "idle" | "locked" + }); + // @ts-expect-error + chrome.idle.queryState(intervalInSeconds, () => {}).then(() => {}); + + chrome.idle.setDetectionInterval(intervalInSeconds); // $ExpectType void + + checkChromeEvent(chrome.idle.onStateChanged, (newState) => { + newState; // $ExpectType "active" | "idle" | "locked" + }); +} + // https://developer.chrome.com/docs/extensions/reference/topSites/ function testTopSites() { chrome.topSites.get(() => {}); From a355d17007015ce37a1b8b42d5879029582de400 Mon Sep 17 00:00:00 2001 From: Sam Ramon <15154970+samantharamon@users.noreply.github.com> Date: Wed, 3 Sep 2025 12:26:56 -0700 Subject: [PATCH 5/7] [office-js][office-js-preview] (Dialog) Add a link to conceptual article (#73610) --- types/office-js-preview/index.d.ts | 29 +++++++++++++++++++---------- types/office-js/index.d.ts | 29 +++++++++++++++++++---------- 2 files changed, 38 insertions(+), 20 deletions(-) diff --git a/types/office-js-preview/index.d.ts b/types/office-js-preview/index.d.ts index 5babeff8560215..65b5bbaa3637d6 100644 --- a/types/office-js-preview/index.d.ts +++ b/types/office-js-preview/index.d.ts @@ -611,19 +611,28 @@ declare namespace Office { */ BindingSelectionChanged, /** - * Triggers when Dialog has an event, such as dialog closed or dialog navigation failed. + * Occurs when a dialog is closed or when dialog navigation failed. + * + * For guidance on how to implement a dialog in your add-in, see + * {@link https://learn.microsoft.com/office/dev/add-ins/develop/dialog-api-in-office-add-ins | Use the Office dialog API in Office Add-ins}. */ DialogEventReceived, /** - * Triggers when a dialog sends a message via `messageParent`. + * Occurs when a dialog sends a message using `Office.context.ui.messageParent`. + * + * For guidance on how to implement a dialog in your add-in, see + * {@link https://learn.microsoft.com/office/dev/add-ins/develop/dialog-api-in-office-add-ins | Use the Office dialog API in Office Add-ins}. */ DialogMessageReceived, /** - * Triggers when a host page sends a message to a child dialog box with `messageChild`. + * Occurs when a host page sends a message to a child dialog box with `Dialog.messageChild`. + * + * For guidance on how to implement a dialog in your add-in, see + * {@link https://learn.microsoft.com/office/dev/add-ins/develop/dialog-api-in-office-add-ins | Use the Office dialog API in Office Add-ins}. */ DialogParentMessageReceived, /** - * Triggers when a document-level selection happens in Excel or Word. + * Occurs when a document-level selection happens in Excel or Word. */ DocumentSelectionChanged, /** @@ -699,15 +708,15 @@ declare namespace Office { */ DragAndDropEvent, /** - * Triggers when a `customXmlPart` node is deleted. + * Occurs when a `customXmlPart` node is deleted. */ NodeDeleted, /** - * Triggers when a `customXmlPart` node is inserted. + * Occurs when a `customXmlPart` node is inserted. */ NodeInserted, /** - * Triggers when a `customXmlPart` node is replaced. + * Occurs when a `customXmlPart` node is replaced. */ NodeReplaced, /** @@ -752,7 +761,7 @@ declare namespace Office { */ RecurrenceChanged, /** - * Triggers when a Resource selection happens in Project. + * Occurs when a Resource selection happens in Project. */ ResourceSelectionChanged, /** @@ -789,11 +798,11 @@ declare namespace Office { */ SpamReporting, /** - * Triggers when a Task selection happens in Project. + * Occurs when a Task selection happens in Project. */ TaskSelectionChanged, /** - * Triggers when a View selection happens in Project. + * Occurs when a View selection happens in Project. */ ViewSelectionChanged } diff --git a/types/office-js/index.d.ts b/types/office-js/index.d.ts index 8c2781ecaad037..ddc4072e31ca83 100644 --- a/types/office-js/index.d.ts +++ b/types/office-js/index.d.ts @@ -611,19 +611,28 @@ declare namespace Office { */ BindingSelectionChanged, /** - * Triggers when Dialog has an event, such as dialog closed or dialog navigation failed. + * Occurs when a dialog is closed or when dialog navigation failed. + * + * For guidance on how to implement a dialog in your add-in, see + * {@link https://learn.microsoft.com/office/dev/add-ins/develop/dialog-api-in-office-add-ins | Use the Office dialog API in Office Add-ins}. */ DialogEventReceived, /** - * Triggers when a dialog sends a message via `messageParent`. + * Occurs when a dialog sends a message using `Office.context.ui.messageParent`. + * + * For guidance on how to implement a dialog in your add-in, see + * {@link https://learn.microsoft.com/office/dev/add-ins/develop/dialog-api-in-office-add-ins | Use the Office dialog API in Office Add-ins}. */ DialogMessageReceived, /** - * Triggers when a host page sends a message to a child dialog box with `messageChild`. + * Occurs when a host page sends a message to a child dialog box with `Dialog.messageChild`. + * + * For guidance on how to implement a dialog in your add-in, see + * {@link https://learn.microsoft.com/office/dev/add-ins/develop/dialog-api-in-office-add-ins | Use the Office dialog API in Office Add-ins}. */ DialogParentMessageReceived, /** - * Triggers when a document-level selection happens in Excel or Word. + * Occurs when a document-level selection happens in Excel or Word. */ DocumentSelectionChanged, /** @@ -699,15 +708,15 @@ declare namespace Office { */ DragAndDropEvent, /** - * Triggers when a `customXmlPart` node is deleted. + * Occurs when a `customXmlPart` node is deleted. */ NodeDeleted, /** - * Triggers when a `customXmlPart` node is inserted. + * Occurs when a `customXmlPart` node is inserted. */ NodeInserted, /** - * Triggers when a `customXmlPart` node is replaced. + * Occurs when a `customXmlPart` node is replaced. */ NodeReplaced, /** @@ -752,7 +761,7 @@ declare namespace Office { */ RecurrenceChanged, /** - * Triggers when a Resource selection happens in Project. + * Occurs when a Resource selection happens in Project. */ ResourceSelectionChanged, /** @@ -789,11 +798,11 @@ declare namespace Office { */ SpamReporting, /** - * Triggers when a Task selection happens in Project. + * Occurs when a Task selection happens in Project. */ TaskSelectionChanged, /** - * Triggers when a View selection happens in Project. + * Occurs when a View selection happens in Project. */ ViewSelectionChanged } From e859ad784105d0f2280475a6331640d94d49f14e Mon Sep 17 00:00:00 2001 From: Jonas Strassel Date: Wed, 3 Sep 2025 21:48:38 +0200 Subject: [PATCH 6/7] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#73564=20fix(ns?= =?UTF-8?q?qjs):=20Change=20timestamp=20type=20from=20number=20to=20bigint?= =?UTF-8?q?=20by=20@boredland?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/nsqjs/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/nsqjs/index.d.ts b/types/nsqjs/index.d.ts index 8e53eddd75c275..2c78b3142d46c5 100644 --- a/types/nsqjs/index.d.ts +++ b/types/nsqjs/index.d.ts @@ -13,7 +13,7 @@ export class Message extends events.EventEmitter { body: Buffer; hasResponded: boolean; attempts: number; - timestamp: number; + timestamp: bigint; constructor(rawMessage: Buffer, requeueDelay: number, msgTimeout: number, maxMsgTimeout: number); From 042dd4f916c31f593de3d9b3f0b8f66b158436a0 Mon Sep 17 00:00:00 2001 From: Boris Moiseev Date: Thu, 4 Sep 2025 00:04:56 +0300 Subject: [PATCH 7/7] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#73555=20Add=20?= =?UTF-8?q?type=20definitions=20for=20emailjs-utf7=20by=20@cyberbobs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Boris Moiseev --- types/emailjs-utf7/.npmignore | 5 +++ types/emailjs-utf7/emailjs-utf7-tests.ts | 42 ++++++++++++++++++++++++ types/emailjs-utf7/index.d.ts | 34 +++++++++++++++++++ types/emailjs-utf7/package.json | 17 ++++++++++ types/emailjs-utf7/tsconfig.json | 19 +++++++++++ 5 files changed, 117 insertions(+) create mode 100644 types/emailjs-utf7/.npmignore create mode 100644 types/emailjs-utf7/emailjs-utf7-tests.ts create mode 100644 types/emailjs-utf7/index.d.ts create mode 100644 types/emailjs-utf7/package.json create mode 100644 types/emailjs-utf7/tsconfig.json diff --git a/types/emailjs-utf7/.npmignore b/types/emailjs-utf7/.npmignore new file mode 100644 index 00000000000000..93e307400a5456 --- /dev/null +++ b/types/emailjs-utf7/.npmignore @@ -0,0 +1,5 @@ +* +!**/*.d.ts +!**/*.d.cts +!**/*.d.mts +!**/*.d.*.ts diff --git a/types/emailjs-utf7/emailjs-utf7-tests.ts b/types/emailjs-utf7/emailjs-utf7-tests.ts new file mode 100644 index 00000000000000..46143a77ad0690 --- /dev/null +++ b/types/emailjs-utf7/emailjs-utf7-tests.ts @@ -0,0 +1,42 @@ +import { decode, encode, encodeAll, imapDecode, imapEncode } from "emailjs-utf7"; + +// @ts-expect-error +encode(); +encode("testing", "testmask"); // $ExpectType string +encode("testing"); // $ExpectType string +// @ts-expect-error +encode(5); +// @ts-expect-error +encode(true); + +// @ts-expect-error +encodeAll(); +encodeAll("testing"); // $ExpectType string +// @ts-expect-error +encodeAll(5); +// @ts-expect-error +encodeAll(true); + +// @ts-expect-error +decode(); +decode("BCgEMAQxBDsEPgQ9BEs"); // $ExpectType string +// @ts-expect-error +decode(5); +// @ts-expect-error +decode(true); + +// @ts-expect-error +imapEncode(); +imapEncode("testing"); // $ExpectType string +// @ts-expect-error +imapEncode(5); +// @ts-expect-error +imapEncode(true); + +// @ts-expect-error +imapDecode(); +imapDecode("&BCgEMAQxBDsEPgQ9BEs-"); // $ExpectType string +// @ts-expect-error +imapDecode(5); +// @ts-expect-error +imapDecode(true); diff --git a/types/emailjs-utf7/index.d.ts b/types/emailjs-utf7/index.d.ts new file mode 100644 index 00000000000000..913b53499ae7b2 --- /dev/null +++ b/types/emailjs-utf7/index.d.ts @@ -0,0 +1,34 @@ +/** + * Encodes string to UTF-7, see RFC 2152 + * @param str String to encode + * @param mask (optional) Characters to encode, defaults to RFC 2152 Set D + */ +export function encode(str: string, mask?: string): string; + +/** + * Encodes string to UTF-7 with all optionals, see RFC 2152 + * @param str String to encode + */ +export function encodeAll(str: string): string; + +/** + * Decodes UTF-7 string, see RFC 2152 + * @param str String to decode + */ +export function decode(str: string): string; + +/** + * Encodes string to UTF-7 with all optionals, see RFC 3501 + * + * All printable ASCII chars except for & must be represented by themselves. + * We replace subsequent non-representable chars with their escape sequence. + * + * @param str String to encode + */ +export function imapEncode(str: string): string; + +/** + * Decodes UTF-7 string, see RFC 3501 + * @param str String to decode + */ +export function imapDecode(str: string): string; diff --git a/types/emailjs-utf7/package.json b/types/emailjs-utf7/package.json new file mode 100644 index 00000000000000..7252c343b8d15f --- /dev/null +++ b/types/emailjs-utf7/package.json @@ -0,0 +1,17 @@ +{ + "private": true, + "name": "@types/emailjs-utf7", + "version": "4.0.9999", + "projects": [ + "https://github.com/emailjs/emailjs-utf7" + ], + "devDependencies": { + "@types/emailjs-utf7": "workspace:." + }, + "owners": [ + { + "name": "Boris Moiseev", + "githubUsername": "cyberbobs" + } + ] +} diff --git a/types/emailjs-utf7/tsconfig.json b/types/emailjs-utf7/tsconfig.json new file mode 100644 index 00000000000000..796f2b2c900b74 --- /dev/null +++ b/types/emailjs-utf7/tsconfig.json @@ -0,0 +1,19 @@ +{ + "compilerOptions": { + "module": "node16", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictFunctionTypes": true, + "strictNullChecks": true, + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "emailjs-utf7-tests.ts" + ] +}