Skip to content

Commit

Permalink
Added types for UniformGroupNode and UniformGroup, and created type d… (
Browse files Browse the repository at this point in the history
#940)

* Added types for UniformGroupNode and UniformGroup, and created type definitions for UniformGroupNode values within the UniformNode class

* fix formatting

* Updates

---------

Co-authored-by: Nathan Bierema <nbierema@gmail.com>
  • Loading branch information
cmhhelgeson and Methuselah96 committed May 17, 2024
1 parent bbe75e5 commit 1cc6ee8
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
7 changes: 7 additions & 0 deletions types/three/examples/jsm/nodes/core/UniformGroup.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default class UniformGroup {
name: string;

readonly isUniformGroup: true;

constructor(name: string);
}
21 changes: 21 additions & 0 deletions types/three/examples/jsm/nodes/core/UniformGroupNode.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import Node from "./Node.js";

export default class UniformGroupNode extends Node {
name: string;
version: number;

shared: boolean;

readonly isUniformGroup: true;

constructor(name: string, shared?: boolean);

set needsUpdate(value: boolean);
}

export const uniformGroup: (name: string) => UniformGroupNode;
export const sharedUniformGroup: (name: string) => UniformGroupNode;

export const frameGroup: UniformGroupNode;
export const renderGroup: UniformGroupNode;
export const objectGroup: UniformGroupNode;
7 changes: 7 additions & 0 deletions types/three/examples/jsm/nodes/core/UniformNode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,19 @@ import { NodeTypeOption } from "./constants.js";
import InputNode from "./InputNode.js";
import Node from "./Node.js";
import NodeBuilder from "./NodeBuilder.js";
import UniformGroupNode from "./UniformGroupNode.js";

export default class UniformNode<Value> extends InputNode<Value> {
readonly isUniformNode: true;

groupNode: UniformGroupNode;

constructor(value: Value, nodeType?: NodeTypeOption | null);

setGroup(group: UniformGroupNode): this;

getGroup(): UniformGroupNode;

getUniformHash(builder: NodeBuilder): string;
}

Expand Down

0 comments on commit 1cc6ee8

Please sign in to comment.