From f050450fa09aebf5ed498594abb23006bbe54aad Mon Sep 17 00:00:00 2001 From: javiertury Date: Thu, 24 Apr 2025 08:35:21 +0200 Subject: [PATCH 1/8] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#72452=20fix(ko?= =?UTF-8?q?a-generic-session):=20context=20extension=20#72440=20by=20@javi?= =?UTF-8?q?ertury?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/koa-generic-session/index.d.ts | 2 +- types/koa-generic-session/koa-generic-session-tests.ts | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/types/koa-generic-session/index.d.ts b/types/koa-generic-session/index.d.ts index 0bd4aba7d7e305..39205709c6a428 100644 --- a/types/koa-generic-session/index.d.ts +++ b/types/koa-generic-session/index.d.ts @@ -43,7 +43,7 @@ declare namespace koaSession { } declare module "koa" { - interface Context { + interface ExtendableContext { sessionId: string; session: koaSession.Session | null; sessionSave: boolean | null; diff --git a/types/koa-generic-session/koa-generic-session-tests.ts b/types/koa-generic-session/koa-generic-session-tests.ts index 287ae984dbb138..62748046b57c33 100644 --- a/types/koa-generic-session/koa-generic-session-tests.ts +++ b/types/koa-generic-session/koa-generic-session-tests.ts @@ -57,7 +57,7 @@ declare module "koa-generic-session" { } } -app.use((context: Koa.Context) => { +app.use(context => { if (!context.session) { return; } @@ -67,8 +67,11 @@ app.use((context: Koa.Context) => { } context.regenerateSession(); + context.sessionSave; // $ExpectType boolean | null context.sessionSave = true; + context.session; // $ExpectType Session context.session.cookie; + context.session.foo; // $ExpectType "bar" context.session.foo = "bar"; context.session = null; }); From 9015868bd5864139332a2187dce86138bd6ec934 Mon Sep 17 00:00:00 2001 From: wgsadmin Date: Thu, 24 Apr 2025 08:59:53 +0200 Subject: [PATCH 2/8] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#72491=20chore:?= =?UTF-8?q?=20update=20woosmap.map=20by=20@wgsadmin?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: manz --- types/woosmap.map/index.d.ts | 17 ++++++++++++++++- types/woosmap.map/woosmap.map-tests.ts | 16 +++++++++------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/types/woosmap.map/index.d.ts b/types/woosmap.map/index.d.ts index 2ba8230de88a68..7783e74b894a15 100644 --- a/types/woosmap.map/index.d.ts +++ b/types/woosmap.map/index.d.ts @@ -3071,7 +3071,7 @@ declare namespace woosmap.map.localities { * A Localities Nearby request to be sent to `LocalitiesService.nearby` */ interface LocalitiesNearbyRequest { - categories?: string; + categories?: string | string[]; /** * The language code, using ISO 3166-1 Alpha-2 country codes, * indicating in which language the results should be returned, if possible. @@ -3107,11 +3107,26 @@ declare namespace woosmap.map.localities { * A Localities Search request to be sent to `LocalitiesService.search` */ interface LocalitiesSearchRequest { + /** + * The categories of points of interest to return. Multiple categories can be passed as an array of comma separated strings. + * Example: `categories=['tourism', 'education']` + */ + categories?: string | string[]; /** * Used to filter over countries. Countries must be passed as an * ISO 3166-1 Alpha-2 or Alpha-3 compatible country code. */ components: woosmap.map.localities.LocalitiesComponentRestrictions; + /** + * The categories of points of interest to exclude from results. Multiple categories can be passed as an array of comma separated strings. + * Example: `excluded_categories=['hospitality.hostel','hospitality.guest_house']` + */ + excluded_categories?: string | string[]; + /** + * The types of suggestions to exclude. + * see available types to exclude [https://developers.woosmap.com/products/localities/search/#types](https://developers.woosmap.com/products/localities/search/#types) + */ + excluded_types?: string | string[]; /** * The user entered input string. */ diff --git a/types/woosmap.map/woosmap.map-tests.ts b/types/woosmap.map/woosmap.map-tests.ts index d6f06161237a39..f6f8d1ef447b6c 100644 --- a/types/woosmap.map/woosmap.map-tests.ts +++ b/types/woosmap.map/woosmap.map-tests.ts @@ -560,14 +560,16 @@ promiseLocalitiesGeocode.then((result) => { // $ExpectType LocalitiesGeocodeResponse result; }); - const localitiesSearchRequest = expectType({ - input: "example input", - types: ["locality", "postal_code"], - components: { country: ["FR"] }, - location: { lat: 43.2, lng: 2.3 }, - radius: 50000, - language: "en", + input: "royal al", + types: ["point_of_interest", "address"], + language: "EN", + components: { country: ["GB", "FR"] }, + radius: 5000000, + location: { lat: 51.5007, lng: -0.1246 }, + categories: ["tourism", "hospitality"], + excluded_categories: "hospitality.hostel", + excluded_types: ["admin_level", "village"], }) as woosmap.map.localities.LocalitiesSearchRequest; const promiseLocalitiesSearch = localitiesService.search(localitiesSearchRequest); From 04011b5580fa85a8a670811ee33b0dff300caf0d Mon Sep 17 00:00:00 2001 From: "Philipp G." Date: Thu, 24 Apr 2025 09:32:08 +0200 Subject: [PATCH 3/8] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#72476=20[novnc?= =?UTF-8?q?=5F=5Fnovnc]:=20Add=20missing=20RFB=20event=20"clippingviewport?= =?UTF-8?q?"=20and=20update=20version=20to=20match=20NoVnc=20v1.6.0=20by?= =?UTF-8?q?=20@pgmystery?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/novnc__novnc/index.d.ts | 12 ++++++++++++ types/novnc__novnc/novnc__novnc-tests.ts | 1 + types/novnc__novnc/package.json | 2 +- 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/types/novnc__novnc/index.d.ts b/types/novnc__novnc/index.d.ts index 2e0eb0a33f7b2e..fcc5d398b6e357 100644 --- a/types/novnc__novnc/index.d.ts +++ b/types/novnc__novnc/index.d.ts @@ -102,6 +102,12 @@ declare module "@novnc/novnc/lib/rfb" { * value of `capabilities`. */ capabilities: CustomEvent<{ capabilities: NoVncClient["capabilities"] }>; + + /** + * The `clippingviewport` event is fired whenever `clippingViewport` changes between true and false. + * The `detail` property is a `boolean` with the new value of `clippingViewport`. + */ + clippingviewport: CustomEvent; } type NoVncEventType = keyof NoVncEvents; @@ -218,6 +224,12 @@ declare module "@novnc/novnc/lib/rfb" { power: boolean; }; + /** + * Is a `boolean` indicating if the remote session is currently being clipped to its container. + * Only relevant if `clipViewport` is enabled. + */ + readonly clippingViewport: boolean; + /** * Disconnect from the server. */ diff --git a/types/novnc__novnc/novnc__novnc-tests.ts b/types/novnc__novnc/novnc__novnc-tests.ts index 4f1a9df73a136f..d3f97a1316258e 100644 --- a/types/novnc__novnc/novnc__novnc-tests.ts +++ b/types/novnc__novnc/novnc__novnc-tests.ts @@ -14,6 +14,7 @@ const rfb = new RFB(window.document.body, "wss://example.local", { rfb.viewOnly; // $ExpectType boolean rfb.focusOnClick; // $ExpectType boolean rfb.clipViewport; // $ExpectType boolean +rfb.clippingViewport; // $ExpectType boolean rfb.dragViewport; // $ExpectType boolean rfb.scaleViewport; // $ExpectType boolean rfb.resizeSession; // $ExpectType boolean diff --git a/types/novnc__novnc/package.json b/types/novnc__novnc/package.json index 839ed85e0c1595..a2b80bd2470f6e 100644 --- a/types/novnc__novnc/package.json +++ b/types/novnc__novnc/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/novnc__novnc", - "version": "1.5.9999", + "version": "1.6.9999", "projects": [ "https://github.com/novnc/noVNC" ], From 857f9551567603675f3a12bc3037ca2e9d9be0dd Mon Sep 17 00:00:00 2001 From: Nathan Bierema Date: Thu, 24 Apr 2025 03:39:23 -0400 Subject: [PATCH 4/8] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#72585=20[three?= =?UTF-8?q?]=20r176=20by=20@Methuselah96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../examples/jsm/helpers/RapierHelper.d.ts | 13 ++++ .../examples/jsm/loaders/LottieLoader.d.ts | 4 ++ .../jsm/misc/MD2CharacterComplex.d.ts | 2 +- .../examples/jsm/physics/RapierPhysics.d.ts | 12 ++++ .../jsm/postprocessing/BokehPass.d.ts | 4 +- .../jsm/tsl/shadows/TileShadowNode.d.ts | 14 +++++ .../jsm/tsl/shadows/TileShadowNodeHelper.d.ts | 14 +++++ types/three/package.json | 3 +- types/three/src/Three.Core.d.ts | 2 + types/three/src/Three.TSL.d.ts | 8 +++ types/three/src/audio/AudioListener.d.ts | 2 +- types/three/src/cameras/ArrayCamera.d.ts | 5 ++ types/three/src/constants.d.ts | 31 +++++----- types/three/src/core/RenderTarget.d.ts | 9 +++ .../three/src/geometries/CapsuleGeometry.d.ts | 13 +++- types/three/src/lights/LightShadow.d.ts | 8 +++ types/three/src/materials/Material.d.ts | 11 +--- types/three/src/materials/ShaderMaterial.d.ts | 2 +- .../src/materials/nodes/NodeMaterial.d.ts | 12 +++- .../nodes/manager/NodeMaterialObserver.d.ts | 8 +++ types/three/src/math/FrustumArray.d.ts | 27 +++++++++ types/three/src/nodes/TSL.d.ts | 1 + .../src/nodes/accessors/InstanceNode.d.ts | 5 +- .../src/nodes/accessors/VertexColorNode.d.ts | 2 +- types/three/src/nodes/core/Node.d.ts | 13 ++-- types/three/src/nodes/core/NodeVarying.d.ts | 12 +++- types/three/src/nodes/core/StackNode.d.ts | 8 ++- types/three/src/nodes/core/VaryingNode.d.ts | 6 ++ .../src/nodes/gpgpu/AtomicFunctionNode.d.ts | 4 +- .../src/nodes/lighting/ShadowFilterNode.d.ts | 28 +++++++++ .../three/src/nodes/lighting/ShadowNode.d.ts | 50 ++++++++-------- types/three/src/nodes/math/OperatorNode.d.ts | 9 +++ types/three/src/nodes/tsl/TSLCore.d.ts | 60 +++++++++++-------- types/three/src/nodes/utils/DebugNode.d.ts | 3 +- .../three/src/nodes/utils/ReflectorNode.d.ts | 2 +- .../three/src/renderers/common/Animation.d.ts | 4 +- .../three/src/renderers/common/Renderer.d.ts | 19 ++++++ .../three/src/renderers/common/Textures.d.ts | 7 --- .../renderers/common/TimestampQueryPool.d.ts | 1 + .../three/src/renderers/common/XRManager.d.ts | 11 +++- .../src/renderers/webgpu/WebGPUBackend.d.ts | 1 + .../three/src/textures/DepthArrayTexture.d.ts | 14 +++++ types/three/src/textures/Texture.d.ts | 9 ++- .../three/src/textures/VideoFrameTexture.d.ts | 2 +- .../three/test/integration/geometry-buffer.ts | 6 +- 45 files changed, 367 insertions(+), 114 deletions(-) create mode 100644 types/three/examples/jsm/helpers/RapierHelper.d.ts create mode 100644 types/three/examples/jsm/tsl/shadows/TileShadowNode.d.ts create mode 100644 types/three/examples/jsm/tsl/shadows/TileShadowNodeHelper.d.ts create mode 100644 types/three/src/math/FrustumArray.d.ts create mode 100644 types/three/src/nodes/lighting/ShadowFilterNode.d.ts create mode 100644 types/three/src/textures/DepthArrayTexture.d.ts diff --git a/types/three/examples/jsm/helpers/RapierHelper.d.ts b/types/three/examples/jsm/helpers/RapierHelper.d.ts new file mode 100644 index 00000000000000..987cee03056c71 --- /dev/null +++ b/types/three/examples/jsm/helpers/RapierHelper.d.ts @@ -0,0 +1,13 @@ +import * as RAPIER from "@dimforge/rapier3d-compat"; +import { LineSegments } from "three"; + +declare class RapierHelper extends LineSegments { + world: RAPIER.World; + + constructor(world: RAPIER.World); + + update(): void; + dispose(): void; +} + +export { RapierHelper }; diff --git a/types/three/examples/jsm/loaders/LottieLoader.d.ts b/types/three/examples/jsm/loaders/LottieLoader.d.ts index bbade631739884..69d614e3095387 100644 --- a/types/three/examples/jsm/loaders/LottieLoader.d.ts +++ b/types/three/examples/jsm/loaders/LottieLoader.d.ts @@ -1,6 +1,10 @@ import { CanvasTexture, Loader, LoadingManager } from "three"; export class LottieLoader extends Loader { + /** + * @deprecated The loader has been deprecated and will be removed with r186. Use lottie-web instead and create your + * animated texture manually. + */ constructor(manager?: LoadingManager); load( diff --git a/types/three/examples/jsm/misc/MD2CharacterComplex.d.ts b/types/three/examples/jsm/misc/MD2CharacterComplex.d.ts index 78b0477404fcf5..418175bb690617 100644 --- a/types/three/examples/jsm/misc/MD2CharacterComplex.d.ts +++ b/types/three/examples/jsm/misc/MD2CharacterComplex.d.ts @@ -9,7 +9,7 @@ export class MD2CharacterComplex { maxReverseSpeed: number; frontAcceleration: number; backAcceleration: number; - frontDecceleration: number; + frontDeceleration: number; angularSpeed: number; root: Object3D; meshBody: Mesh | null; diff --git a/types/three/examples/jsm/physics/RapierPhysics.d.ts b/types/three/examples/jsm/physics/RapierPhysics.d.ts index 60b33e2eb116e3..0330ce7cf3e04b 100644 --- a/types/three/examples/jsm/physics/RapierPhysics.d.ts +++ b/types/three/examples/jsm/physics/RapierPhysics.d.ts @@ -1,12 +1,24 @@ +import * as RAPIER from "@dimforge/rapier3d-compat"; import { Mesh, Object3D } from "three"; type Vector = { x: number; y: number; z: number }; export interface RapierPhysicsObject { + RAPIER: typeof RAPIER; + world: RAPIER.World; addScene: (scene: Object3D) => void; addMesh: (mesh: Mesh, mass?: number, restitution?: number) => void; setMeshPosition: (mesh: Mesh, position: Vector, index?: number) => void; setMeshVelocity: (mesh: Mesh, velocity: Vector, index?: number) => void; + addHeightfield: ( + mesh: Mesh, + width: number, + depth: number, + heights: Float32Array, + scale: Vector, + ) => RAPIER.RigidBody; } export function RapierPhysics(): Promise; + +export type RAPIER = typeof RAPIER; diff --git a/types/three/examples/jsm/postprocessing/BokehPass.d.ts b/types/three/examples/jsm/postprocessing/BokehPass.d.ts index 7fd37f6450d9b0..c3c5f15bf3861f 100644 --- a/types/three/examples/jsm/postprocessing/BokehPass.d.ts +++ b/types/three/examples/jsm/postprocessing/BokehPass.d.ts @@ -2,7 +2,7 @@ import { Camera, Color, MeshDepthMaterial, Scene, ShaderMaterial, WebGLRenderTar import { FullScreenQuad, Pass } from "./Pass.js"; -export interface BokehPassParamters { +export interface BokehPassParameters { focus?: number; aspect?: number; aperture?: number; @@ -10,7 +10,7 @@ export interface BokehPassParamters { } export class BokehPass extends Pass { - constructor(scene: Scene, camera: Camera, params: BokehPassParamters); + constructor(scene: Scene, camera: Camera, params: BokehPassParameters); scene: Scene; camera: Camera; renderTargetColor: WebGLRenderTarget; diff --git a/types/three/examples/jsm/tsl/shadows/TileShadowNode.d.ts b/types/three/examples/jsm/tsl/shadows/TileShadowNode.d.ts new file mode 100644 index 00000000000000..fe0b6a9cbcb440 --- /dev/null +++ b/types/three/examples/jsm/tsl/shadows/TileShadowNode.d.ts @@ -0,0 +1,14 @@ +import { Light, ShadowBaseNode } from "three/webgpu"; + +export interface TileShadeNodeConfig { + tilesX?: number | undefined; + tilesY?: number | undefined; + resolution?: { width: number; height: number }; + debug?: boolean | undefined; +} + +declare class TileShadowNode extends ShadowBaseNode { + constructor(light: Light, options?: TileShadeNodeConfig); +} + +export { TileShadowNode }; diff --git a/types/three/examples/jsm/tsl/shadows/TileShadowNodeHelper.d.ts b/types/three/examples/jsm/tsl/shadows/TileShadowNodeHelper.d.ts new file mode 100644 index 00000000000000..3f79053e626392 --- /dev/null +++ b/types/three/examples/jsm/tsl/shadows/TileShadowNodeHelper.d.ts @@ -0,0 +1,14 @@ +import { Group } from "three/webgpu"; +import { TileShadowNode } from "./TileShadowNode.js"; + +declare class TileShadowNodeHelper extends Group { + constructor(tileShadowNode: TileShadowNode); + + init(): void; + + update(): void; + + dispose(): void; +} + +export { TileShadowNodeHelper }; diff --git a/types/three/package.json b/types/three/package.json index 2eaf394d9b4f25..a903fb3fd933a7 100644 --- a/types/three/package.json +++ b/types/three/package.json @@ -1,7 +1,7 @@ { "private": true, "name": "@types/three", - "version": "0.175.9999", + "version": "0.176.9999", "projects": [ "https://threejs.org/" ], @@ -20,6 +20,7 @@ "./tsl": "./build/three.tsl.js" }, "dependencies": { + "@dimforge/rapier3d-compat": "^0.12.0", "@tweenjs/tween.js": "~23.1.3", "@types/stats.js": "*", "@types/webxr": "*", diff --git a/types/three/src/Three.Core.d.ts b/types/three/src/Three.Core.d.ts index f43fe9c701b723..2923b3e7389628 100644 --- a/types/three/src/Three.Core.d.ts +++ b/types/three/src/Three.Core.d.ts @@ -103,6 +103,7 @@ export { ColorManagement, ColorSpaceDefinition } from "./math/ColorManagement.js export * from "./math/Cylindrical.js"; export * from "./math/Euler.js"; export * from "./math/Frustum.js"; +export * from "./math/FrustumArray.js"; export * from "./math/Interpolant.js"; export * from "./math/interpolants/CubicInterpolant.js"; export * from "./math/interpolants/DiscreteInterpolant.js"; @@ -152,6 +153,7 @@ export * from "./textures/CubeTexture.js"; export * from "./textures/Data3DTexture.js"; export * from "./textures/DataArrayTexture.js"; export * from "./textures/DataTexture.js"; +export * from "./textures/DepthArrayTexture.js"; export * from "./textures/DepthTexture.js"; export * from "./textures/FramebufferTexture.js"; export * from "./textures/Source.js"; diff --git a/types/three/src/Three.TSL.d.ts b/types/three/src/Three.TSL.d.ts index 1205918a211bb5..d1da8209795a43 100644 --- a/types/three/src/Three.TSL.d.ts +++ b/types/three/src/Three.TSL.d.ts @@ -13,6 +13,7 @@ export const F_Schlick: typeof TSL.F_Schlick; export const Fn: typeof TSL.Fn; export const INFINITY: typeof TSL.INFINITY; export const If: typeof TSL.If; +export const Switch: typeof TSL.Switch; export const Loop: typeof TSL.Loop; export const NodeShaderStage: typeof TSL.NodeShaderStage; export const NodeType: typeof TSL.NodeType; @@ -130,6 +131,8 @@ export const dFdx: typeof TSL.dFdx; export const dFdy: typeof TSL.dFdy; export const dashSize: typeof TSL.dashSize; export const debug: typeof TSL.debug; +export const decrement: typeof TSL.decrement; +export const decrementBefore: typeof TSL.decrementBefore; export const defaultBuildStages: typeof TSL.defaultBuildStages; export const defaultShaderStages: typeof TSL.defaultShaderStages; export const defined: typeof TSL.defined; @@ -183,6 +186,8 @@ export const getScreenPosition: typeof TSL.getScreenPosition; export const getShIrradianceAt: typeof TSL.getShIrradianceAt; export const getTextureIndex: typeof TSL.getTextureIndex; export const getViewPosition: typeof TSL.getViewPosition; +export const getShadowMaterial: typeof TSL.getShadowMaterial; +export const getShadowRenderObjectFunction: typeof TSL.getShadowRenderObjectFunction; export const glsl: typeof TSL.glsl; export const glslFn: typeof TSL.glslFn; export const grayscale: typeof TSL.grayscale; @@ -192,6 +197,8 @@ export const hash: typeof TSL.hash; export const highpModelNormalViewMatrix: typeof TSL.highpModelNormalViewMatrix; export const highPrecisionModelViewMatrix: typeof TSL.highpModelViewMatrix; export const hue: typeof TSL.hue; +export const increment: typeof TSL.increment; +export const incrementBefore: typeof TSL.incrementBefore; export const instance: typeof TSL.instance; export const instanceIndex: typeof TSL.instanceIndex; export const instancedArray: typeof TSL.instancedArray; @@ -217,6 +224,7 @@ export const lengthSq: typeof TSL.lengthSq; export const lessThan: typeof TSL.lessThan; export const lessThanEqual: typeof TSL.lessThanEqual; export const lightPosition: typeof TSL.lightPosition; +export const lightShadowMatrix: typeof TSL.lightShadowMatrix; export const lightTargetDirection: typeof TSL.lightTargetDirection; export const lightTargetPosition: typeof TSL.lightTargetPosition; export const lightViewPosition: typeof TSL.lightViewPosition; diff --git a/types/three/src/audio/AudioListener.d.ts b/types/three/src/audio/AudioListener.d.ts index a49e4d5c762226..743d67ea2f3373 100644 --- a/types/three/src/audio/AudioListener.d.ts +++ b/types/three/src/audio/AudioListener.d.ts @@ -4,7 +4,7 @@ import { AudioContext } from "./AudioContext.js"; /** * The {@link AudioListener} represents a virtual {@link https://developer.mozilla.org/en-US/docs/Web/API/AudioListener | listener} of the all positional and non-positional audio effects in the scene. * A three.js application usually creates a single instance of {@link AudioListener} * @remarks - * It is a mandatory construtor parameter for audios entities like {@link Audio | Audio} and {@link PositionalAudio | PositionalAudio}. + * It is a mandatory constructor parameter for audios entities like {@link Audio | Audio} and {@link PositionalAudio | PositionalAudio}. * In most cases, the listener object is a child of the camera * So the 3D transformation of the camera represents the 3D transformation of the listener. * @example diff --git a/types/three/src/cameras/ArrayCamera.d.ts b/types/three/src/cameras/ArrayCamera.d.ts index 9527123ae10309..314e6342fad86d 100644 --- a/types/three/src/cameras/ArrayCamera.d.ts +++ b/types/three/src/cameras/ArrayCamera.d.ts @@ -18,6 +18,11 @@ export class ArrayCamera extends PerspectiveCamera { */ readonly isArrayCamera: true; + /** + * Whether this camera is used with multiview rendering or not. + */ + isMultiViewCamera: boolean; + /** * An array of cameras. * @defaultValue `[]` diff --git a/types/three/src/constants.d.ts b/types/three/src/constants.d.ts index 3ecc1fc12a76d1..7399e7408b108c 100644 --- a/types/three/src/constants.d.ts +++ b/types/three/src/constants.d.ts @@ -371,19 +371,6 @@ export const RGBFormat: 1022; /** {@link RGBAFormat} is the default and reads the red, green, blue and alpha components. */ export const RGBAFormat: 1023; -/** - * {@link LuminanceFormat} reads each element as a single luminance component. - * This is then converted to a floating point, clamped to the range `[0,1]`, and then assembled into an RGBA element by - * placing the luminance value in the red, green and blue channels, and attaching `1.0` to the alpha channel. - */ -export const LuminanceFormat: 1024; - -/** - * {@link LuminanceAlphaFormat} reads each element as a luminance/alpha double. - * The same process occurs as for the {@link LuminanceFormat}, except that the alpha channel may have values other than `1.0`. - */ -export const LuminanceAlphaFormat: 1025; - /** * {@link DepthFormat} reads each element as a single depth value, converts it to floating point, and clamps to the range `[0,1]`. * @remarks This is the default for {@link THREE.DepthTexture}. @@ -440,8 +427,6 @@ export type PixelFormat = | typeof AlphaFormat | typeof RGBFormat | typeof RGBAFormat - | typeof LuminanceFormat - | typeof LuminanceAlphaFormat | typeof DepthFormat | typeof DepthStencilFormat | typeof RedFormat @@ -797,6 +782,22 @@ export const TimestampQuery: { }; export type TimestampQuery = "compute" | "render"; +export const InterpolationSamplingType: { + PERSPECTIVE: "perspective"; + LINEAR: "linear"; + FLAT: "flat"; +}; +export type InterpolationSamplingType = "perspective" | "linear" | "flat"; + +export const InterpolationSamplingMode: { + NORMAL: "normal"; + CENTROID: "centroid"; + SAMPLE: "sample"; + FLAT_FIRST: "flat first"; + FLAT_EITHER: "flat either"; +}; +export type InterpolationSamplingMode = "normal" | "centroid" | "sample" | "flat first" | "flat either"; + /////////////////////////////////////////////////////////////////////////////// // Texture - Internal Pixel Formats diff --git a/types/three/src/core/RenderTarget.d.ts b/types/three/src/core/RenderTarget.d.ts index 4dca484775be18..86ace31f94c123 100644 --- a/types/three/src/core/RenderTarget.d.ts +++ b/types/three/src/core/RenderTarget.d.ts @@ -11,6 +11,7 @@ import { Texture } from "../textures/Texture.js"; import { EventDispatcher } from "./EventDispatcher.js"; export interface RenderTargetOptions { + depth?: number | undefined; wrapS?: Wrapping | undefined; wrapT?: Wrapping | undefined; magFilter?: MagnificationTextureFilter | undefined; @@ -32,6 +33,7 @@ export interface RenderTargetOptions { */ samples?: number | undefined; count?: number | undefined; + multiview?: boolean | undefined; } export class RenderTarget extends EventDispatcher<{ dispose: {} }> { @@ -78,6 +80,13 @@ export class RenderTarget extend */ samples: number; + /** + * Whether to this target is used in multiview rendering. + * + * @default false + */ + multiview: boolean; + constructor(width?: number, height?: number, options?: RenderTargetOptions); get texture(): TTexture; diff --git a/types/three/src/geometries/CapsuleGeometry.d.ts b/types/three/src/geometries/CapsuleGeometry.d.ts index b20616035d72f1..dba5a3daeabd9f 100644 --- a/types/three/src/geometries/CapsuleGeometry.d.ts +++ b/types/three/src/geometries/CapsuleGeometry.d.ts @@ -19,11 +19,18 @@ export class CapsuleGeometry extends BufferGeometry { /** * Create a new instance of {@link CapsuleGeometry} * @param radius Radius of the capsule. Expects a `Float`. Default `1` - * @param length Length of the middle section. Expects a `Float`. Default `1` + * @param height Height of the middle section. Expects a `Float`. Default `1` * @param capSegments Number of curve segments used to build the caps. Expects a `Integer`. Default `4` * @param radialSegments Number of segmented faces around the circumference of the capsule. Expects a `Integer`. Default `8` + * @param heightSegments Number of rows of faces along the height of the capsule. Optional; defaults to `1`. */ - constructor(radius?: number, length?: number, capSegments?: number, radialSegments?: number); + constructor( + radius?: number, + height?: number, + capSegments?: number, + radialSegments?: number, + heightSegments?: number, + ); /** * A Read-only _string_ to check if `this` object type. @@ -38,7 +45,7 @@ export class CapsuleGeometry extends BufferGeometry { */ readonly parameters: { readonly radius: number; - readonly length: number; + readonly height: number; readonly capSegments: number; readonly radialSegments: number; }; diff --git a/types/three/src/lights/LightShadow.d.ts b/types/three/src/lights/LightShadow.d.ts index 53c163c3e7dbf5..a2b02513dcfd11 100644 --- a/types/three/src/lights/LightShadow.d.ts +++ b/types/three/src/lights/LightShadow.d.ts @@ -1,4 +1,5 @@ import { Camera } from "../cameras/Camera.js"; +import { TextureDataType } from "../constants.js"; import { Object3DJSONObject } from "../core/Object3D.js"; import { Frustum } from "../math/Frustum.js"; import { Matrix4 } from "../math/Matrix4.js"; @@ -86,6 +87,13 @@ export class LightShadow { */ mapSize: Vector2; + /** + * The type of shadow texture. The default is `UnsignedByteType`. + * + * @default UnsignedByteType + */ + mapType: TextureDataType; + /** * The depth map generated using the internal camera; a location beyond a pixel's depth is in shadow. Computed internally during rendering. * @defaultValue null diff --git a/types/three/src/materials/Material.d.ts b/types/three/src/materials/Material.d.ts index c2ee58d87dcbc2..49833ec0d1fd5e 100644 --- a/types/three/src/materials/Material.d.ts +++ b/types/three/src/materials/Material.d.ts @@ -287,7 +287,7 @@ export class Material extends EventDispatcher<{ dispose: {} }> { blendDst: BlendingDstFactor; /** - * The tranparency of the .blendDst. Default is null. + * The transparency of the .blendDst. Default is null. * @default null */ blendDstAlpha: number | null; @@ -299,7 +299,7 @@ export class Material extends EventDispatcher<{ dispose: {} }> { blendEquation: BlendingEquation; /** - * The tranparency of the .blendEquation. Default is null. + * The transparency of the .blendEquation. Default is null. * @default null */ blendEquationAlpha: number | null; @@ -317,7 +317,7 @@ export class Material extends EventDispatcher<{ dispose: {} }> { blendSrc: BlendingSrcFactor | BlendingDstFactor; /** - * The tranparency of the .blendSrc. Default is null. + * The transparency of the .blendSrc. Default is null. * @default null */ blendSrcAlpha: number | null; @@ -628,9 +628,4 @@ export class Material extends EventDispatcher<{ dispose: {} }> { * @default false */ set needsUpdate(value: boolean); - - /** - * @deprecated onBuild() has been removed. - */ - onBuild(object: Object3D, parameters: WebGLProgramParametersWithUniforms, renderer: WebGLRenderer): void; } diff --git a/types/three/src/materials/ShaderMaterial.d.ts b/types/three/src/materials/ShaderMaterial.d.ts index 53e07a8216cef4..227ab8170a78ee 100644 --- a/types/three/src/materials/ShaderMaterial.d.ts +++ b/types/three/src/materials/ShaderMaterial.d.ts @@ -61,7 +61,7 @@ export interface ShaderMaterialJSON extends MaterialJSON { defines?: Record; vertexShader: string; - ragmentShader: string; + fragmentShader: string; lights: boolean; clipping: boolean; diff --git a/types/three/src/materials/nodes/NodeMaterial.d.ts b/types/three/src/materials/nodes/NodeMaterial.d.ts index 9f99bd0479abf8..b1dee21bf47d3b 100644 --- a/types/three/src/materials/nodes/NodeMaterial.d.ts +++ b/types/three/src/materials/nodes/NodeMaterial.d.ts @@ -27,7 +27,8 @@ export interface NodeMaterialParameters extends MaterialParameters { geometryNode?: Node | null | undefined; depthNode?: Node | null | undefined; - shadowNode?: Node | null | undefined; + receivedShadowPositionNode?: Node | null | undefined; + castShadowPositionNode?: Node | null | undefined; outputNode?: Node | null | undefined; @@ -59,7 +60,8 @@ declare class NodeMaterial extends Material { geometryNode: Node | null; depthNode: Node | null; - shadowPositionNode: Node | null; + receivedShadowPositionNode: Node | null; + castShadowPositionNode: Node | null; receivedShadowNode: (() => Node) | null; castShadowNode: Node | null; @@ -69,6 +71,12 @@ declare class NodeMaterial extends Material { fragmentNode: Node | null; vertexNode: Node | null; + /** + * @deprecated ".shadowPositionNode" was renamed to ".receivedShadowPositionNode".' + */ + get shadowPositionNode(): Node | null; + set shadowPositionNode(value: Node | null); + constructor(); build(builder: NodeBuilder): void; diff --git a/types/three/src/materials/nodes/manager/NodeMaterialObserver.d.ts b/types/three/src/materials/nodes/manager/NodeMaterialObserver.d.ts index b43f81c675f9bd..7058b8f8d34638 100644 --- a/types/three/src/materials/nodes/manager/NodeMaterialObserver.d.ts +++ b/types/three/src/materials/nodes/manager/NodeMaterialObserver.d.ts @@ -2,6 +2,7 @@ import { BufferAttribute } from "../../../core/BufferAttribute.js"; import { Matrix4 } from "../../../math/Matrix4.js"; import NodeBuilder from "../../../nodes/core/NodeBuilder.js"; import NodeFrame from "../../../nodes/core/NodeFrame.js"; +import Renderer from "../../../renderers/common/Renderer.js"; import RenderObject from "../../../renderers/common/RenderObject.js"; import { Material } from "../../Material.js"; declare const refreshUniforms: readonly [ @@ -103,6 +104,13 @@ declare class NodeMaterialObserver { * @return {boolean} Whether the given render object is verified for the first time of this observer. */ firstInitialization(renderObject: RenderObject): boolean; + /** + * Returns `true` if the current rendering produces motion vectors. + * + * @param {Renderer} renderer - The renderer. + * @return {boolean} Whether the current rendering produces motion vectors or not. + */ + needsVelocity(renderer: Renderer): boolean; /** * Returns monitoring data for the given render object. * diff --git a/types/three/src/math/FrustumArray.d.ts b/types/three/src/math/FrustumArray.d.ts new file mode 100644 index 00000000000000..7e179fb4a622e2 --- /dev/null +++ b/types/three/src/math/FrustumArray.d.ts @@ -0,0 +1,27 @@ +import { ArrayCamera } from "../cameras/ArrayCamera.js"; +import { CoordinateSystem } from "../constants.js"; +import { Object3D } from "../core/Object3D.js"; +import { Sprite } from "../objects/Sprite.js"; +import { Box3 } from "./Box3.js"; +import { Sphere } from "./Sphere.js"; +import { Vector3 } from "./Vector3.js"; + +declare class FrustumArray { + coordinateSystem: CoordinateSystem; + + constructor(); + + intersectsObject(object: Object3D, cameraArray: ArrayCamera): boolean; + + intersectsSprite(sprite: Sprite, cameraArray: ArrayCamera): boolean; + + intersectsSprite(sphere: Sphere, cameraArray: ArrayCamera): boolean; + + intersectsBox(box: Box3, cameraArray: ArrayCamera): boolean; + + containsPoint(point: Vector3, cameraArray: ArrayCamera): boolean; + + clone(): FrustumArray; +} + +export { FrustumArray }; diff --git a/types/three/src/nodes/TSL.d.ts b/types/three/src/nodes/TSL.d.ts index 258bc1d046300a..429e201704f2f9 100644 --- a/types/three/src/nodes/TSL.d.ts +++ b/types/three/src/nodes/TSL.d.ts @@ -135,6 +135,7 @@ export * from "./lighting/LightsNode.js"; export * from "./lighting/PointLightNode.js"; export * from "./lighting/PointShadowNode.js"; export * from "./lighting/ShadowBaseNode.js"; +export * from "./lighting/ShadowFilterNode.js"; export * from "./lighting/ShadowNode.js"; // pmrem diff --git a/types/three/src/nodes/accessors/InstanceNode.d.ts b/types/three/src/nodes/accessors/InstanceNode.d.ts index 69b76973624840..a1a5890a282c49 100644 --- a/types/three/src/nodes/accessors/InstanceNode.d.ts +++ b/types/three/src/nodes/accessors/InstanceNode.d.ts @@ -1,5 +1,4 @@ import { InstancedBufferAttribute } from "../../core/InstancedBufferAttribute.js"; -import { InstancedMesh } from "../../objects/InstancedMesh.js"; import Node from "../core/Node.js"; import { ShaderNodeObject } from "../tsl/TSLCore.js"; @@ -14,12 +13,12 @@ export default class InstanceNode extends Node { constructor( count: number, instanceMatrix: InstancedBufferAttribute, - instanceColor: InstancedBufferAttribute | null, + instanceColor?: InstancedBufferAttribute | null, ); } export const instance: ( count: number, instanceMatrix: InstancedBufferAttribute, - instanceColor: InstancedBufferAttribute | null, + instanceColor?: InstancedBufferAttribute | null, ) => ShaderNodeObject; diff --git a/types/three/src/nodes/accessors/VertexColorNode.d.ts b/types/three/src/nodes/accessors/VertexColorNode.d.ts index b2bb76339f57b3..5973a243b85932 100644 --- a/types/three/src/nodes/accessors/VertexColorNode.d.ts +++ b/types/three/src/nodes/accessors/VertexColorNode.d.ts @@ -6,7 +6,7 @@ export default class VertexColorNode extends AttributeNode { index: number; - constructor(index?: number); + constructor(index: number); } export const vertexColor: (index?: number) => ShaderNodeObject; diff --git a/types/three/src/nodes/core/Node.d.ts b/types/three/src/nodes/core/Node.d.ts index 859c99f9a1acf9..f0cab82ca76281 100644 --- a/types/three/src/nodes/core/Node.d.ts +++ b/types/three/src/nodes/core/Node.d.ts @@ -75,6 +75,7 @@ declare class Node extends EventDispatcher<{ _cacheKey: number | null; _cacheKeyVersion: number; global: boolean; + parents: boolean; readonly isNode: true; readonly id: number; self?: this; @@ -319,14 +320,16 @@ declare class Node extends EventDispatcher<{ */ update(frame: NodeFrame): void; /** - * This method performs the build of a node. The behavior of this method as well as its return value depend - * on the current build stage (setup, analyze or generate). + * This method performs the build of a node. The behavior and return value depend on the current build stage: + * - **setup**: Prepares the node and its children for the build process. This process can also create new nodes. Returns the node itself or a variant. + * - **analyze**: Analyzes the node hierarchy for optimizations in the code generation stage. Returns `null`. + * - **generate**: Generates the shader code for the node. Returns the generated shader string. * * @param {NodeBuilder} builder - The current node builder. - * @param {?string} output - Can be used to define the output type. - * @return {?string} When this method is executed in the setup or analyze stage, `null` is returned. In the generate stage, the generated shader string. + * @param {?string} [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. */ - build(builder: NodeBuilder, output?: string | null): string | null; + build(builder: NodeBuilder, output?: string | null): Node | string | null; /** * Returns the child nodes as a JSON object. * diff --git a/types/three/src/nodes/core/NodeVarying.d.ts b/types/three/src/nodes/core/NodeVarying.d.ts index 4cc9785126e74f..df9d152b9f7443 100644 --- a/types/three/src/nodes/core/NodeVarying.d.ts +++ b/types/three/src/nodes/core/NodeVarying.d.ts @@ -1,3 +1,4 @@ +import { InterpolationSamplingMode, InterpolationSamplingType } from "../../constants.js"; import NodeVar from "./NodeVar.js"; /** * {@link NodeBuilder} is going to create instances of this class during the build process @@ -10,12 +11,21 @@ import NodeVar from "./NodeVar.js"; declare class NodeVarying extends NodeVar { needsInterpolation: boolean; readonly isNodeVarying: true; + interpolationType: InterpolationSamplingType | null; + interpolationSampling: InterpolationSamplingMode | null; /** * Constructs a new node varying. * * @param {string} name - The name of the varying. * @param {string} type - The type of the varying. + * @param {?string} interpolationType - The interpolation type of the varying. + * @param {?string} interpolationSampling - The interpolation sampling type of the varying. */ - constructor(name: string, type: string | null); + constructor( + name: string, + type: string, + interpolationType?: InterpolationSamplingType | null, + interpolationSampling?: InterpolationSamplingMode | null, + ); } export default NodeVarying; diff --git a/types/three/src/nodes/core/StackNode.d.ts b/types/three/src/nodes/core/StackNode.d.ts index 7c73a63c15c1a4..b9e9816d2b9efb 100644 --- a/types/three/src/nodes/core/StackNode.d.ts +++ b/types/three/src/nodes/core/StackNode.d.ts @@ -1,4 +1,4 @@ -import { ShaderNodeObject } from "../tsl/TSLCore.js"; +import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js"; import Node from "./Node.js"; declare class StackNode extends Node { @@ -16,6 +16,12 @@ declare class StackNode extends Node { Else(method: () => void): this; + Switch(expression: NodeRepresentation): this; + + Case(...params: NodeRepresentation[]): this; + + Default(method: () => void): this; + /** * @deprecated Use {@link StackNode#ElseIf Else()} instead. */ diff --git a/types/three/src/nodes/core/VaryingNode.d.ts b/types/three/src/nodes/core/VaryingNode.d.ts index 2dd9274599b346..5d8a7c4d3640a5 100644 --- a/types/three/src/nodes/core/VaryingNode.d.ts +++ b/types/three/src/nodes/core/VaryingNode.d.ts @@ -1,3 +1,4 @@ +import { InterpolationSamplingMode, InterpolationSamplingType } from "../../constants.js"; import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js"; import Node from "./Node.js"; import NodeBuilder from "./NodeBuilder.js"; @@ -6,9 +7,14 @@ import NodeVarying from "./NodeVarying.js"; export default class VaryingNode extends Node { node: Node; name: string | null; + readonly isVaryingNode: true; + interpolationType: InterpolationSamplingType | null; + interpolationSampling: InterpolationSamplingMode | null; constructor(node: Node, name?: string | null); + setInterpolation(type: InterpolationSamplingType | null, sampling?: InterpolationSamplingMode | null): this; + setupVarying(builder: NodeBuilder): NodeVarying; } diff --git a/types/three/src/nodes/gpgpu/AtomicFunctionNode.d.ts b/types/three/src/nodes/gpgpu/AtomicFunctionNode.d.ts index c77b90e44f247a..a912230404275c 100644 --- a/types/three/src/nodes/gpgpu/AtomicFunctionNode.d.ts +++ b/types/three/src/nodes/gpgpu/AtomicFunctionNode.d.ts @@ -1,5 +1,4 @@ import Node from "../core/Node.js"; -import TempNode from "../core/TempNode.js"; import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js"; export type AtomicMethod = @@ -13,10 +12,11 @@ export type AtomicMethod = | typeof AtomicFunctionNode.ATOMIC_OR | typeof AtomicFunctionNode.ATOMIC_XOR; -declare class AtomicFunctionNode extends TempNode { +declare class AtomicFunctionNode extends Node { method: AtomicMethod; pointerNode: Node; valueNode: Node; + parents: boolean; constructor(method: AtomicMethod, pointerNode: Node, valueNode: Node); diff --git a/types/three/src/nodes/lighting/ShadowFilterNode.d.ts b/types/three/src/nodes/lighting/ShadowFilterNode.d.ts new file mode 100644 index 00000000000000..a34055b3dbc70a --- /dev/null +++ b/types/three/src/nodes/lighting/ShadowFilterNode.d.ts @@ -0,0 +1,28 @@ +import { Light } from "../../lights/Light.js"; +import NodeMaterial from "../../materials/nodes/NodeMaterial.js"; +import Node from "../core/Node.js"; +import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js"; + +export const BasicShadowFilter: ( + depthTexture: NodeRepresentation, + shadowCoord: NodeRepresentation, +) => ShaderNodeObject; + +export const PCFShadowFilter: ( + depthTexture: NodeRepresentation, + shadowCoord: NodeRepresentation, + shadow: NodeRepresentation, +) => ShaderNodeObject; + +export const PCFSoftShadowFilter: ( + depthTexture: NodeRepresentation, + shadowCoord: NodeRepresentation, + shadow: NodeRepresentation, +) => ShaderNodeObject; + +export const VSMShadowFilter: ( + depthTexture: NodeRepresentation, + shadowCoord: NodeRepresentation, +) => ShaderNodeObject; + +export const getShadowMaterial: (light: Light) => NodeMaterial; diff --git a/types/three/src/nodes/lighting/ShadowNode.d.ts b/types/three/src/nodes/lighting/ShadowNode.d.ts index f54eac1f12360c..4edfda0d34f6d9 100644 --- a/types/three/src/nodes/lighting/ShadowNode.d.ts +++ b/types/three/src/nodes/lighting/ShadowNode.d.ts @@ -1,30 +1,33 @@ +import { Camera } from "../../cameras/Camera.js"; +import { BufferGeometry } from "../../core/BufferGeometry.js"; +import { Object3D } from "../../core/Object3D.js"; import { Light } from "../../lights/Light.js"; import { LightShadow } from "../../lights/LightShadow.js"; -import Node from "../core/Node.js"; -import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js"; +import { Material } from "../../materials/Material.js"; +import { Group } from "../../objects/Group.js"; +import ClippingContext from "../../renderers/common/ClippingContext.js"; +import Renderer from "../../renderers/common/Renderer.js"; +import { Scene } from "../../scenes/Scene.js"; +import { ShaderNodeObject } from "../tsl/TSLCore.js"; +import LightsNode from "./LightsNode.js"; import ShadowBaseNode from "./ShadowBaseNode.js"; -export const BasicShadowFilter: ( - depthTexture: NodeRepresentation, - shadowCoord: NodeRepresentation, -) => ShaderNodeObject; - -export const PCFShadowFilter: ( - depthTexture: NodeRepresentation, - shadowCoord: NodeRepresentation, - shadow: NodeRepresentation, -) => ShaderNodeObject; - -export const PCFSoftShadowFilter: ( - depthTexture: NodeRepresentation, - shadowCoord: NodeRepresentation, - shadow: NodeRepresentation, -) => ShaderNodeObject; - -export const VSMShadowFilter: ( - depthTexture: NodeRepresentation, - shadowCoord: NodeRepresentation, -) => ShaderNodeObject; +export const getShadowRenderObjectFunction: ( + renderer: Renderer, + shadow: LightShadow, + shadowType: number, + useVelocity: boolean, +) => ( + object: Object3D, + scene: Scene, + _camera: Camera, + geometry: BufferGeometry, + material: Material, + group: Group, + lightsNode: LightsNode, + clippingContext?: ClippingContext | null, + passId?: string | null, +) => void; declare class ShadowNode extends ShadowBaseNode { constructor(light: Light, shadow: LightShadow | null); @@ -33,4 +36,3 @@ declare class ShadowNode extends ShadowBaseNode { export default ShadowNode; export const shadow: (light: Light, shadow?: LightShadow) => ShaderNodeObject; -export const shadows: ShaderNodeObject; diff --git a/types/three/src/nodes/math/OperatorNode.d.ts b/types/three/src/nodes/math/OperatorNode.d.ts index 751122dcec1886..d9df215c033925 100644 --- a/types/three/src/nodes/math/OperatorNode.d.ts +++ b/types/three/src/nodes/math/OperatorNode.d.ts @@ -79,6 +79,11 @@ export const bitXor: (a: NodeRepresentation, b: NodeRepresentation) => ShaderNod export const shiftLeft: (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject; export const shiftRight: (a: NodeRepresentation, b: NodeRepresentation) => ShaderNodeObject; +export const incrementBefore: (a: NodeRepresentation) => ShaderNodeObject; +export const decrementBefore: (a: NodeRepresentation) => ShaderNodeObject; +export const increment: (a: NodeRepresentation) => ShaderNodeObject; +export const decrement: (a: NodeRepresentation) => ShaderNodeObject; + declare module "../tsl/TSLCore.js" { interface NodeElements { add: typeof add; @@ -102,6 +107,10 @@ declare module "../tsl/TSLCore.js" { bitXor: typeof bitXor; shiftLeft: typeof shiftLeft; shiftRight: typeof shiftRight; + incrementBefore: typeof incrementBefore; + decrementBefore: typeof decrement; + increment: typeof increment; + decrement: typeof decrement; } } diff --git a/types/three/src/nodes/tsl/TSLCore.d.ts b/types/three/src/nodes/tsl/TSLCore.d.ts index aa3e7307db0cb4..6e761a5e1be5ef 100644 --- a/types/three/src/nodes/tsl/TSLCore.d.ts +++ b/types/three/src/nodes/tsl/TSLCore.d.ts @@ -9,7 +9,7 @@ import ConvertNode from "../utils/ConvertNode.js"; export interface NodeElements { toGlobal: (node: Node) => Node; - append: typeof append; + toStack: typeof Stack; toColor: typeof color; toFloat: typeof float; @@ -34,6 +34,8 @@ export interface NodeElements { element: typeof element; convert: typeof convert; + + append: typeof append; } export function addMethodChaining(name: string, nodeElement: unknown): void; @@ -113,7 +115,7 @@ type RemoveHeadAndTail = T extends [unknown, * * We use an object instead of tuple or union as it makes stuff easier, especially in Typescript 4.0. */ -interface Construtors< +interface Constructors< A extends undefined | [...unknown[]], B extends undefined | [...unknown[]], C extends undefined | [...unknown[]], @@ -136,20 +138,20 @@ type OverloadedConstructorsOf = T extends { new(...args: infer A2): unknown; new(...args: infer A3): unknown; new(...args: infer A4): unknown; -} ? Construtors +} ? Constructors : T extends { new(...args: infer A1): unknown; new(...args: infer A2): unknown; new(...args: infer A3): unknown; - } ? Construtors + } ? Constructors : T extends { new(...args: infer A1): unknown; new(...args: infer A2): unknown; - } ? Construtors - : T extends new(...args: infer A) => unknown ? Construtors - : Construtors; + } ? Constructors + : T extends new(...args: infer A) => unknown ? Constructors + : Constructors; -type AnyConstructors = Construtors; +type AnyConstructors = Constructors; /** * Returns all constructors where the first paramter is assignable to given "scope" @@ -259,30 +261,14 @@ export function Fn( jsFunc: (args: T) => void, ): ShaderNodeFn<[ProxiedObject]>; -/** - * @deprecated tslFn() has been renamed to Fn() - */ -export function tslFn>(jsFunc: () => R): () => R; -/** - * @deprecated tslFn() has been renamed to Fn() - */ -export function tslFn>( - jsFunc: (args: T) => R, -): (...args: ProxiedTuple) => R; -/** - * @deprecated tslFn() has been renamed to Fn() - */ -export function tslFn>( - jsFunc: (args: T) => R, -): (args: ProxiedObject) => R; - export const setCurrentStack: (stack: StackNode | null) => void; export const getCurrentStack: () => StackNode | null; export const If: (boolNode: Node, method: () => void) => StackNode; +export const Switch: (expression: NodeRepresentation) => StackNode; -export function append(node: Node): Node; +export function Stack(node: Node): Node; interface ColorFunction { (color?: ColorRepresentation): ShaderNodeObject>; @@ -322,3 +308,25 @@ export const arrayBuffer: (value: ArrayBuffer) => ShaderNodeObject ShaderNodeObject; export const convert: (node: NodeRepresentation, types: string) => ShaderNodeObject; export const split: (node: NodeRepresentation, channels?: string) => ShaderNodeObject; + +/** + * @deprecated append() has been renamed to Stack(). + */ +export const append: (node: Node) => Node; + +/** + * @deprecated tslFn() has been renamed to Fn() + */ +export function tslFn>(jsFunc: () => R): () => R; +/** + * @deprecated tslFn() has been renamed to Fn() + */ +export function tslFn>( + jsFunc: (args: T) => R, +): (...args: ProxiedTuple) => R; +/** + * @deprecated tslFn() has been renamed to Fn() + */ +export function tslFn>( + jsFunc: (args: T) => R, +): (args: ProxiedObject) => R; diff --git a/types/three/src/nodes/utils/DebugNode.d.ts b/types/three/src/nodes/utils/DebugNode.d.ts index 03783c717bcc8e..b532a5ed97ee3d 100644 --- a/types/three/src/nodes/utils/DebugNode.d.ts +++ b/types/three/src/nodes/utils/DebugNode.d.ts @@ -1,4 +1,5 @@ import Node from "../core/Node.js"; +import NodeBuilder from "../core/NodeBuilder.js"; import TempNode from "../core/TempNode.js"; import { NodeRepresentation, ShaderNodeObject } from "../tsl/TSLCore.js"; @@ -10,7 +11,7 @@ export default DebugNode; export const debug: ( node: NodeRepresentation, - callback?: ((code: string) => void) | null, + callback?: ((node: NodeBuilder, code: string) => void) | null, ) => ShaderNodeObject; declare module "../tsl/TSLCore.js" { diff --git a/types/three/src/nodes/utils/ReflectorNode.d.ts b/types/three/src/nodes/utils/ReflectorNode.d.ts index 0f46f013aa963e..78124c9c53338a 100644 --- a/types/three/src/nodes/utils/ReflectorNode.d.ts +++ b/types/three/src/nodes/utils/ReflectorNode.d.ts @@ -31,7 +31,7 @@ declare class ReflectorBaseNode extends Node { bounces: boolean; virtualCameras: WeakMap; - renderTargets: WeakMap; + renderTargets: Map; forceUpdate: boolean; constructor(textureNode: TextureNode, parameters?: ReflectorNodeParameters); diff --git a/types/three/src/renderers/common/Animation.d.ts b/types/three/src/renderers/common/Animation.d.ts index 94b83737350fcb..6507a8a4569dfe 100644 --- a/types/three/src/renderers/common/Animation.d.ts +++ b/types/three/src/renderers/common/Animation.d.ts @@ -12,7 +12,7 @@ export interface AnimationContext { declare class Animation { nodes: Nodes; info: Info; - _context: AnimationContext; + _context: AnimationContext | null; _animationLoop: ((time: DOMHighResTimeStamp, xrFrame?: XRFrame) => void) | null; _requestId: number | null; /** @@ -47,7 +47,7 @@ declare class Animation { * * @return {Window|XRSession} The animation context. */ - getContext(): AnimationContext; + getContext(): AnimationContext | null; /** * Defines the context in which `requestAnimationFrame()` is executed. * diff --git a/types/three/src/renderers/common/Renderer.d.ts b/types/three/src/renderers/common/Renderer.d.ts index 1b7e17e9209a3a..2893b2190c01c7 100644 --- a/types/three/src/renderers/common/Renderer.d.ts +++ b/types/three/src/renderers/common/Renderer.d.ts @@ -62,6 +62,7 @@ export interface RendererParameters { samples?: number | undefined; getFallback?: ((error: unknown) => Backend) | null | undefined; colorBufferType?: TextureDataType | undefined; + multiview?: boolean | undefined; } /** * Base class for renderers. @@ -198,6 +199,7 @@ declare class Renderer { * @property {?Function} [getFallback=null] - This callback function can be used to provide a fallback backend, if the primary backend can't be targeted. * @property {number} [colorBufferType=HalfFloatType] - Defines the type of color buffers. The default `HalfFloatType` is recommend for best * quality. To save memory and bandwidth, `UnsignedByteType` might be used. This will reduce rendering quality though. + * @property {boolean} [multiview=false] - If set to `true`, the renderer will use multiview during WebXR rendering if supported. */ /** * Constructs a new renderer. @@ -255,6 +257,23 @@ declare class Renderer { * @return {Promise} A Promise that resolves when synchronization has been finished. */ waitForGPU(): Promise; + /** + * Enables or disables high precision for model-view and normal-view matrices. + * When enabled, will use CPU 64-bit precision for higher precision instead of GPU 32-bit for higher performance. + * + * NOTE: 64-bit precision is not compatible with `InstancedMesh` and `SkinnedMesh`. + * + * @param {boolean} value - Whether to enable or disable high precision. + * @type {boolean} + */ + set highPrecision(value: boolean); + /** + * Returns whether high precision is enabled or not. + * + * @return {boolean} Whether high precision is enabled or not. + * @type {boolean} + */ + get highPrecision(): boolean; /** * Sets the given MRT configuration. * diff --git a/types/three/src/renderers/common/Textures.d.ts b/types/three/src/renderers/common/Textures.d.ts index cbfcd06f34af4d..f70be86b5d8407 100644 --- a/types/three/src/renderers/common/Textures.d.ts +++ b/types/three/src/renderers/common/Textures.d.ts @@ -116,13 +116,6 @@ declare class Textures extends DataMap<{ * @return {boolean} Whether mipmaps are required or not. */ needsMipmaps(texture: Texture): boolean; - /** - * Returns `true` if the given texture is an environment map. - * - * @param {Texture} texture - The texture. - * @return {boolean} Whether the given texture is an environment map or not. - */ - isEnvironmentTexture(texture: Texture): boolean; /** * Frees internal resource when the given texture isn't * required anymore. diff --git a/types/three/src/renderers/common/TimestampQueryPool.d.ts b/types/three/src/renderers/common/TimestampQueryPool.d.ts index d70f0b39490e27..5babb74674ede2 100644 --- a/types/three/src/renderers/common/TimestampQueryPool.d.ts +++ b/types/three/src/renderers/common/TimestampQueryPool.d.ts @@ -23,6 +23,7 @@ declare abstract class TimestampQueryPool { * * @abstract * @param {Object} renderContext - The render context to allocate queries for. + * @returns {?number} */ abstract allocateQueriesForContext(renderContext: RenderContext): number | null; /** diff --git a/types/three/src/renderers/common/XRManager.d.ts b/types/three/src/renderers/common/XRManager.d.ts index 55f5e318c94132..c4a92227d47ad8 100644 --- a/types/three/src/renderers/common/XRManager.d.ts +++ b/types/three/src/renderers/common/XRManager.d.ts @@ -98,12 +98,15 @@ declare class XRManager extends EventDispatcher { _glProjLayer: XRProjectionLayer | null; _xrFrame: XRFrame | null; _useLayers: boolean; + _useMultiviewIfPossible: boolean; + _useMultiview: boolean; /** * Constructs a new XR manager. * * @param {Renderer} renderer - The renderer. + * @param {boolean} [multiview=false] - Enables multiview if the device supports it. */ - constructor(renderer: Renderer); + constructor(renderer: Renderer, multiview?: boolean); /** * Returns an instance of `THREE.Group` that represents the transformation * of a XR controller in target ray space. The requested controller is defined @@ -202,6 +205,12 @@ declare class XRManager extends EventDispatcher { * @return {?XRFrame} The XR frame. Returns `null` when used outside a XR session. */ getFrame(): XRFrame | null; + /** + * Returns `true` if the engine renders to a multiview target. + * + * @return {boolean} Whether the engine renders to a multiview render target or not. + */ + useMultiview(): boolean; createQuadLayer( width: number, height: number, diff --git a/types/three/src/renderers/webgpu/WebGPUBackend.d.ts b/types/three/src/renderers/webgpu/WebGPUBackend.d.ts index 09138368b5bea5..4e407ec35006a2 100644 --- a/types/three/src/renderers/webgpu/WebGPUBackend.d.ts +++ b/types/three/src/renderers/webgpu/WebGPUBackend.d.ts @@ -5,6 +5,7 @@ import Backend, { BackendParameters } from "../common/Backend.js"; export interface WebGPUBackendParameters extends BackendParameters { alpha?: boolean | undefined; + compatibilityMode?: boolean | undefined; requiredLimits?: Record | undefined; trackTimestamp?: boolean | undefined; device?: GPUDevice | undefined; diff --git a/types/three/src/textures/DepthArrayTexture.d.ts b/types/three/src/textures/DepthArrayTexture.d.ts new file mode 100644 index 00000000000000..278878332f25ed --- /dev/null +++ b/types/three/src/textures/DepthArrayTexture.d.ts @@ -0,0 +1,14 @@ +import { DepthTexture } from "./DepthTexture.js"; + +declare class DepthArrayTexture extends DepthTexture { + readonly isDepthArrayTexture: true; + layerUpdates: Set; + + constructor(width?: number, height?: number, depth?: number); + + addLayerUpdate(layerIndex: number): void; + + clearLayerUpdates(): void; +} + +export { DepthArrayTexture }; diff --git a/types/three/src/textures/Texture.d.ts b/types/three/src/textures/Texture.d.ts index 60b03f3dbd0479..8671addea68709 100644 --- a/types/three/src/textures/Texture.d.ts +++ b/types/three/src/textures/Texture.d.ts @@ -377,6 +377,13 @@ export class Texture extends EventDispatcher<{ dispose: {} }> { */ isRenderTargetTexture: boolean; + /** + * Indicates if a texture should be handled like a texture array. + * + * @default false + */ + isTextureArray: boolean; + /** * An object that can be used to store custom data about the texture. * @remarks It should not hold references to functions as these will not be cloned. @@ -432,7 +439,7 @@ export class Texture extends EventDispatcher<{ dispose: {} }> { /** * A callback function, called when the texture is updated _(e.g., when needsUpdate has been set to true and then the texture is used)_. */ - onUpdate: () => void; + onUpdate: ((texture: Texture) => void) | null; /** * Transform the **UV** based on the value of this texture's diff --git a/types/three/src/textures/VideoFrameTexture.d.ts b/types/three/src/textures/VideoFrameTexture.d.ts index 08a83c476bf4bf..8f89271d7b3cd2 100644 --- a/types/three/src/textures/VideoFrameTexture.d.ts +++ b/types/three/src/textures/VideoFrameTexture.d.ts @@ -21,7 +21,7 @@ declare class VideoFrameTexture extends VideoTexture { ); // FIXME Replace with VideoFrame when we no longer need to support TypeScript 5.0 - setFrame(frane: unknown): void; + setFrame(frame: unknown): void; } export { VideoFrameTexture }; diff --git a/types/three/test/integration/geometry-buffer.ts b/types/three/test/integration/geometry-buffer.ts index a24d0a8d3302f5..611c68c78e7306 100644 --- a/types/three/test/integration/geometry-buffer.ts +++ b/types/three/test/integration/geometry-buffer.ts @@ -13,19 +13,19 @@ function init() { const geometry = new THREE.BufferGeometry(); - const verticles = new Float32Array([ + const vertices = new Float32Array([ ...[-1.0, -1.0, 1.0], // ...[1.0, -1.0, 1.0], // ...[0.0, 1.0, 1.0], // ]); - geometry.setAttribute("position", new THREE.BufferAttribute(verticles, 3)); + geometry.setAttribute("position", new THREE.BufferAttribute(vertices, 3)); const posAtt = geometry.getAttribute("position"); if (posAtt.name === "position") { geometry.deleteAttribute("position"); } - geometry.setAttribute("position", new THREE.BufferAttribute(verticles, 3)); + geometry.setAttribute("position", new THREE.BufferAttribute(vertices, 3)); geometry.setAttribute("customAttribute", new THREE.BufferAttribute(new Float32Array([0]), 1)); const customAtt = geometry.getAttribute("customAttribute"); From 23d52ee8b1ae9ee4823d3d293defdbdfd40ca1cf Mon Sep 17 00:00:00 2001 From: Ravi van Rooijen Date: Thu, 24 Apr 2025 09:43:25 +0200 Subject: [PATCH 5/8] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#72487=20Remove?= =?UTF-8?q?=20myself=20as=20owner=20for=20`connect-mongodb-session`=20by?= =?UTF-8?q?=20@HoldYourWaffle?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/connect-mongodb-session/package.json | 4 ---- 1 file changed, 4 deletions(-) diff --git a/types/connect-mongodb-session/package.json b/types/connect-mongodb-session/package.json index 7f75cf0d29db9c..f867fdcecdb536 100644 --- a/types/connect-mongodb-session/package.json +++ b/types/connect-mongodb-session/package.json @@ -18,10 +18,6 @@ { "name": "Nattapong Sirilappanich", "githubUsername": "NattapongSiri" - }, - { - "name": "Ravi van Rooijen", - "githubUsername": "HoldYourWaffle" } ] } From 81d0317254f541c06e8708fe444ba2e464cbc22d Mon Sep 17 00:00:00 2001 From: Martin Homola Date: Thu, 24 Apr 2025 15:56:41 +0200 Subject: [PATCH 6/8] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#72572=20[invit?= =?UTF-8?q?y-api]:=20sell=20provider=20lockAmount=20parameter=20by=20@adde?= =?UTF-8?q?rpositive?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/invity-api/index.d.ts | 2 ++ types/invity-api/invity-api-tests.ts | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/types/invity-api/index.d.ts b/types/invity-api/index.d.ts index 7800de96ac92a1..46d23b4e499730 100644 --- a/types/invity-api/index.d.ts +++ b/types/invity-api/index.d.ts @@ -470,6 +470,8 @@ export interface SellProviderInfo { flow?: SellFiatFlowType | undefined; isRefundAddressRequired?: boolean | undefined; pendingTimeout?: number | undefined; // Time until a SUBMITTED transaction automatically changes to PENDING. Null means it does not change. + /** Should be used when it's necessary to have the exact amount match between the trade and the transaction */ + lockSendAmount?: boolean; } export interface SellListResponse { diff --git a/types/invity-api/invity-api-tests.ts b/types/invity-api/invity-api-tests.ts index beaf8e2f86e1e1..69fedba92bc0eb 100644 --- a/types/invity-api/invity-api-tests.ts +++ b/types/invity-api/invity-api-tests.ts @@ -6,6 +6,7 @@ import { ExchangeTrade, InfoResponse, SellFiatTrade, + SellProviderInfo, WatchSellTradeResponse, } from "invity-api"; @@ -92,3 +93,19 @@ const exchangeProviderInfo: ExchangeProviderInfo = { kycPolicyType: "KYC-norefund", isRefundRequired: false, }; + +const sellProviderInfo: SellProviderInfo = { + name: "example", + companyName: "Example", + logo: "example-icon.jpg", + type: "Fiat", + isActive: true, + tradedCoins: ["bitcoin", "ethereum"] as CryptoId[], + tradedFiatCurrencies: ["USD"], + supportedCountries: ["US"], + statusUrl: "https://example.com/txs/{{orderId}}", + supportUrl: " https://support.example.com", + flow: "PAYMENT_GATE", + isRefundAddressRequired: false, + lockSendAmount: false, +}; From 220dafe2ff08c03ac43ad8cbd10e008029e84e5c Mon Sep 17 00:00:00 2001 From: Nick Rodriguez <68359871+nicolas377@users.noreply.github.com> Date: Thu, 24 Apr 2025 11:36:40 -0400 Subject: [PATCH 7/8] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#72573=20[chrom?= =?UTF-8?q?e]:=20add=20userScripts.execute()=20by=20@nicolas377?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- types/chrome/index.d.ts | 45 ++++++++++++++++++++++++++++++++++++++ types/chrome/test/index.ts | 34 ++++++++++++++++++++++++---- 2 files changed, 75 insertions(+), 4 deletions(-) diff --git a/types/chrome/index.d.ts b/types/chrome/index.d.ts index 96cf5c7c41e821..9efbde5576f2ff 100644 --- a/types/chrome/index.d.ts +++ b/types/chrome/index.d.ts @@ -14860,6 +14860,18 @@ declare namespace chrome { */ export type ExecutionWorld = "MAIN" | "USER_SCRIPT"; + /** @since Chrome 135 */ + export interface InjectionResult { + /** The document associated with the injection. */ + documentId: string; + /** The error, if any. `error` and `result` are mutually exclusive. */ + error?: string; + /** The frame associated with the injection. */ + frameId: number; + /** The result of the script execution. */ + result: any; + } + export interface WorldProperties { /** Specifies the world csp. The default is the `ISOLATED` world csp. */ csp?: string; @@ -14876,6 +14888,18 @@ declare namespace chrome { ids?: string[]; } + /** @since Chrome 135 */ + export interface InjectionTarget { + /** Whether the script should inject into all frames within the tab. Defaults to false. This must not be true if `frameIds` is specified. */ + allFrames?: boolean; + /** The IDs of specific documentIds to inject into. This must not be set if `frameIds` is set. */ + documentIds?: string[]; + /** The IDs of specific frames to inject into. */ + frameIds?: number[]; + /** The ID of the tab into which to inject. */ + tabId: number; + } + export interface RegisteredUserScript { /** If true, it will inject into all frames, even if the frame is not the top-most frame in the tab. Each frame is checked independently for URL requirements; it will not inject into child frames if the URL requirements are not met. Defaults to false, meaning that only the top frame is matched. */ allFrames?: boolean; @@ -14902,6 +14926,20 @@ declare namespace chrome { worldId?: string; } + /** @since Chrome 135 */ + export interface UserScriptInjection { + /** Whether the injection should be triggered in the target as soon as possible. Note that this is not a guarantee that injection will occur prior to page load, as the page may have already loaded by the time the script reaches the target. */ + injectImmediately?: boolean; + /** The list of ScriptSource objects defining sources of scripts to be injected into the target. */ + js: ScriptSource[]; + /** Details specifying the target into which to inject the script. */ + target: InjectionTarget; + /** The JavaScript "world" to run the script in. The default is `USER_SCRIPT`. */ + world?: ExecutionWorld; + /** Specifies the user script world ID to execute in. If omitted, the script will execute in the default user script world. Only valid if `world` is omitted or is `USER_SCRIPT`. Values with leading underscores (`_`) are reserved. */ + worldId?: string; + } + /** * Properties for a script source. */ @@ -14954,6 +14992,13 @@ declare namespace chrome { export function getWorldConfigurations(): Promise; export function getWorldConfigurations(callback: (worlds: WorldProperties[]) => void): void; + /** + * Injects a script into a target context. By default, the script will be run at `document_idle`, or immediately if the page has already loaded. If the `injectImmediately` property is set, the script will inject without waiting, even if the page has not finished loading. If the script evaluates to a promise, the browser will wait for the promise to settle and return the resulting value. + * @since Chrome 135 + */ + export function execute(injection: UserScriptInjection): Promise; + export function execute(injection: UserScriptInjection, callback: (result: InjectionResult[]) => void): void; + /** * Registers one or more user scripts for this extension. * diff --git a/types/chrome/test/index.ts b/types/chrome/test/index.ts index 83ff8ca15a9d64..dd0d8c3f8e1512 100644 --- a/types/chrome/test/index.ts +++ b/types/chrome/test/index.ts @@ -4404,6 +4404,12 @@ function testUserScripts() { chrome.userScripts.getScripts(userScriptFilter); // $ExpectType Promise chrome.userScripts.getScripts(userScriptFilter, (scripts: chrome.userScripts.RegisteredUserScript[]) => void 0); // $ExpectType void + const badScripts = [ + { + id: "badScriptId", + matches: ["*://example.com/*"], + }, + ]; const scripts = [ { id: "scriptId1", @@ -4416,13 +4422,26 @@ function testUserScripts() { matches: ["*://example.org/*"], }, ]; - - const badScripts = [ + const jsInjections: chrome.userScripts.ScriptSource[] = [ { - id: "badScriptId", - matches: ["*://example.com/*"], + file: "./the/script.js", + }, + { + code: "console.log(\"Wow the script works!\");", }, ]; + const injectionTarget: chrome.userScripts.InjectionTarget = { + tabId: 46, + allFrames: true, + }; + + const badExeOptions = {}; + const exeOptions: chrome.userScripts.UserScriptInjection = { + injectImmediately: true, + js: jsInjections, + target: injectionTarget, + worldId: "USER_SCRIPT", + }; chrome.userScripts.getWorldConfigurations(); // $ExpectType Promise chrome.userScripts.getWorldConfigurations(([world]) => { // $ExpectType void @@ -4433,6 +4452,13 @@ function testUserScripts() { // @ts-expect-error chrome.userScripts.getWorldConfigurations(() => {}).then(() => {}); + // @ts-expect-error + chrome.userScripts.execute(badExeOptions); + chrome.userScripts.execute(exeOptions); // $ExpectType Promise + chrome.userScripts.execute(exeOptions, (result) => { // $ExpectType void + result; // $ExpectType InjectionResult[] + }); + chrome.userScripts.register(scripts); // $ExpectType Promise chrome.userScripts.register(scripts, () => void 0); // $ExpectType void // @ts-expect-error Missing required property 'js'. From fde9eaa020ff35bae70ce568f09749efd9032ea9 Mon Sep 17 00:00:00 2001 From: Jonathan Jacobs Date: Thu, 24 Apr 2025 17:55:28 +0200 Subject: [PATCH 8/8] =?UTF-8?q?=F0=9F=A4=96=20Merge=20PR=20#72588=20[react?= =?UTF-8?q?-native-web]=20Declare=20and=20export=20unstable=5FcreateElemen?= =?UTF-8?q?t=20by=20@jonathanj?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jonathan Jacobs --- types/react-native-web/index.d.ts | 5 +++++ types/react-native-web/react-native-web-tests.tsx | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/types/react-native-web/index.d.ts b/types/react-native-web/index.d.ts index f54bf8518a9bdb..b4437edd14f2de 100644 --- a/types/react-native-web/index.d.ts +++ b/types/react-native-web/index.d.ts @@ -1,6 +1,7 @@ import type { ComponentClass, ComponentType, + createElement, CSSProperties, FocusEventHandler, FunctionComponent, @@ -1258,6 +1259,10 @@ export function useWindowDimensions(): { width: number; }; +// unstable APIs + +export const unstable_createElement: typeof createElement; + export {}; declare module "react-native" { diff --git a/types/react-native-web/react-native-web-tests.tsx b/types/react-native-web/react-native-web-tests.tsx index 9c747978c00886..704c8682852beb 100644 --- a/types/react-native-web/react-native-web-tests.tsx +++ b/types/react-native-web/react-native-web-tests.tsx @@ -42,6 +42,8 @@ import { TouchableNativeFeedback, TouchableOpacity, TouchableWithoutFeedback, + // unstable APIs + unstable_createElement, // hooks useColorScheme, useLocaleContext, @@ -382,6 +384,9 @@ const colorScheme = useColorScheme(); const localeContext = useLocaleContext(); const windowDimensions = useWindowDimensions(); +// Unstable APIs +const videoElement = unstable_createElement("video", { src: "a_url", controls: true, muted: "arst" }); + const node = 0; UIManager.blur(node); UIManager.focus(node);