Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions types/three/src/lights/DirectionalLight.d.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
import { Object3D } from "../core/Object3D.js";
import { JSONMeta, Object3D } from "../core/Object3D.js";
import { ColorRepresentation } from "../math/Color.js";
import { Vector3 } from "../math/Vector3.js";
import { DirectionalLightShadow } from "./DirectionalLightShadow.js";
import { Light } from "./Light.js";
import { Light, LightJSON } from "./Light.js";
import { LightShadowJSON } from "./LightShadow.js";

export interface DirectionalLightJSON extends LightJSON {
shadow: LightShadowJSON;
target: string;
}

/**
* A light that gets emitted in a specific direction
Expand Down Expand Up @@ -99,4 +105,6 @@ export class DirectionalLight extends Light<DirectionalLightShadow> {
* Call this method whenever this instance is no longer used in your app.
*/
dispose(): void;

toJSON(meta?: JSONMeta): DirectionalLightJSON;
}
9 changes: 8 additions & 1 deletion types/three/src/lights/HemisphereLight.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
import { JSONMeta } from "../core/Object3D.js";
import { Color, ColorRepresentation } from "../math/Color.js";
import { Vector3 } from "../math/Vector3.js";
import { Light } from "./Light.js";
import { Light, LightJSON } from "./Light.js";

export interface HemisphereLightJSON extends LightJSON {
groundColor: number;
}

/**
* A light source positioned directly above the scene, with color fading from the sky color to the ground color.
Expand Down Expand Up @@ -58,4 +63,6 @@ export class HemisphereLight extends Light<undefined> {
* @defaultValue `new THREE.Color()` set to white _(0xffffff)_.
*/
groundColor: Color;

toJSON(meta?: JSONMeta): HemisphereLightJSON;
}
10 changes: 0 additions & 10 deletions types/three/src/lights/Light.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,6 @@ import { LightShadow, LightShadowJSON } from "./LightShadow.js";
export interface LightJSON extends Object3DJSON {
color: number;
intensity: number;

groundColor?: number;

distance?: number;
angle?: number;
decay?: number;
penumbra?: number;

shadow?: LightShadowJSON;
target?: string;
}

/**
Expand Down
13 changes: 12 additions & 1 deletion types/three/src/lights/PointLight.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,16 @@
import { JSONMeta } from "../core/Object3D.js";
import { ColorRepresentation } from "../math/Color.js";
import { Light } from "./Light.js";
import { Light, LightJSON } from "./Light.js";
import { LightShadowJSON } from "./LightShadow.js";
import { PointLightShadow } from "./PointLightShadow.js";

export interface PointLightJSON extends LightJSON {
distance: number;
decay: number;

shadow: LightShadowJSON;
}

/**
* A light that gets emitted from a single point in all directions
* @remarks
Expand Down Expand Up @@ -99,4 +108,6 @@ export class PointLight extends Light<PointLightShadow> {
* @remarks Expects a `Float`
*/
power: number;

toJSON(meta?: JSONMeta): PointLightJSON;
}
19 changes: 17 additions & 2 deletions types/three/src/lights/SpotLight.d.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,23 @@
import { Object3D } from "../core/Object3D.js";
import { JSONMeta, Object3D } from "../core/Object3D.js";
import { ColorRepresentation } from "../math/Color.js";
import { Vector3 } from "../math/Vector3.js";
import { Texture } from "../textures/Texture.js";
import { Light } from "./Light.js";
import { Light, LightJSON } from "./Light.js";
import { LightShadowJSON } from "./LightShadow.js";
import { SpotLightShadow } from "./SpotLightShadow.js";

export interface SpotLightJSON extends LightJSON {
distance: number;
angle: number;
decay: number;
penumbra: number;

target: string;
map?: string | undefined;

shadow: LightShadowJSON;
}

/**
* This light gets emitted from a single point in one direction, along a cone that increases in size the further from the light it gets.
* @example
Expand Down Expand Up @@ -161,4 +174,6 @@ export class SpotLight extends Light<SpotLightShadow> {
* @remarks **Warning**: {@link SpotLight.map} is disabled if {@link SpotLight.castShadow} is `false`.
*/
map: Texture | null;

toJSON(meta?: JSONMeta): SpotLightJSON;
}
Loading