From ffbbd45fb956c7ca40228be25441d64d59588cfa Mon Sep 17 00:00:00 2001 From: Marc-Stefan Cassola Date: Tue, 3 May 2022 15:07:25 +0100 Subject: [PATCH] fix: SavePass constructor (#213) * fixed SavePass constructor parameter being optional * fixed SavePass constructor parameter being optional * added to contributors table * added test to tsconfig * removed savepass from other files --- README.md | 1 + types/three/OTHER_FILES.txt | 1 - types/three/examples/jsm/postprocessing/SavePass.d.ts | 2 +- .../three/test/postprocessing/postprocessing-savepass.ts | 8 ++++++++ types/three/tsconfig.json | 1 + 5 files changed, 11 insertions(+), 2 deletions(-) create mode 100644 types/three/test/postprocessing/postprocessing-savepass.ts diff --git a/README.md b/README.md index c1cf5dcde..795cbad4a 100644 --- a/README.md +++ b/README.md @@ -68,6 +68,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d
Gianmarco

💻
David Peicho

💻
Subhankar Pal

💻 📖 +
Maccesch

💻 ⚠️ diff --git a/types/three/OTHER_FILES.txt b/types/three/OTHER_FILES.txt index ecead43b9..959927e51 100644 --- a/types/three/OTHER_FILES.txt +++ b/types/three/OTHER_FILES.txt @@ -118,7 +118,6 @@ examples/jsm/postprocessing/OutlinePass.d.ts examples/jsm/postprocessing/RenderPass.d.ts examples/jsm/postprocessing/BloomPass.d.ts examples/jsm/postprocessing/SAOPass.d.ts -examples/jsm/postprocessing/SavePass.d.ts examples/jsm/postprocessing/SMAAPass.d.ts examples/jsm/postprocessing/SSAARenderPass.d.ts examples/jsm/postprocessing/SSAOPass.d.ts diff --git a/types/three/examples/jsm/postprocessing/SavePass.d.ts b/types/three/examples/jsm/postprocessing/SavePass.d.ts index c697df02d..45a97d5f9 100644 --- a/types/three/examples/jsm/postprocessing/SavePass.d.ts +++ b/types/three/examples/jsm/postprocessing/SavePass.d.ts @@ -3,7 +3,7 @@ import { ShaderMaterial, WebGLRenderTarget } from '../../../src/Three'; import { Pass } from './Pass'; export class SavePass extends Pass { - constructor(renderTarget: WebGLRenderTarget); + constructor(renderTarget?: WebGLRenderTarget); textureID: string; renderTarget: WebGLRenderTarget; uniforms: object; diff --git a/types/three/test/postprocessing/postprocessing-savepass.ts b/types/three/test/postprocessing/postprocessing-savepass.ts new file mode 100644 index 000000000..490ac60f0 --- /dev/null +++ b/types/three/test/postprocessing/postprocessing-savepass.ts @@ -0,0 +1,8 @@ +import * as THREE from 'three'; +import { SavePass } from 'three/examples/jsm/postprocessing/SavePass'; + +let pass = new SavePass(); // $ExpectType SavePass +let rt = pass.renderTarget; // $ExpectType WebGLRenderTarget + +pass = new SavePass(new THREE.WebGLRenderTarget(128, 128)); // $ExpectType SavePass +rt = pass.renderTarget; // $ExpectType WebGLRenderTarget diff --git a/types/three/tsconfig.json b/types/three/tsconfig.json index a76d11e10..171cde01d 100644 --- a/types/three/tsconfig.json +++ b/types/three/tsconfig.json @@ -56,6 +56,7 @@ "test/misc/misc-gpucomputationrender.ts", "test/postprocessing/postprocessing-ssr.ts", "test/postprocessing/postprocessing-effectcomposer-pass.ts", + "test/postprocessing/postprocessing-savepass.ts", "test/renderers/renderers-renderTarget-multiple.ts", "test/renderers/renderers-renderTarget-texture2DArray.ts", "test/renderers/webxr/webxr-vr-cube.ts",