///
declare module NODEEDITOR {
/**
* Port model
*/
export class DefaultPortModel extends PortModel {
/**
* If the port is input or output
*/
position: string | "input" | "output";
/**
* What the port is connected to
*/
connection: BABYLON.Nullable;
defaultValue: any;
static idCounter: number;
constructor(name: string, type?: string);
syncWithNodeMaterialConnectionPoint(connection: BABYLON.NodeMaterialConnectionPoint): void;
getNodeModel(): DefaultNodeModel;
link(outPort: DefaultPortModel): LinkModel;
createLinkModel(): LinkModel;
static SortInputOutput(a: BABYLON.Nullable, b: BABYLON.Nullable): {
input: DefaultPortModel;
output: DefaultPortModel;
} | null;
}
}
declare module NODEEDITOR {
interface ITextLineComponentProps {
label: string;
value: string;
color?: string;
underline?: boolean;
onLink?: () => void;
}
export class TextLineComponent extends React.Component {
constructor(props: ITextLineComponentProps);
onLink(): void;
renderContent(): JSX.Element;
render(): JSX.Element;
}
}
declare module NODEEDITOR {
/**
* Generic node model which stores information about a node editor block
*/
export class GenericNodeModel extends DefaultNodeModel {
/**
* Labels for the block
*/
header: string;
/**
* BABYLON.Vector2 for the node if it exists
*/
vector2: BABYLON.Nullable;
/**
* BABYLON.Vector3 for the node if it exists
*/
vector3: BABYLON.Nullable;
/**
* BABYLON.Vector4 for the node if it exists
*/
vector4: BABYLON.Nullable;
/**
* BABYLON.Matrix for the node if it exists
*/
matrix: BABYLON.Nullable;
/**
* Constructs the node model
*/
constructor();
prepare(options: NodeCreationOptions, nodes: Array, model: DiagramModel, graphEditor: GraphEditor, filterInputs: string[]): void;
renderProperties(globalState: GlobalState): JSX.Element;
}
}
declare module NODEEDITOR {
/**
* GenericNodeWidgetProps
*/
export interface GenericNodeWidgetProps {
node: BABYLON.Nullable;
globalState: GlobalState;
}
/**
* GenericNodeWidgetState
*/
export interface GenericNodeWidgetState {
}
/**
* Used to display a node block for the node editor
*/
export class GenericNodeWidget extends React.Component {
/**
* Creates a GenericNodeWidget
* @param props
*/
constructor(props: GenericNodeWidgetProps);
render(): JSX.Element;
}
}
declare module NODEEDITOR {
/**
* Node factory which creates editor nodes
*/
export class GenericNodeFactory extends SRD.AbstractNodeFactory {
private _globalState;
/**
* Constructs a GenericNodeFactory
*/
constructor(globalState: GlobalState);
/**
* Generates a node widget
* @param diagramEngine diagram engine
* @param node node to generate
* @returns node widget jsx
*/
generateReactWidget(diagramEngine: SRD.DiagramEngine, node: GenericNodeModel): JSX.Element;
/**
* Gets a new instance of a node model
* @returns generic node model
*/
getNewInstance(): GenericNodeModel;
}
}
declare module NODEEDITOR {
interface ILineContainerComponentProps {
title: string;
children: any[] | any;
closed?: boolean;
}
export class LineContainerComponent extends React.Component {
private static _InMemoryStorage;
constructor(props: ILineContainerComponentProps);
switchExpandedState(): void;
renderHeader(): JSX.Element;
render(): JSX.Element;
}
}
declare module NODEEDITOR {
export interface IButtonLineComponentProps {
label: string;
onClick: () => void;
}
export class ButtonLineComponent extends React.Component {
constructor(props: IButtonLineComponentProps);
render(): JSX.Element;
}
}
declare module NODEEDITOR {
interface INodeListComponentProps {
globalState: GlobalState;
onAddValueNode: (b: string) => void;
onAddNodeFromClass: (ObjectClass: typeof BABYLON.NodeMaterialBlock) => void;
}
export class NodeListComponent extends React.Component {
render(): JSX.Element;
}
}
declare module NODEEDITOR {
interface IPropertyTabComponentProps {
globalState: GlobalState;
}
export class PropertyTabComponent extends React.Component;
}> {
constructor(props: IPropertyTabComponentProps);
componentWillMount(): void;
render(): JSX.Element;
}
}
declare module NODEEDITOR {
interface IPortalProps {
globalState: GlobalState;
}
export class Portal extends React.Component {
render(): React.ReactPortal;
}
}
declare module NODEEDITOR {
interface IFileButtonLineComponentProps {
label: string;
onClick: (file: File) => void;
accept: string;
}
export class FileButtonLineComponent extends React.Component {
constructor(props: IFileButtonLineComponentProps);
onChange(evt: any): void;
render(): JSX.Element;
}
}
declare module NODEEDITOR {
interface ITexturePropertyTabComponentProps {
globalState: GlobalState;
node: TextureNodeModel;
}
export class TexturePropertyTabComponent extends React.Component {
/**
* Replaces the texture of the node
* @param file the file of the texture to use
*/
replaceTexture(file: File): void;
render(): JSX.Element;
}
}
declare module NODEEDITOR {
/**
* BABYLON.Texture node model which stores information about a node editor block
*/
export class TextureNodeModel extends DefaultNodeModel {
private _block;
/**
* BABYLON.Texture for the node if it exists
*/
texture: BABYLON.Nullable;
/**
* Constructs the node model
*/
constructor();
renderProperties(globalState: GlobalState): JSX.Element;
prepare(options: NodeCreationOptions, nodes: Array, model: DiagramModel, graphEditor: GraphEditor, filterInputs: string[]): void;
}
}
declare module NODEEDITOR {
interface ITextureLineComponentProps {
texture: BABYLON.BaseTexture;
width: number;
height: number;
globalState?: any;
hideChannelSelect?: boolean;
}
export class TextureLineComponent extends React.Component {
constructor(props: ITextureLineComponentProps);
shouldComponentUpdate(nextProps: ITextureLineComponentProps, nextState: {
displayRed: boolean;
displayGreen: boolean;
displayBlue: boolean;
displayAlpha: boolean;
face: number;
}): boolean;
componentDidMount(): void;
componentDidUpdate(): void;
updatePreview(): void;
render(): JSX.Element;
}
}
declare module NODEEDITOR {
/**
* GenericNodeWidgetProps
*/
export interface TextureNodeWidgetProps {
node: BABYLON.Nullable;
globalState: GlobalState;
}
/**
* Used to display a node block for the node editor
*/
export class TextureNodeWidget extends React.Component {
/**
* Creates a GenericNodeWidget
* @param props
*/
constructor(props: TextureNodeWidgetProps);
render(): JSX.Element;
}
}
declare module NODEEDITOR {
/**
* Node factory which creates editor nodes
*/
export class TextureNodeFactory extends SRD.AbstractNodeFactory {
private _globalState;
/**
* Constructs a TextureNodeFactory
*/
constructor(globalState: GlobalState);
/**
* Generates a node widget
* @param diagramEngine diagram engine
* @param node node to generate
* @returns node widget jsx
*/
generateReactWidget(diagramEngine: SRD.DiagramEngine, node: TextureNodeModel): JSX.Element;
/**
* Gets a new instance of a node model
* @returns texture node model
*/
getNewInstance(): TextureNodeModel;
}
}
declare module NODEEDITOR {
interface INumericInputComponentProps {
label: string;
value: number;
step?: number;
onChange: (value: number) => void;
}
export class NumericInputComponent extends React.Component {
static defaultProps: {
step: number;
};
private _localChange;
constructor(props: INumericInputComponentProps);
shouldComponentUpdate(nextProps: INumericInputComponentProps, nextState: {
value: string;
}): boolean;
updateValue(evt: any): void;
render(): JSX.Element;
}
}
declare module NODEEDITOR {
export class PropertyChangedEvent {
object: any;
property: string;
value: any;
initialValue: any;
}
}
declare module NODEEDITOR {
interface IVector2LineComponentProps {
label: string;
target: any;
propertyName: string;
step?: number;
onChange?: (newvalue: BABYLON.Vector2) => void;
onPropertyChangedObservable?: BABYLON.Observable;
}
export class Vector2LineComponent extends React.Component {
static defaultProps: {
step: number;
};
private _localChange;
constructor(props: IVector2LineComponentProps);
shouldComponentUpdate(nextProps: IVector2LineComponentProps, nextState: {
isExpanded: boolean;
value: BABYLON.Vector2;
}): boolean;
switchExpandState(): void;
raiseOnPropertyChanged(previousValue: BABYLON.Vector2): void;
updateStateX(value: number): void;
updateStateY(value: number): void;
render(): JSX.Element;
}
}
declare module NODEEDITOR {
interface IVector2PropertyTabComponentProps {
globalState: GlobalState;
connection: BABYLON.NodeMaterialConnectionPoint;
}
export class Vector2PropertyTabComponent extends React.Component {
render(): JSX.Element;
}
}
declare module NODEEDITOR {
interface IVector3LineComponentProps {
label: string;
target: any;
propertyName: string;
step?: number;
onChange?: (newvalue: BABYLON.Vector3) => void;
onPropertyChangedObservable?: BABYLON.Observable;
}
export class Vector3LineComponent extends React.Component {
static defaultProps: {
step: number;
};
private _localChange;
constructor(props: IVector3LineComponentProps);
shouldComponentUpdate(nextProps: IVector3LineComponentProps, nextState: {
isExpanded: boolean;
value: BABYLON.Vector3;
}): boolean;
switchExpandState(): void;
raiseOnPropertyChanged(previousValue: BABYLON.Vector3): void;
updateVector3(): void;
updateStateX(value: number): void;
updateStateY(value: number): void;
updateStateZ(value: number): void;
render(): JSX.Element;
}
}
declare module NODEEDITOR {
interface IVector3PropertyTabComponentProps {
globalState: GlobalState;
connection: BABYLON.NodeMaterialConnectionPoint;
}
export class Vector3PropertyTabComponent extends React.Component {
render(): JSX.Element;
}
}
declare module NODEEDITOR {
export interface ICheckBoxLineComponentProps {
label: string;
target?: any;
propertyName?: string;
isSelected?: () => boolean;
onSelect?: (value: boolean) => void;
onValueChanged?: () => void;
onPropertyChangedObservable?: BABYLON.Observable;
}
export class CheckBoxLineComponent extends React.Component {
private static _UniqueIdSeed;
private _uniqueId;
private _localChange;
constructor(props: ICheckBoxLineComponentProps);
shouldComponentUpdate(nextProps: ICheckBoxLineComponentProps, nextState: {
isSelected: boolean;
}): boolean;
onChange(): void;
render(): JSX.Element;
}
}
declare module NODEEDITOR {
class ListLineOption {
label: string;
value: number | string;
}
interface IOptionsLineComponentProps {
label: string;
target: any;
propertyName: string;
options: ListLineOption[];
noDirectUpdate?: boolean;
onSelect?: (value: number | string) => void;
onPropertyChangedObservable?: BABYLON.Observable;
valuesAreStrings?: boolean;
}
export class OptionsLineComponent extends React.Component {
private _localChange;
constructor(props: IOptionsLineComponentProps);
shouldComponentUpdate(nextProps: IOptionsLineComponentProps, nextState: {
value: number;
}): boolean;
raiseOnPropertyChanged(newValue: number | string, previousValue: number | string): void;
updateValue(valueString: string): void;
render(): JSX.Element;
}
}
declare module NODEEDITOR {
export interface IColor3LineComponentProps {
label: string;
target: any;
propertyName: string;
onPropertyChangedObservable?: BABYLON.Observable;
}
export class Color3LineComponent extends React.Component {
private _localChange;
constructor(props: IColor3LineComponentProps);
shouldComponentUpdate(nextProps: IColor3LineComponentProps, nextState: {
color: BABYLON.Color3;
}): boolean;
onChange(newValue: string): void;
switchExpandState(): void;
raiseOnPropertyChanged(previousValue: BABYLON.Color3): void;
updateStateR(value: number): void;
updateStateG(value: number): void;
updateStateB(value: number): void;
copyToClipboard(): void;
render(): JSX.Element;
}
}
declare module NODEEDITOR {
interface IColor3PropertyTabComponentProps {
globalState: GlobalState;
connection: BABYLON.NodeMaterialConnectionPoint;
}
export class Color3PropertyTabComponent extends React.Component {
render(): JSX.Element;
}
}
declare module NODEEDITOR {
interface IInputPropertyTabComponentProps {
globalState: GlobalState;
inputNode: InputNodeModel;
}
export class InputPropertyTabComponentProps extends React.Component {
constructor(props: IInputPropertyTabComponentProps);
renderValue(globalState: GlobalState): JSX.Element | null;
setDefaultValue(): void;
render(): JSX.Element;
}
}
declare module NODEEDITOR {
/**
* Generic node model which stores information about a node editor block
*/
export class InputNodeModel extends DefaultNodeModel {
connection?: BABYLON.NodeMaterialConnectionPoint;
/**
* Constructs the node model
*/
constructor();
renderProperties(globalState: GlobalState): JSX.Element | null;
}
}
declare module NODEEDITOR {
/**
* GenericNodeWidgetProps
*/
export interface InputNodeWidgetProps {
node: BABYLON.Nullable;
globalState: GlobalState;
}
/**
* Used to display a node block for the node editor
*/
export class InputNodeWidget extends React.Component {
/**
* Creates a GenericNodeWidget
* @param props
*/
constructor(props: InputNodeWidgetProps);
render(): JSX.Element;
}
}
declare module NODEEDITOR {
/**
* Node factory which creates editor nodes
*/
export class InputNodeFactory extends SRD.AbstractNodeFactory {
private _globalState;
/**
* Constructs a GenericNodeFactory
*/
constructor(globalState: GlobalState);
/**
* Generates a node widget
* @param diagramEngine diagram engine
* @param node node to generate
* @returns node widget jsx
*/
generateReactWidget(diagramEngine: SRD.DiagramEngine, node: InputNodeModel): JSX.Element;
/**
* Gets a new instance of a node model
* @returns input node model
*/
getNewInstance(): InputNodeModel;
}
}
declare module NODEEDITOR {
interface IGraphEditorProps {
globalState: GlobalState;
}
export class NodeCreationOptions {
column: number;
nodeMaterialBlock?: BABYLON.NodeMaterialBlock;
type?: string;
connection?: BABYLON.NodeMaterialConnectionPoint;
}
export class GraphEditor extends React.Component {
private _engine;
private _model;
private _nodes;
/** @hidden */
_toAdd: LinkModel[] | null;
/**
* Current row/column position used when adding new nodes
*/
private _rowPos;
/**
* Creates a node and recursivly creates its parent nodes from it's input
* @param nodeMaterialBlock
*/
createNodeFromObject(options: NodeCreationOptions): DefaultNodeModel;
componentDidMount(): void;
componentWillUnmount(): void;
constructor(props: IGraphEditorProps);
build(): void;
addNodeFromClass(ObjectClass: typeof BABYLON.NodeMaterialBlock): DefaultNodeModel;
addValueNode(type: string, column?: number, connection?: BABYLON.NodeMaterialConnectionPoint): DefaultNodeModel;
render(): JSX.Element;
}
}
declare module NODEEDITOR {
/**
* Generic node model which stores information about a node editor block
*/
export class DefaultNodeModel extends NodeModel {
/**
* The babylon block this node represents
*/
block: BABYLON.Nullable;
ports: {
[s: string]: DefaultPortModel;
};
/**
* Constructs the node model
*/
constructor(key: string);
prepare(options: NodeCreationOptions, nodes: Array, model: DiagramModel, graphEditor: GraphEditor, filterInputs: string[]): void;
renderProperties(globalState: GlobalState): JSX.Element | null;
}
}
declare module NODEEDITOR {
export class GlobalState {
nodeMaterial?: BABYLON.NodeMaterial;
hostElement: HTMLElement;
hostDocument: HTMLDocument;
onSelectionChangedObservable: BABYLON.Observable>;
onRebuildRequiredObservable: BABYLON.Observable;
onResetRequiredObservable: BABYLON.Observable;
onUpdateRequiredObservable: BABYLON.Observable;
}
}
declare module NODEEDITOR {
export class Popup {
static CreatePopup(title: string, windowVariableName: string, width?: number, height?: number): HTMLDivElement | null;
private static _CopyStyles;
}
}
declare module NODEEDITOR {
/**
* Interface used to specify creation options for the node editor
*/
export interface INodeEditorOptions {
nodeMaterial: BABYLON.NodeMaterial;
}
/**
* Class used to create a node editor
*/
export class NodeEditor {
/**
* Show the node editor
* @param options defines the options to use to configure the node editor
*/
static Show(options: INodeEditorOptions): void;
}
}