babylonjs-node-editor 9.3.0 → 9.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/babylon.nodeEditor.d.ts +442 -12
- package/babylon.nodeEditor.module.d.ts +863 -25
- package/package.json +2 -2
package/babylon.nodeEditor.d.ts
CHANGED
|
@@ -2916,7 +2916,69 @@ declare namespace BABYLON.NodeEditor.SharedUIComponents {
|
|
|
2916
2916
|
* @param options The options for the tool.
|
|
2917
2917
|
* @returns A token that can be used to dispose of the tool.
|
|
2918
2918
|
*/
|
|
2919
|
-
export function MakeModularTool(options: ModularToolOptions):
|
|
2919
|
+
export function MakeModularTool(options: ModularToolOptions): {
|
|
2920
|
+
dispose: () => Promise<void>;
|
|
2921
|
+
};
|
|
2922
|
+
|
|
2923
|
+
|
|
2924
|
+
|
|
2925
|
+
}
|
|
2926
|
+
declare namespace BABYLON.NodeEditor {
|
|
2927
|
+
|
|
2928
|
+
|
|
2929
|
+
}
|
|
2930
|
+
declare namespace BABYLON.NodeEditor.SharedUIComponents {
|
|
2931
|
+
/**
|
|
2932
|
+
* Options for creating a modular bridge container.
|
|
2933
|
+
* @experimental
|
|
2934
|
+
* @internal
|
|
2935
|
+
*/
|
|
2936
|
+
export type ModularBridgeOptions = {
|
|
2937
|
+
/**
|
|
2938
|
+
* WebSocket port for the bridge's browser port. Defaults to 4400.
|
|
2939
|
+
*/
|
|
2940
|
+
port?: number;
|
|
2941
|
+
/**
|
|
2942
|
+
* Session display name reported to the bridge. Defaults to `document.title`.
|
|
2943
|
+
*/
|
|
2944
|
+
name?: string;
|
|
2945
|
+
/**
|
|
2946
|
+
* Whether the bridge should automatically enable trying to connect.
|
|
2947
|
+
* Defaults to true.
|
|
2948
|
+
*/
|
|
2949
|
+
autoEnable?: boolean;
|
|
2950
|
+
/**
|
|
2951
|
+
* Additional service definitions to register with the bridge container.
|
|
2952
|
+
*/
|
|
2953
|
+
serviceDefinitions?: readonly BABYLON.NodeEditor.SharedUIComponents.WeaklyTypedServiceDefinition[];
|
|
2954
|
+
};
|
|
2955
|
+
/**
|
|
2956
|
+
* A token returned by {@link MakeModularBridge} that owns the headless
|
|
2957
|
+
* {@link BABYLON.NodeEditor.SharedUIComponents.ServiceContainer}. Dispose it to tear down the bridge and all services.
|
|
2958
|
+
* @experimental
|
|
2959
|
+
* @internal
|
|
2960
|
+
*/
|
|
2961
|
+
export type ModularBridgeToken = BABYLON.IDisposable & {
|
|
2962
|
+
/**
|
|
2963
|
+
* The headless BABYLON.NodeEditor.SharedUIComponents.ServiceContainer that hosts the bridge.
|
|
2964
|
+
*/
|
|
2965
|
+
readonly serviceContainer: BABYLON.NodeEditor.SharedUIComponents.ServiceContainer;
|
|
2966
|
+
/**
|
|
2967
|
+
* Whether this token has been disposed.
|
|
2968
|
+
*/
|
|
2969
|
+
readonly isDisposed: boolean;
|
|
2970
|
+
};
|
|
2971
|
+
/**
|
|
2972
|
+
* Creates a headless {@link BABYLON.NodeEditor.SharedUIComponents.ServiceContainer} that hosts a bridge service.
|
|
2973
|
+
*
|
|
2974
|
+
* The returned token owns the container. Dispose it to tear down the bridge.
|
|
2975
|
+
*
|
|
2976
|
+
* @param options Optional configuration for the bridge.
|
|
2977
|
+
* @returns A {@link ModularBridgeToken} that owns the container.
|
|
2978
|
+
* @experimental
|
|
2979
|
+
* @internal
|
|
2980
|
+
*/
|
|
2981
|
+
export function MakeModularBridge(options?: ModularBridgeOptions): ModularBridgeToken;
|
|
2920
2982
|
|
|
2921
2983
|
|
|
2922
2984
|
|
|
@@ -3436,6 +3498,376 @@ declare namespace BABYLON.NodeEditor.SharedUIComponents {
|
|
|
3436
3498
|
|
|
3437
3499
|
|
|
3438
3500
|
|
|
3501
|
+
}
|
|
3502
|
+
declare namespace BABYLON.NodeEditor {
|
|
3503
|
+
|
|
3504
|
+
|
|
3505
|
+
}
|
|
3506
|
+
declare namespace BABYLON.NodeEditor.SharedUIComponents {
|
|
3507
|
+
/**
|
|
3508
|
+
* Serializable description of a command argument, used in protocol messages.
|
|
3509
|
+
*/
|
|
3510
|
+
export type CommandArgInfo = {
|
|
3511
|
+
/** The name of the argument. */
|
|
3512
|
+
name: string;
|
|
3513
|
+
/** A human-readable description of the argument. */
|
|
3514
|
+
description: string;
|
|
3515
|
+
/** Whether this argument is required. */
|
|
3516
|
+
required?: boolean;
|
|
3517
|
+
/** The type of the argument. Defaults to "string". When "file", the CLI reads the file and sends its contents. */
|
|
3518
|
+
type?: "string" | "file";
|
|
3519
|
+
};
|
|
3520
|
+
/**
|
|
3521
|
+
* Serializable description of a command, used in protocol messages.
|
|
3522
|
+
*/
|
|
3523
|
+
export type CommandInfo = {
|
|
3524
|
+
/** A unique identifier for the command. */
|
|
3525
|
+
id: string;
|
|
3526
|
+
/** A human-readable description of the command. */
|
|
3527
|
+
description: string;
|
|
3528
|
+
/** The arguments this command accepts. */
|
|
3529
|
+
args?: CommandArgInfo[];
|
|
3530
|
+
};
|
|
3531
|
+
/**
|
|
3532
|
+
* Serializable description of a session, used in protocol messages.
|
|
3533
|
+
*/
|
|
3534
|
+
export type SessionInfo = {
|
|
3535
|
+
/** The numeric session identifier. */
|
|
3536
|
+
id: number;
|
|
3537
|
+
/** The display name of the session. */
|
|
3538
|
+
name: string;
|
|
3539
|
+
/** ISO 8601 timestamp of when the session connected. */
|
|
3540
|
+
connectedAt: string;
|
|
3541
|
+
};
|
|
3542
|
+
/**
|
|
3543
|
+
* CLI → Bridge: Request the list of active browser sessions.
|
|
3544
|
+
*/
|
|
3545
|
+
export type SessionsRequest = {
|
|
3546
|
+
/** The message type discriminator. */
|
|
3547
|
+
type: "sessions";
|
|
3548
|
+
};
|
|
3549
|
+
/**
|
|
3550
|
+
* CLI → Bridge: Request the list of commands available from a session.
|
|
3551
|
+
*/
|
|
3552
|
+
export type CommandsRequest = {
|
|
3553
|
+
/** The message type discriminator. */
|
|
3554
|
+
type: "commands";
|
|
3555
|
+
/** The session to query for commands. */
|
|
3556
|
+
sessionId: number;
|
|
3557
|
+
};
|
|
3558
|
+
/**
|
|
3559
|
+
* CLI → Bridge: Execute a command on a session.
|
|
3560
|
+
*/
|
|
3561
|
+
export type ExecRequest = {
|
|
3562
|
+
/** The message type discriminator. */
|
|
3563
|
+
type: "exec";
|
|
3564
|
+
/** The session to execute the command on. */
|
|
3565
|
+
sessionId: number;
|
|
3566
|
+
/** The identifier of the command to execute. */
|
|
3567
|
+
commandId: string;
|
|
3568
|
+
/** Key-value pairs of arguments for the command. */
|
|
3569
|
+
args: Record<string, string>;
|
|
3570
|
+
};
|
|
3571
|
+
/**
|
|
3572
|
+
* CLI → Bridge: Stop the bridge process.
|
|
3573
|
+
*/
|
|
3574
|
+
export type StopRequest = {
|
|
3575
|
+
/** The message type discriminator. */
|
|
3576
|
+
type: "stop";
|
|
3577
|
+
};
|
|
3578
|
+
/**
|
|
3579
|
+
* All messages that the CLI sends to the bridge.
|
|
3580
|
+
*/
|
|
3581
|
+
export type CliRequest = SessionsRequest | CommandsRequest | ExecRequest | StopRequest;
|
|
3582
|
+
/**
|
|
3583
|
+
* Bridge → CLI: Response with the list of active sessions.
|
|
3584
|
+
*/
|
|
3585
|
+
export type SessionsResponse = {
|
|
3586
|
+
/** The message type discriminator. */
|
|
3587
|
+
type: "sessionsResponse";
|
|
3588
|
+
/** The list of active sessions. */
|
|
3589
|
+
sessions: SessionInfo[];
|
|
3590
|
+
};
|
|
3591
|
+
/**
|
|
3592
|
+
* Bridge → CLI: Response with the list of commands from a session.
|
|
3593
|
+
*/
|
|
3594
|
+
export type CommandsResponse = {
|
|
3595
|
+
/** The message type discriminator. */
|
|
3596
|
+
type: "commandsResponse";
|
|
3597
|
+
/** The list of available commands, if successful. */
|
|
3598
|
+
commands?: CommandInfo[];
|
|
3599
|
+
/** An error message, if the request failed. */
|
|
3600
|
+
error?: string;
|
|
3601
|
+
};
|
|
3602
|
+
/**
|
|
3603
|
+
* Bridge → CLI: Response with the result of a command execution.
|
|
3604
|
+
*/
|
|
3605
|
+
export type ExecResponse = {
|
|
3606
|
+
/** The message type discriminator. */
|
|
3607
|
+
type: "execResponse";
|
|
3608
|
+
/** The result of the command execution, if successful. */
|
|
3609
|
+
result?: string;
|
|
3610
|
+
/** An error message, if the execution failed. */
|
|
3611
|
+
error?: string;
|
|
3612
|
+
};
|
|
3613
|
+
/**
|
|
3614
|
+
* Bridge → CLI: Acknowledgement that the bridge is stopping.
|
|
3615
|
+
*/
|
|
3616
|
+
export type StopResponse = {
|
|
3617
|
+
/** The message type discriminator. */
|
|
3618
|
+
type: "stopResponse";
|
|
3619
|
+
/** Whether the bridge stopped successfully. */
|
|
3620
|
+
success: boolean;
|
|
3621
|
+
};
|
|
3622
|
+
/**
|
|
3623
|
+
* All messages that the bridge sends to the CLI.
|
|
3624
|
+
*/
|
|
3625
|
+
export type CliResponse = SessionsResponse | CommandsResponse | ExecResponse | StopResponse;
|
|
3626
|
+
/**
|
|
3627
|
+
* Browser → Bridge: Register a new session.
|
|
3628
|
+
*/
|
|
3629
|
+
export type RegisterRequest = {
|
|
3630
|
+
/** The message type discriminator. */
|
|
3631
|
+
type: "register";
|
|
3632
|
+
/** The display name for this session. */
|
|
3633
|
+
name: string;
|
|
3634
|
+
};
|
|
3635
|
+
/**
|
|
3636
|
+
* Browser → Bridge: Response to a listCommands request from the bridge.
|
|
3637
|
+
*/
|
|
3638
|
+
export type CommandListResponse = {
|
|
3639
|
+
/** The message type discriminator. */
|
|
3640
|
+
type: "commandListResponse";
|
|
3641
|
+
/** The identifier of the original request. */
|
|
3642
|
+
requestId: string;
|
|
3643
|
+
/** The list of registered commands. */
|
|
3644
|
+
commands: CommandInfo[];
|
|
3645
|
+
};
|
|
3646
|
+
/**
|
|
3647
|
+
* Browser → Bridge: Response to an execCommand request from the bridge.
|
|
3648
|
+
*/
|
|
3649
|
+
export type CommandResponse = {
|
|
3650
|
+
/** The message type discriminator. */
|
|
3651
|
+
type: "commandResponse";
|
|
3652
|
+
/** The identifier of the original request. */
|
|
3653
|
+
requestId: string;
|
|
3654
|
+
/** The result of the command execution, if successful. */
|
|
3655
|
+
result?: string;
|
|
3656
|
+
/** An error message, if the execution failed. */
|
|
3657
|
+
error?: string;
|
|
3658
|
+
};
|
|
3659
|
+
/**
|
|
3660
|
+
* Browser → Bridge: Response to a getInfo request from the bridge.
|
|
3661
|
+
*/
|
|
3662
|
+
export type InfoResponse = {
|
|
3663
|
+
/** The message type discriminator. */
|
|
3664
|
+
type: "infoResponse";
|
|
3665
|
+
/** The identifier of the original request. */
|
|
3666
|
+
requestId: string;
|
|
3667
|
+
/** The current display name of the session. */
|
|
3668
|
+
name: string;
|
|
3669
|
+
};
|
|
3670
|
+
/**
|
|
3671
|
+
* All messages that the browser sends to the bridge.
|
|
3672
|
+
*/
|
|
3673
|
+
export type BrowserRequest = RegisterRequest | CommandListResponse | CommandResponse | InfoResponse;
|
|
3674
|
+
/**
|
|
3675
|
+
* Bridge → Browser: Request the list of registered commands.
|
|
3676
|
+
*/
|
|
3677
|
+
export type ListCommandsRequest = {
|
|
3678
|
+
/** The message type discriminator. */
|
|
3679
|
+
type: "listCommands";
|
|
3680
|
+
/** A unique identifier for this request. */
|
|
3681
|
+
requestId: string;
|
|
3682
|
+
};
|
|
3683
|
+
/**
|
|
3684
|
+
* Bridge → Browser: Request execution of a command.
|
|
3685
|
+
*/
|
|
3686
|
+
export type ExecCommandRequest = {
|
|
3687
|
+
/** The message type discriminator. */
|
|
3688
|
+
type: "execCommand";
|
|
3689
|
+
/** A unique identifier for this request. */
|
|
3690
|
+
requestId: string;
|
|
3691
|
+
/** The identifier of the command to execute. */
|
|
3692
|
+
commandId: string;
|
|
3693
|
+
/** Key-value pairs of arguments for the command. */
|
|
3694
|
+
args: Record<string, string>;
|
|
3695
|
+
};
|
|
3696
|
+
/**
|
|
3697
|
+
* Bridge → Browser: Request current session information.
|
|
3698
|
+
*/
|
|
3699
|
+
export type GetInfoRequest = {
|
|
3700
|
+
/** The message type discriminator. */
|
|
3701
|
+
type: "getInfo";
|
|
3702
|
+
/** A unique identifier for this request. */
|
|
3703
|
+
requestId: string;
|
|
3704
|
+
};
|
|
3705
|
+
/**
|
|
3706
|
+
* All messages that the bridge sends to the browser.
|
|
3707
|
+
*/
|
|
3708
|
+
export type BrowserResponse = ListCommandsRequest | ExecCommandRequest | GetInfoRequest;
|
|
3709
|
+
|
|
3710
|
+
|
|
3711
|
+
|
|
3712
|
+
}
|
|
3713
|
+
declare namespace BABYLON.NodeEditor {
|
|
3714
|
+
|
|
3715
|
+
|
|
3716
|
+
}
|
|
3717
|
+
declare namespace BABYLON.NodeEditor.SharedUIComponents {
|
|
3718
|
+
/**
|
|
3719
|
+
* Options for the CLI bridge service.
|
|
3720
|
+
* @experimental
|
|
3721
|
+
* @internal
|
|
3722
|
+
*/
|
|
3723
|
+
export type BridgeServiceOptions = {
|
|
3724
|
+
/**
|
|
3725
|
+
* The WebSocket port for the bridge's browser port.
|
|
3726
|
+
*/
|
|
3727
|
+
port: number;
|
|
3728
|
+
/**
|
|
3729
|
+
* The session display name sent to the bridge.
|
|
3730
|
+
* Can be a getter to provide a dynamic value that is re-read
|
|
3731
|
+
* each time the bridge queries session information.
|
|
3732
|
+
*/
|
|
3733
|
+
name: string;
|
|
3734
|
+
/**
|
|
3735
|
+
* Whether to automatically enable connecting when the service is created.
|
|
3736
|
+
*/
|
|
3737
|
+
autoEnable: boolean;
|
|
3738
|
+
};
|
|
3739
|
+
/**
|
|
3740
|
+
* Creates the service definition for the CLI Bridge Service.
|
|
3741
|
+
* @param options The options for connecting to the bridge.
|
|
3742
|
+
* @returns A service definition that produces an BABYLON.NodeEditor.SharedUIComponents.IBridgeCommandRegistry and BABYLON.NodeEditor.SharedUIComponents.ICliConnectionStatus.
|
|
3743
|
+
* @experimental
|
|
3744
|
+
* @internal
|
|
3745
|
+
*/
|
|
3746
|
+
export function MakeBridgeServiceDefinition(options: BridgeServiceOptions): BABYLON.NodeEditor.SharedUIComponents.ServiceDefinition<[IBridgeCommandRegistry, BABYLON.NodeEditor.SharedUIComponents.ICliConnectionStatus], []>;
|
|
3747
|
+
|
|
3748
|
+
|
|
3749
|
+
|
|
3750
|
+
}
|
|
3751
|
+
declare namespace BABYLON.NodeEditor {
|
|
3752
|
+
|
|
3753
|
+
|
|
3754
|
+
}
|
|
3755
|
+
declare namespace BABYLON.NodeEditor.SharedUIComponents {
|
|
3756
|
+
/**
|
|
3757
|
+
* The service identity for the CLI connection status.
|
|
3758
|
+
* @experimental
|
|
3759
|
+
* @internal
|
|
3760
|
+
*/
|
|
3761
|
+
export var CliConnectionStatusIdentity: unique symbol;
|
|
3762
|
+
/**
|
|
3763
|
+
* Provides the connection status and enable/disable control for the CLI bridge.
|
|
3764
|
+
* @experimental
|
|
3765
|
+
* @internal
|
|
3766
|
+
*/
|
|
3767
|
+
export interface ICliConnectionStatus extends BABYLON.NodeEditor.SharedUIComponents.IService<typeof CliConnectionStatusIdentity> {
|
|
3768
|
+
/**
|
|
3769
|
+
* Whether the bridge is enabled. When true, the bridge actively tries to
|
|
3770
|
+
* maintain a WebSocket connection. When false, the bridge is disconnected
|
|
3771
|
+
* and idle.
|
|
3772
|
+
*/
|
|
3773
|
+
isEnabled: boolean;
|
|
3774
|
+
/**
|
|
3775
|
+
* Whether the bridge WebSocket is currently connected.
|
|
3776
|
+
*/
|
|
3777
|
+
readonly isConnected: boolean;
|
|
3778
|
+
/**
|
|
3779
|
+
* Observable that fires when either {@link isEnabled} or {@link isConnected} changes.
|
|
3780
|
+
*/
|
|
3781
|
+
readonly onConnectionStatusChanged: BABYLON.IReadonlyObservable<void>;
|
|
3782
|
+
}
|
|
3783
|
+
|
|
3784
|
+
|
|
3785
|
+
|
|
3786
|
+
}
|
|
3787
|
+
declare namespace BABYLON.NodeEditor {
|
|
3788
|
+
|
|
3789
|
+
|
|
3790
|
+
}
|
|
3791
|
+
declare namespace BABYLON.NodeEditor.SharedUIComponents {
|
|
3792
|
+
/**
|
|
3793
|
+
* The type of a bridge command argument, which determines how
|
|
3794
|
+
* the CLI processes the value before sending it to the browser.
|
|
3795
|
+
* @experimental
|
|
3796
|
+
* @internal
|
|
3797
|
+
*/
|
|
3798
|
+
export type BridgeCommandArgType = "string" | "file";
|
|
3799
|
+
/**
|
|
3800
|
+
* Describes an argument for a bridge command.
|
|
3801
|
+
* @experimental
|
|
3802
|
+
* @internal
|
|
3803
|
+
*/
|
|
3804
|
+
export type BridgeCommandArg = {
|
|
3805
|
+
/**
|
|
3806
|
+
* The name of the argument.
|
|
3807
|
+
*/
|
|
3808
|
+
name: string;
|
|
3809
|
+
/**
|
|
3810
|
+
* A description of the argument.
|
|
3811
|
+
*/
|
|
3812
|
+
description: string;
|
|
3813
|
+
/**
|
|
3814
|
+
* Whether the argument is required.
|
|
3815
|
+
*/
|
|
3816
|
+
required?: boolean;
|
|
3817
|
+
/**
|
|
3818
|
+
* The type of the argument. Defaults to "string".
|
|
3819
|
+
* When set to "file", the CLI reads the file at the given path
|
|
3820
|
+
* and passes its contents as the argument value.
|
|
3821
|
+
*/
|
|
3822
|
+
type?: BridgeCommandArgType;
|
|
3823
|
+
};
|
|
3824
|
+
/**
|
|
3825
|
+
* Describes a command that can be invoked from the bridge.
|
|
3826
|
+
* @experimental
|
|
3827
|
+
* @internal
|
|
3828
|
+
*/
|
|
3829
|
+
export type BridgeCommandDescriptor = {
|
|
3830
|
+
/**
|
|
3831
|
+
* A unique identifier for the command.
|
|
3832
|
+
*/
|
|
3833
|
+
id: string;
|
|
3834
|
+
/**
|
|
3835
|
+
* A human-readable description of what the command does.
|
|
3836
|
+
*/
|
|
3837
|
+
description: string;
|
|
3838
|
+
/**
|
|
3839
|
+
* The arguments that this command accepts.
|
|
3840
|
+
*/
|
|
3841
|
+
args?: BridgeCommandArg[];
|
|
3842
|
+
/**
|
|
3843
|
+
* Executes the command with the given arguments and returns a result string.
|
|
3844
|
+
* @param args A map of argument names to their values.
|
|
3845
|
+
* @returns A promise that resolves to the result string.
|
|
3846
|
+
*/
|
|
3847
|
+
executeAsync: (args: Record<string, string>) => Promise<string>;
|
|
3848
|
+
};
|
|
3849
|
+
/**
|
|
3850
|
+
* The service identity for the bridge command registry.
|
|
3851
|
+
* @experimental
|
|
3852
|
+
* @internal
|
|
3853
|
+
*/
|
|
3854
|
+
export var BridgeCommandRegistryIdentity: unique symbol;
|
|
3855
|
+
/**
|
|
3856
|
+
* A registry for commands that can be invoked from the bridge.
|
|
3857
|
+
* @experimental
|
|
3858
|
+
* @internal
|
|
3859
|
+
*/
|
|
3860
|
+
export interface IBridgeCommandRegistry extends BABYLON.NodeEditor.SharedUIComponents.IService<typeof BridgeCommandRegistryIdentity> {
|
|
3861
|
+
/**
|
|
3862
|
+
* Registers a command that can be invoked from the bridge.
|
|
3863
|
+
* @param descriptor The command descriptor.
|
|
3864
|
+
* @returns A disposable token that unregisters the command when disposed.
|
|
3865
|
+
*/
|
|
3866
|
+
addCommand(descriptor: BridgeCommandDescriptor): BABYLON.IDisposable;
|
|
3867
|
+
}
|
|
3868
|
+
|
|
3869
|
+
|
|
3870
|
+
|
|
3439
3871
|
}
|
|
3440
3872
|
declare namespace BABYLON.NodeEditor {
|
|
3441
3873
|
|
|
@@ -3463,14 +3895,13 @@ declare namespace BABYLON.NodeEditor.SharedUIComponents {
|
|
|
3463
3895
|
[Index in keyof ServiceContracts]: ExtractContractIdentity<ServiceContracts[Index]>;
|
|
3464
3896
|
};
|
|
3465
3897
|
type UnionToIntersection<Union> = (Union extends any ? (k: Union) => void : never) extends (k: infer Intersection) => void ? Intersection : never;
|
|
3466
|
-
type MaybePromise<T> = T | Promise<T>;
|
|
3467
3898
|
/**
|
|
3468
3899
|
* A factory function responsible for creating a service instance.
|
|
3469
3900
|
* Consumed services are passed as arguments to the factory function.
|
|
3470
|
-
* The returned value must implement all produced services, and may BABYLON.IDisposable.
|
|
3471
|
-
* If
|
|
3901
|
+
* The returned value must implement all produced services, and may implement BABYLON.IDisposable.
|
|
3902
|
+
* If no services are produced, the returned value may implement BABYLON.IDisposable, otherwise it may return void.
|
|
3472
3903
|
*/
|
|
3473
|
-
export type ServiceFactory<Produces extends IService<symbol>[], Consumes extends IService<symbol>[]> = (...dependencies: [...Consumes
|
|
3904
|
+
export type ServiceFactory<Produces extends IService<symbol>[], Consumes extends IService<symbol>[]> = (...dependencies: [...Consumes]) => Produces extends [] ? Partial<BABYLON.IDisposable> | void : Partial<BABYLON.IDisposable> & UnionToIntersection<Produces[number]>;
|
|
3474
3905
|
/**
|
|
3475
3906
|
* Defines a service, which is a logical unit that consumes other services (dependencies), and optionally produces services that can be consumed by other services (dependents).
|
|
3476
3907
|
*/
|
|
@@ -3539,20 +3970,19 @@ declare namespace BABYLON.NodeEditor.SharedUIComponents {
|
|
|
3539
3970
|
*/
|
|
3540
3971
|
constructor(_friendlyName: string, _parent?: ServiceContainer | undefined);
|
|
3541
3972
|
/**
|
|
3542
|
-
* Adds a set of service definitions
|
|
3973
|
+
* Adds a set of service definitions to the service container.
|
|
3543
3974
|
* The services are sorted based on their dependencies.
|
|
3544
|
-
* @param
|
|
3545
|
-
* @returns A disposable that will remove the service
|
|
3975
|
+
* @param serviceDefinitions The service definitions to register.
|
|
3976
|
+
* @returns A disposable that will remove the service definitions from the service container.
|
|
3546
3977
|
*/
|
|
3547
|
-
|
|
3978
|
+
addServices(...serviceDefinitions: WeaklyTypedServiceDefinition[]): BABYLON.IDisposable;
|
|
3548
3979
|
/**
|
|
3549
3980
|
* Registers a service definition in the service container.
|
|
3550
3981
|
* @param serviceDefinition The service definition to register.
|
|
3551
|
-
* @param abortSignal An optional abort signal.
|
|
3552
3982
|
* @returns A disposable that will remove the service definition from the service container.
|
|
3553
3983
|
*/
|
|
3554
|
-
|
|
3555
|
-
private
|
|
3984
|
+
addService<Produces extends BABYLON.NodeEditor.SharedUIComponents.IService<symbol>[] = [], Consumes extends BABYLON.NodeEditor.SharedUIComponents.IService<symbol>[] = []>(serviceDefinition: BABYLON.NodeEditor.SharedUIComponents.ServiceDefinition<Produces, Consumes>): BABYLON.IDisposable;
|
|
3985
|
+
private _addService;
|
|
3556
3986
|
/**
|
|
3557
3987
|
* Resolves a dependency by contract identity for a consuming service.
|
|
3558
3988
|
* Checks local services first, then walks up the parent chain.
|