babylonjs-node-geometry-editor 9.3.0 → 9.3.1
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.
|
@@ -2805,7 +2805,6 @@ export interface IDisplayManager {
|
|
|
2805
2805
|
|
|
2806
2806
|
}
|
|
2807
2807
|
declare module "babylonjs-node-geometry-editor/modularTool/modularTool" {
|
|
2808
|
-
import { IDisposable } from "babylonjs/index";
|
|
2809
2808
|
import { IExtensionFeed } from "babylonjs-node-geometry-editor/modularTool/extensibility/extensionFeed";
|
|
2810
2809
|
import { WeaklyTypedServiceDefinition, ServiceContainer } from "babylonjs-node-geometry-editor/modularTool/modularity/serviceContainer";
|
|
2811
2810
|
import { ShellServiceOptions } from "babylonjs-node-geometry-editor/modularTool/services/shellService";
|
|
@@ -2846,7 +2845,65 @@ export type ModularToolOptions = {
|
|
|
2846
2845
|
* @param options The options for the tool.
|
|
2847
2846
|
* @returns A token that can be used to dispose of the tool.
|
|
2848
2847
|
*/
|
|
2849
|
-
export function MakeModularTool(options: ModularToolOptions):
|
|
2848
|
+
export function MakeModularTool(options: ModularToolOptions): {
|
|
2849
|
+
dispose: () => Promise<void>;
|
|
2850
|
+
};
|
|
2851
|
+
|
|
2852
|
+
}
|
|
2853
|
+
declare module "babylonjs-node-geometry-editor/modularTool/modularBridge" {
|
|
2854
|
+
import { IDisposable } from "babylonjs/index";
|
|
2855
|
+
import { WeaklyTypedServiceDefinition, ServiceContainer } from "babylonjs-node-geometry-editor/modularTool/modularity/serviceContainer";
|
|
2856
|
+
/**
|
|
2857
|
+
* Options for creating a modular bridge container.
|
|
2858
|
+
* @experimental
|
|
2859
|
+
* @internal
|
|
2860
|
+
*/
|
|
2861
|
+
export type ModularBridgeOptions = {
|
|
2862
|
+
/**
|
|
2863
|
+
* WebSocket port for the bridge's browser port. Defaults to 4400.
|
|
2864
|
+
*/
|
|
2865
|
+
port?: number;
|
|
2866
|
+
/**
|
|
2867
|
+
* Session display name reported to the bridge. Defaults to `document.title`.
|
|
2868
|
+
*/
|
|
2869
|
+
name?: string;
|
|
2870
|
+
/**
|
|
2871
|
+
* Whether the bridge should automatically start trying to connect.
|
|
2872
|
+
* Defaults to false.
|
|
2873
|
+
*/
|
|
2874
|
+
autoStart?: boolean;
|
|
2875
|
+
/**
|
|
2876
|
+
* Additional service definitions to register with the bridge container.
|
|
2877
|
+
*/
|
|
2878
|
+
serviceDefinitions?: readonly WeaklyTypedServiceDefinition[];
|
|
2879
|
+
};
|
|
2880
|
+
/**
|
|
2881
|
+
* A token returned by {@link MakeModularBridge} that owns the headless
|
|
2882
|
+
* {@link ServiceContainer}. Dispose it to tear down the bridge and all services.
|
|
2883
|
+
* @experimental
|
|
2884
|
+
* @internal
|
|
2885
|
+
*/
|
|
2886
|
+
export type ModularBridgeToken = IDisposable & {
|
|
2887
|
+
/**
|
|
2888
|
+
* The headless ServiceContainer that hosts the bridge.
|
|
2889
|
+
*/
|
|
2890
|
+
readonly serviceContainer: ServiceContainer;
|
|
2891
|
+
/**
|
|
2892
|
+
* Whether this token has been disposed.
|
|
2893
|
+
*/
|
|
2894
|
+
readonly isDisposed: boolean;
|
|
2895
|
+
};
|
|
2896
|
+
/**
|
|
2897
|
+
* Creates a headless {@link ServiceContainer} that hosts a bridge service.
|
|
2898
|
+
*
|
|
2899
|
+
* The returned token owns the container. Dispose it to tear down the bridge.
|
|
2900
|
+
*
|
|
2901
|
+
* @param options Optional configuration for the bridge.
|
|
2902
|
+
* @returns A {@link ModularBridgeToken} that owns the container.
|
|
2903
|
+
* @experimental
|
|
2904
|
+
* @internal
|
|
2905
|
+
*/
|
|
2906
|
+
export function MakeModularBridge(options?: ModularBridgeOptions): ModularBridgeToken;
|
|
2850
2907
|
|
|
2851
2908
|
}
|
|
2852
2909
|
declare module "babylonjs-node-geometry-editor/modularTool/themes/babylonTheme" {
|
|
@@ -3326,6 +3383,359 @@ import { ServiceDefinition } from "babylonjs-node-geometry-editor/modularTool/mo
|
|
|
3326
3383
|
import { IShellService } from "babylonjs-node-geometry-editor/modularTool/services/shellService";
|
|
3327
3384
|
export const ExtensionListServiceDefinition: ServiceDefinition<[], [IShellService]>;
|
|
3328
3385
|
|
|
3386
|
+
}
|
|
3387
|
+
declare module "babylonjs-node-geometry-editor/modularTool/services/cli/protocol" {
|
|
3388
|
+
/**
|
|
3389
|
+
* Serializable description of a command argument, used in protocol messages.
|
|
3390
|
+
*/
|
|
3391
|
+
export type CommandArgInfo = {
|
|
3392
|
+
/** The name of the argument. */
|
|
3393
|
+
name: string;
|
|
3394
|
+
/** A human-readable description of the argument. */
|
|
3395
|
+
description: string;
|
|
3396
|
+
/** Whether this argument is required. */
|
|
3397
|
+
required?: boolean;
|
|
3398
|
+
/** The type of the argument. Defaults to "string". When "file", the CLI reads the file and sends its contents. */
|
|
3399
|
+
type?: "string" | "file";
|
|
3400
|
+
};
|
|
3401
|
+
/**
|
|
3402
|
+
* Serializable description of a command, used in protocol messages.
|
|
3403
|
+
*/
|
|
3404
|
+
export type CommandInfo = {
|
|
3405
|
+
/** A unique identifier for the command. */
|
|
3406
|
+
id: string;
|
|
3407
|
+
/** A human-readable description of the command. */
|
|
3408
|
+
description: string;
|
|
3409
|
+
/** The arguments this command accepts. */
|
|
3410
|
+
args?: CommandArgInfo[];
|
|
3411
|
+
};
|
|
3412
|
+
/**
|
|
3413
|
+
* Serializable description of a session, used in protocol messages.
|
|
3414
|
+
*/
|
|
3415
|
+
export type SessionInfo = {
|
|
3416
|
+
/** The numeric session identifier. */
|
|
3417
|
+
id: number;
|
|
3418
|
+
/** The display name of the session. */
|
|
3419
|
+
name: string;
|
|
3420
|
+
/** ISO 8601 timestamp of when the session connected. */
|
|
3421
|
+
connectedAt: string;
|
|
3422
|
+
};
|
|
3423
|
+
/**
|
|
3424
|
+
* CLI → Bridge: Request the list of active browser sessions.
|
|
3425
|
+
*/
|
|
3426
|
+
export type SessionsRequest = {
|
|
3427
|
+
/** The message type discriminator. */
|
|
3428
|
+
type: "sessions";
|
|
3429
|
+
};
|
|
3430
|
+
/**
|
|
3431
|
+
* CLI → Bridge: Request the list of commands available from a session.
|
|
3432
|
+
*/
|
|
3433
|
+
export type CommandsRequest = {
|
|
3434
|
+
/** The message type discriminator. */
|
|
3435
|
+
type: "commands";
|
|
3436
|
+
/** The session to query for commands. */
|
|
3437
|
+
sessionId: number;
|
|
3438
|
+
};
|
|
3439
|
+
/**
|
|
3440
|
+
* CLI → Bridge: Execute a command on a session.
|
|
3441
|
+
*/
|
|
3442
|
+
export type ExecRequest = {
|
|
3443
|
+
/** The message type discriminator. */
|
|
3444
|
+
type: "exec";
|
|
3445
|
+
/** The session to execute the command on. */
|
|
3446
|
+
sessionId: number;
|
|
3447
|
+
/** The identifier of the command to execute. */
|
|
3448
|
+
commandId: string;
|
|
3449
|
+
/** Key-value pairs of arguments for the command. */
|
|
3450
|
+
args: Record<string, string>;
|
|
3451
|
+
};
|
|
3452
|
+
/**
|
|
3453
|
+
* CLI → Bridge: Stop the bridge process.
|
|
3454
|
+
*/
|
|
3455
|
+
export type StopRequest = {
|
|
3456
|
+
/** The message type discriminator. */
|
|
3457
|
+
type: "stop";
|
|
3458
|
+
};
|
|
3459
|
+
/**
|
|
3460
|
+
* All messages that the CLI sends to the bridge.
|
|
3461
|
+
*/
|
|
3462
|
+
export type CliRequest = SessionsRequest | CommandsRequest | ExecRequest | StopRequest;
|
|
3463
|
+
/**
|
|
3464
|
+
* Bridge → CLI: Response with the list of active sessions.
|
|
3465
|
+
*/
|
|
3466
|
+
export type SessionsResponse = {
|
|
3467
|
+
/** The message type discriminator. */
|
|
3468
|
+
type: "sessionsResponse";
|
|
3469
|
+
/** The list of active sessions. */
|
|
3470
|
+
sessions: SessionInfo[];
|
|
3471
|
+
};
|
|
3472
|
+
/**
|
|
3473
|
+
* Bridge → CLI: Response with the list of commands from a session.
|
|
3474
|
+
*/
|
|
3475
|
+
export type CommandsResponse = {
|
|
3476
|
+
/** The message type discriminator. */
|
|
3477
|
+
type: "commandsResponse";
|
|
3478
|
+
/** The list of available commands, if successful. */
|
|
3479
|
+
commands?: CommandInfo[];
|
|
3480
|
+
/** An error message, if the request failed. */
|
|
3481
|
+
error?: string;
|
|
3482
|
+
};
|
|
3483
|
+
/**
|
|
3484
|
+
* Bridge → CLI: Response with the result of a command execution.
|
|
3485
|
+
*/
|
|
3486
|
+
export type ExecResponse = {
|
|
3487
|
+
/** The message type discriminator. */
|
|
3488
|
+
type: "execResponse";
|
|
3489
|
+
/** The result of the command execution, if successful. */
|
|
3490
|
+
result?: string;
|
|
3491
|
+
/** An error message, if the execution failed. */
|
|
3492
|
+
error?: string;
|
|
3493
|
+
};
|
|
3494
|
+
/**
|
|
3495
|
+
* Bridge → CLI: Acknowledgement that the bridge is stopping.
|
|
3496
|
+
*/
|
|
3497
|
+
export type StopResponse = {
|
|
3498
|
+
/** The message type discriminator. */
|
|
3499
|
+
type: "stopResponse";
|
|
3500
|
+
/** Whether the bridge stopped successfully. */
|
|
3501
|
+
success: boolean;
|
|
3502
|
+
};
|
|
3503
|
+
/**
|
|
3504
|
+
* All messages that the bridge sends to the CLI.
|
|
3505
|
+
*/
|
|
3506
|
+
export type CliResponse = SessionsResponse | CommandsResponse | ExecResponse | StopResponse;
|
|
3507
|
+
/**
|
|
3508
|
+
* Browser → Bridge: Register a new session.
|
|
3509
|
+
*/
|
|
3510
|
+
export type RegisterRequest = {
|
|
3511
|
+
/** The message type discriminator. */
|
|
3512
|
+
type: "register";
|
|
3513
|
+
/** The display name for this session. */
|
|
3514
|
+
name: string;
|
|
3515
|
+
};
|
|
3516
|
+
/**
|
|
3517
|
+
* Browser → Bridge: Response to a listCommands request from the bridge.
|
|
3518
|
+
*/
|
|
3519
|
+
export type CommandListResponse = {
|
|
3520
|
+
/** The message type discriminator. */
|
|
3521
|
+
type: "commandListResponse";
|
|
3522
|
+
/** The identifier of the original request. */
|
|
3523
|
+
requestId: string;
|
|
3524
|
+
/** The list of registered commands. */
|
|
3525
|
+
commands: CommandInfo[];
|
|
3526
|
+
};
|
|
3527
|
+
/**
|
|
3528
|
+
* Browser → Bridge: Response to an execCommand request from the bridge.
|
|
3529
|
+
*/
|
|
3530
|
+
export type CommandResponse = {
|
|
3531
|
+
/** The message type discriminator. */
|
|
3532
|
+
type: "commandResponse";
|
|
3533
|
+
/** The identifier of the original request. */
|
|
3534
|
+
requestId: string;
|
|
3535
|
+
/** The result of the command execution, if successful. */
|
|
3536
|
+
result?: string;
|
|
3537
|
+
/** An error message, if the execution failed. */
|
|
3538
|
+
error?: string;
|
|
3539
|
+
};
|
|
3540
|
+
/**
|
|
3541
|
+
* Browser → Bridge: Response to a getInfo request from the bridge.
|
|
3542
|
+
*/
|
|
3543
|
+
export type InfoResponse = {
|
|
3544
|
+
/** The message type discriminator. */
|
|
3545
|
+
type: "infoResponse";
|
|
3546
|
+
/** The identifier of the original request. */
|
|
3547
|
+
requestId: string;
|
|
3548
|
+
/** The current display name of the session. */
|
|
3549
|
+
name: string;
|
|
3550
|
+
};
|
|
3551
|
+
/**
|
|
3552
|
+
* All messages that the browser sends to the bridge.
|
|
3553
|
+
*/
|
|
3554
|
+
export type BrowserRequest = RegisterRequest | CommandListResponse | CommandResponse | InfoResponse;
|
|
3555
|
+
/**
|
|
3556
|
+
* Bridge → Browser: Request the list of registered commands.
|
|
3557
|
+
*/
|
|
3558
|
+
export type ListCommandsRequest = {
|
|
3559
|
+
/** The message type discriminator. */
|
|
3560
|
+
type: "listCommands";
|
|
3561
|
+
/** A unique identifier for this request. */
|
|
3562
|
+
requestId: string;
|
|
3563
|
+
};
|
|
3564
|
+
/**
|
|
3565
|
+
* Bridge → Browser: Request execution of a command.
|
|
3566
|
+
*/
|
|
3567
|
+
export type ExecCommandRequest = {
|
|
3568
|
+
/** The message type discriminator. */
|
|
3569
|
+
type: "execCommand";
|
|
3570
|
+
/** A unique identifier for this request. */
|
|
3571
|
+
requestId: string;
|
|
3572
|
+
/** The identifier of the command to execute. */
|
|
3573
|
+
commandId: string;
|
|
3574
|
+
/** Key-value pairs of arguments for the command. */
|
|
3575
|
+
args: Record<string, string>;
|
|
3576
|
+
};
|
|
3577
|
+
/**
|
|
3578
|
+
* Bridge → Browser: Request current session information.
|
|
3579
|
+
*/
|
|
3580
|
+
export type GetInfoRequest = {
|
|
3581
|
+
/** The message type discriminator. */
|
|
3582
|
+
type: "getInfo";
|
|
3583
|
+
/** A unique identifier for this request. */
|
|
3584
|
+
requestId: string;
|
|
3585
|
+
};
|
|
3586
|
+
/**
|
|
3587
|
+
* All messages that the bridge sends to the browser.
|
|
3588
|
+
*/
|
|
3589
|
+
export type BrowserResponse = ListCommandsRequest | ExecCommandRequest | GetInfoRequest;
|
|
3590
|
+
|
|
3591
|
+
}
|
|
3592
|
+
declare module "babylonjs-node-geometry-editor/modularTool/services/cli/bridgeService" {
|
|
3593
|
+
import { ServiceDefinition } from "babylonjs-node-geometry-editor/modularTool/modularity/serviceDefinition";
|
|
3594
|
+
import { ICliConnectionStatus } from "babylonjs-node-geometry-editor/modularTool/services/cli/bridgeConnectionStatus";
|
|
3595
|
+
import { IBridgeCommandRegistry } from "babylonjs-node-geometry-editor/modularTool/services/cli/bridgeCommandRegistry";
|
|
3596
|
+
/**
|
|
3597
|
+
* Options for the CLI bridge service.
|
|
3598
|
+
* @experimental
|
|
3599
|
+
* @internal
|
|
3600
|
+
*/
|
|
3601
|
+
export type BridgeServiceOptions = {
|
|
3602
|
+
/**
|
|
3603
|
+
* The WebSocket port for the bridge's browser port.
|
|
3604
|
+
*/
|
|
3605
|
+
port: number;
|
|
3606
|
+
/**
|
|
3607
|
+
* The session display name sent to the bridge.
|
|
3608
|
+
* Can be a getter to provide a dynamic value that is re-read
|
|
3609
|
+
* each time the bridge queries session information.
|
|
3610
|
+
*/
|
|
3611
|
+
name: string;
|
|
3612
|
+
/**
|
|
3613
|
+
* Whether to automatically start connecting when the service is created.
|
|
3614
|
+
*/
|
|
3615
|
+
autoStart: boolean;
|
|
3616
|
+
};
|
|
3617
|
+
/**
|
|
3618
|
+
* Creates the service definition for the CLI Bridge Service.
|
|
3619
|
+
* @param options The options for connecting to the bridge.
|
|
3620
|
+
* @returns A service definition that produces an IBridgeCommandRegistry and ICliConnectionStatus.
|
|
3621
|
+
* @experimental
|
|
3622
|
+
* @internal
|
|
3623
|
+
*/
|
|
3624
|
+
export function MakeBridgeServiceDefinition(options: BridgeServiceOptions): ServiceDefinition<[IBridgeCommandRegistry, ICliConnectionStatus], []>;
|
|
3625
|
+
|
|
3626
|
+
}
|
|
3627
|
+
declare module "babylonjs-node-geometry-editor/modularTool/services/cli/bridgeConnectionStatus" {
|
|
3628
|
+
import { IReadonlyObservable } from "babylonjs/index";
|
|
3629
|
+
import { IService } from "babylonjs-node-geometry-editor/modularTool/modularity/serviceDefinition";
|
|
3630
|
+
/**
|
|
3631
|
+
* The service identity for the CLI connection status.
|
|
3632
|
+
* @experimental
|
|
3633
|
+
* @internal
|
|
3634
|
+
*/
|
|
3635
|
+
export const CliConnectionStatusIdentity: unique symbol;
|
|
3636
|
+
/**
|
|
3637
|
+
* Provides the connection status and enable/disable control for the CLI bridge.
|
|
3638
|
+
* @experimental
|
|
3639
|
+
* @internal
|
|
3640
|
+
*/
|
|
3641
|
+
export interface ICliConnectionStatus extends IService<typeof CliConnectionStatusIdentity> {
|
|
3642
|
+
/**
|
|
3643
|
+
* Whether the bridge is enabled. When true, the bridge actively tries to
|
|
3644
|
+
* maintain a WebSocket connection. When false, the bridge is disconnected
|
|
3645
|
+
* and idle.
|
|
3646
|
+
*/
|
|
3647
|
+
isEnabled: boolean;
|
|
3648
|
+
/**
|
|
3649
|
+
* Whether the bridge WebSocket is currently connected.
|
|
3650
|
+
*/
|
|
3651
|
+
readonly isConnected: boolean;
|
|
3652
|
+
/**
|
|
3653
|
+
* Observable that fires when either {@link isEnabled} or {@link isConnected} changes.
|
|
3654
|
+
*/
|
|
3655
|
+
readonly onConnectionStatusChanged: IReadonlyObservable<void>;
|
|
3656
|
+
}
|
|
3657
|
+
|
|
3658
|
+
}
|
|
3659
|
+
declare module "babylonjs-node-geometry-editor/modularTool/services/cli/bridgeCommandRegistry" {
|
|
3660
|
+
import { IDisposable } from "babylonjs/index";
|
|
3661
|
+
import { IService } from "babylonjs-node-geometry-editor/modularTool/modularity/serviceDefinition";
|
|
3662
|
+
/**
|
|
3663
|
+
* The type of a bridge command argument, which determines how
|
|
3664
|
+
* the CLI processes the value before sending it to the browser.
|
|
3665
|
+
* @experimental
|
|
3666
|
+
* @internal
|
|
3667
|
+
*/
|
|
3668
|
+
export type BridgeCommandArgType = "string" | "file";
|
|
3669
|
+
/**
|
|
3670
|
+
* Describes an argument for a bridge command.
|
|
3671
|
+
* @experimental
|
|
3672
|
+
* @internal
|
|
3673
|
+
*/
|
|
3674
|
+
export type BridgeCommandArg = {
|
|
3675
|
+
/**
|
|
3676
|
+
* The name of the argument.
|
|
3677
|
+
*/
|
|
3678
|
+
name: string;
|
|
3679
|
+
/**
|
|
3680
|
+
* A description of the argument.
|
|
3681
|
+
*/
|
|
3682
|
+
description: string;
|
|
3683
|
+
/**
|
|
3684
|
+
* Whether the argument is required.
|
|
3685
|
+
*/
|
|
3686
|
+
required?: boolean;
|
|
3687
|
+
/**
|
|
3688
|
+
* The type of the argument. Defaults to "string".
|
|
3689
|
+
* When set to "file", the CLI reads the file at the given path
|
|
3690
|
+
* and passes its contents as the argument value.
|
|
3691
|
+
*/
|
|
3692
|
+
type?: BridgeCommandArgType;
|
|
3693
|
+
};
|
|
3694
|
+
/**
|
|
3695
|
+
* Describes a command that can be invoked from the bridge.
|
|
3696
|
+
* @experimental
|
|
3697
|
+
* @internal
|
|
3698
|
+
*/
|
|
3699
|
+
export type BridgeCommandDescriptor = {
|
|
3700
|
+
/**
|
|
3701
|
+
* A unique identifier for the command.
|
|
3702
|
+
*/
|
|
3703
|
+
id: string;
|
|
3704
|
+
/**
|
|
3705
|
+
* A human-readable description of what the command does.
|
|
3706
|
+
*/
|
|
3707
|
+
description: string;
|
|
3708
|
+
/**
|
|
3709
|
+
* The arguments that this command accepts.
|
|
3710
|
+
*/
|
|
3711
|
+
args?: BridgeCommandArg[];
|
|
3712
|
+
/**
|
|
3713
|
+
* Executes the command with the given arguments and returns a result string.
|
|
3714
|
+
* @param args A map of argument names to their values.
|
|
3715
|
+
* @returns A promise that resolves to the result string.
|
|
3716
|
+
*/
|
|
3717
|
+
executeAsync: (args: Record<string, string>) => Promise<string>;
|
|
3718
|
+
};
|
|
3719
|
+
/**
|
|
3720
|
+
* The service identity for the bridge command registry.
|
|
3721
|
+
* @experimental
|
|
3722
|
+
* @internal
|
|
3723
|
+
*/
|
|
3724
|
+
export const BridgeCommandRegistryIdentity: unique symbol;
|
|
3725
|
+
/**
|
|
3726
|
+
* A registry for commands that can be invoked from the bridge.
|
|
3727
|
+
* @experimental
|
|
3728
|
+
* @internal
|
|
3729
|
+
*/
|
|
3730
|
+
export interface IBridgeCommandRegistry extends IService<typeof BridgeCommandRegistryIdentity> {
|
|
3731
|
+
/**
|
|
3732
|
+
* Registers a command that can be invoked from the bridge.
|
|
3733
|
+
* @param descriptor The command descriptor.
|
|
3734
|
+
* @returns A disposable token that unregisters the command when disposed.
|
|
3735
|
+
*/
|
|
3736
|
+
addCommand(descriptor: BridgeCommandDescriptor): IDisposable;
|
|
3737
|
+
}
|
|
3738
|
+
|
|
3329
3739
|
}
|
|
3330
3740
|
declare module "babylonjs-node-geometry-editor/modularTool/modularity/serviceDefinition" {
|
|
3331
3741
|
import { IDisposable } from "babylonjs/index";
|
|
@@ -3350,14 +3760,13 @@ type ExtractContractIdentities<ServiceContracts extends IService<symbol>[]> = {
|
|
|
3350
3760
|
[Index in keyof ServiceContracts]: ExtractContractIdentity<ServiceContracts[Index]>;
|
|
3351
3761
|
};
|
|
3352
3762
|
type UnionToIntersection<Union> = (Union extends any ? (k: Union) => void : never) extends (k: infer Intersection) => void ? Intersection : never;
|
|
3353
|
-
type MaybePromise<T> = T | Promise<T>;
|
|
3354
3763
|
/**
|
|
3355
3764
|
* A factory function responsible for creating a service instance.
|
|
3356
3765
|
* Consumed services are passed as arguments to the factory function.
|
|
3357
|
-
* The returned value must implement all produced services, and may IDisposable.
|
|
3358
|
-
* If
|
|
3766
|
+
* The returned value must implement all produced services, and may implement IDisposable.
|
|
3767
|
+
* If no services are produced, the returned value may implement IDisposable, otherwise it may return void.
|
|
3359
3768
|
*/
|
|
3360
|
-
export type ServiceFactory<Produces extends IService<symbol>[], Consumes extends IService<symbol>[]> = (...dependencies: [...Consumes
|
|
3769
|
+
export type ServiceFactory<Produces extends IService<symbol>[], Consumes extends IService<symbol>[]> = (...dependencies: [...Consumes]) => Produces extends [] ? Partial<IDisposable> | void : Partial<IDisposable> & UnionToIntersection<Produces[number]>;
|
|
3361
3770
|
/**
|
|
3362
3771
|
* 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).
|
|
3363
3772
|
*/
|
|
@@ -3423,20 +3832,19 @@ export class ServiceContainer implements IDisposable {
|
|
|
3423
3832
|
*/
|
|
3424
3833
|
constructor(_friendlyName: string, _parent?: ServiceContainer | undefined);
|
|
3425
3834
|
/**
|
|
3426
|
-
* Adds a set of service definitions
|
|
3835
|
+
* Adds a set of service definitions to the service container.
|
|
3427
3836
|
* The services are sorted based on their dependencies.
|
|
3428
|
-
* @param
|
|
3429
|
-
* @returns A disposable that will remove the service
|
|
3837
|
+
* @param serviceDefinitions The service definitions to register.
|
|
3838
|
+
* @returns A disposable that will remove the service definitions from the service container.
|
|
3430
3839
|
*/
|
|
3431
|
-
|
|
3840
|
+
addServices(...serviceDefinitions: WeaklyTypedServiceDefinition[]): IDisposable;
|
|
3432
3841
|
/**
|
|
3433
3842
|
* Registers a service definition in the service container.
|
|
3434
3843
|
* @param serviceDefinition The service definition to register.
|
|
3435
|
-
* @param abortSignal An optional abort signal.
|
|
3436
3844
|
* @returns A disposable that will remove the service definition from the service container.
|
|
3437
3845
|
*/
|
|
3438
|
-
|
|
3439
|
-
private
|
|
3846
|
+
addService<Produces extends IService<symbol>[] = [], Consumes extends IService<symbol>[] = []>(serviceDefinition: ServiceDefinition<Produces, Consumes>): IDisposable;
|
|
3847
|
+
private _addService;
|
|
3440
3848
|
/**
|
|
3441
3849
|
* Resolves a dependency by contract identity for a consuming service.
|
|
3442
3850
|
* Checks local services first, then walks up the parent chain.
|
|
@@ -10635,7 +11043,69 @@ declare namespace BABYLON.NodeGeometryEditor.SharedUIComponents {
|
|
|
10635
11043
|
* @param options The options for the tool.
|
|
10636
11044
|
* @returns A token that can be used to dispose of the tool.
|
|
10637
11045
|
*/
|
|
10638
|
-
export function MakeModularTool(options: ModularToolOptions):
|
|
11046
|
+
export function MakeModularTool(options: ModularToolOptions): {
|
|
11047
|
+
dispose: () => Promise<void>;
|
|
11048
|
+
};
|
|
11049
|
+
|
|
11050
|
+
|
|
11051
|
+
|
|
11052
|
+
}
|
|
11053
|
+
declare namespace BABYLON.NodeGeometryEditor {
|
|
11054
|
+
|
|
11055
|
+
|
|
11056
|
+
}
|
|
11057
|
+
declare namespace BABYLON.NodeGeometryEditor.SharedUIComponents {
|
|
11058
|
+
/**
|
|
11059
|
+
* Options for creating a modular bridge container.
|
|
11060
|
+
* @experimental
|
|
11061
|
+
* @internal
|
|
11062
|
+
*/
|
|
11063
|
+
export type ModularBridgeOptions = {
|
|
11064
|
+
/**
|
|
11065
|
+
* WebSocket port for the bridge's browser port. Defaults to 4400.
|
|
11066
|
+
*/
|
|
11067
|
+
port?: number;
|
|
11068
|
+
/**
|
|
11069
|
+
* Session display name reported to the bridge. Defaults to `document.title`.
|
|
11070
|
+
*/
|
|
11071
|
+
name?: string;
|
|
11072
|
+
/**
|
|
11073
|
+
* Whether the bridge should automatically start trying to connect.
|
|
11074
|
+
* Defaults to false.
|
|
11075
|
+
*/
|
|
11076
|
+
autoStart?: boolean;
|
|
11077
|
+
/**
|
|
11078
|
+
* Additional service definitions to register with the bridge container.
|
|
11079
|
+
*/
|
|
11080
|
+
serviceDefinitions?: readonly BABYLON.NodeGeometryEditor.SharedUIComponents.WeaklyTypedServiceDefinition[];
|
|
11081
|
+
};
|
|
11082
|
+
/**
|
|
11083
|
+
* A token returned by {@link MakeModularBridge} that owns the headless
|
|
11084
|
+
* {@link BABYLON.NodeGeometryEditor.SharedUIComponents.ServiceContainer}. Dispose it to tear down the bridge and all services.
|
|
11085
|
+
* @experimental
|
|
11086
|
+
* @internal
|
|
11087
|
+
*/
|
|
11088
|
+
export type ModularBridgeToken = BABYLON.IDisposable & {
|
|
11089
|
+
/**
|
|
11090
|
+
* The headless BABYLON.NodeGeometryEditor.SharedUIComponents.ServiceContainer that hosts the bridge.
|
|
11091
|
+
*/
|
|
11092
|
+
readonly serviceContainer: BABYLON.NodeGeometryEditor.SharedUIComponents.ServiceContainer;
|
|
11093
|
+
/**
|
|
11094
|
+
* Whether this token has been disposed.
|
|
11095
|
+
*/
|
|
11096
|
+
readonly isDisposed: boolean;
|
|
11097
|
+
};
|
|
11098
|
+
/**
|
|
11099
|
+
* Creates a headless {@link BABYLON.NodeGeometryEditor.SharedUIComponents.ServiceContainer} that hosts a bridge service.
|
|
11100
|
+
*
|
|
11101
|
+
* The returned token owns the container. Dispose it to tear down the bridge.
|
|
11102
|
+
*
|
|
11103
|
+
* @param options Optional configuration for the bridge.
|
|
11104
|
+
* @returns A {@link ModularBridgeToken} that owns the container.
|
|
11105
|
+
* @experimental
|
|
11106
|
+
* @internal
|
|
11107
|
+
*/
|
|
11108
|
+
export function MakeModularBridge(options?: ModularBridgeOptions): ModularBridgeToken;
|
|
10639
11109
|
|
|
10640
11110
|
|
|
10641
11111
|
|
|
@@ -11155,6 +11625,376 @@ declare namespace BABYLON.NodeGeometryEditor.SharedUIComponents {
|
|
|
11155
11625
|
|
|
11156
11626
|
|
|
11157
11627
|
|
|
11628
|
+
}
|
|
11629
|
+
declare namespace BABYLON.NodeGeometryEditor {
|
|
11630
|
+
|
|
11631
|
+
|
|
11632
|
+
}
|
|
11633
|
+
declare namespace BABYLON.NodeGeometryEditor.SharedUIComponents {
|
|
11634
|
+
/**
|
|
11635
|
+
* Serializable description of a command argument, used in protocol messages.
|
|
11636
|
+
*/
|
|
11637
|
+
export type CommandArgInfo = {
|
|
11638
|
+
/** The name of the argument. */
|
|
11639
|
+
name: string;
|
|
11640
|
+
/** A human-readable description of the argument. */
|
|
11641
|
+
description: string;
|
|
11642
|
+
/** Whether this argument is required. */
|
|
11643
|
+
required?: boolean;
|
|
11644
|
+
/** The type of the argument. Defaults to "string". When "file", the CLI reads the file and sends its contents. */
|
|
11645
|
+
type?: "string" | "file";
|
|
11646
|
+
};
|
|
11647
|
+
/**
|
|
11648
|
+
* Serializable description of a command, used in protocol messages.
|
|
11649
|
+
*/
|
|
11650
|
+
export type CommandInfo = {
|
|
11651
|
+
/** A unique identifier for the command. */
|
|
11652
|
+
id: string;
|
|
11653
|
+
/** A human-readable description of the command. */
|
|
11654
|
+
description: string;
|
|
11655
|
+
/** The arguments this command accepts. */
|
|
11656
|
+
args?: CommandArgInfo[];
|
|
11657
|
+
};
|
|
11658
|
+
/**
|
|
11659
|
+
* Serializable description of a session, used in protocol messages.
|
|
11660
|
+
*/
|
|
11661
|
+
export type SessionInfo = {
|
|
11662
|
+
/** The numeric session identifier. */
|
|
11663
|
+
id: number;
|
|
11664
|
+
/** The display name of the session. */
|
|
11665
|
+
name: string;
|
|
11666
|
+
/** ISO 8601 timestamp of when the session connected. */
|
|
11667
|
+
connectedAt: string;
|
|
11668
|
+
};
|
|
11669
|
+
/**
|
|
11670
|
+
* CLI → Bridge: Request the list of active browser sessions.
|
|
11671
|
+
*/
|
|
11672
|
+
export type SessionsRequest = {
|
|
11673
|
+
/** The message type discriminator. */
|
|
11674
|
+
type: "sessions";
|
|
11675
|
+
};
|
|
11676
|
+
/**
|
|
11677
|
+
* CLI → Bridge: Request the list of commands available from a session.
|
|
11678
|
+
*/
|
|
11679
|
+
export type CommandsRequest = {
|
|
11680
|
+
/** The message type discriminator. */
|
|
11681
|
+
type: "commands";
|
|
11682
|
+
/** The session to query for commands. */
|
|
11683
|
+
sessionId: number;
|
|
11684
|
+
};
|
|
11685
|
+
/**
|
|
11686
|
+
* CLI → Bridge: Execute a command on a session.
|
|
11687
|
+
*/
|
|
11688
|
+
export type ExecRequest = {
|
|
11689
|
+
/** The message type discriminator. */
|
|
11690
|
+
type: "exec";
|
|
11691
|
+
/** The session to execute the command on. */
|
|
11692
|
+
sessionId: number;
|
|
11693
|
+
/** The identifier of the command to execute. */
|
|
11694
|
+
commandId: string;
|
|
11695
|
+
/** Key-value pairs of arguments for the command. */
|
|
11696
|
+
args: Record<string, string>;
|
|
11697
|
+
};
|
|
11698
|
+
/**
|
|
11699
|
+
* CLI → Bridge: Stop the bridge process.
|
|
11700
|
+
*/
|
|
11701
|
+
export type StopRequest = {
|
|
11702
|
+
/** The message type discriminator. */
|
|
11703
|
+
type: "stop";
|
|
11704
|
+
};
|
|
11705
|
+
/**
|
|
11706
|
+
* All messages that the CLI sends to the bridge.
|
|
11707
|
+
*/
|
|
11708
|
+
export type CliRequest = SessionsRequest | CommandsRequest | ExecRequest | StopRequest;
|
|
11709
|
+
/**
|
|
11710
|
+
* Bridge → CLI: Response with the list of active sessions.
|
|
11711
|
+
*/
|
|
11712
|
+
export type SessionsResponse = {
|
|
11713
|
+
/** The message type discriminator. */
|
|
11714
|
+
type: "sessionsResponse";
|
|
11715
|
+
/** The list of active sessions. */
|
|
11716
|
+
sessions: SessionInfo[];
|
|
11717
|
+
};
|
|
11718
|
+
/**
|
|
11719
|
+
* Bridge → CLI: Response with the list of commands from a session.
|
|
11720
|
+
*/
|
|
11721
|
+
export type CommandsResponse = {
|
|
11722
|
+
/** The message type discriminator. */
|
|
11723
|
+
type: "commandsResponse";
|
|
11724
|
+
/** The list of available commands, if successful. */
|
|
11725
|
+
commands?: CommandInfo[];
|
|
11726
|
+
/** An error message, if the request failed. */
|
|
11727
|
+
error?: string;
|
|
11728
|
+
};
|
|
11729
|
+
/**
|
|
11730
|
+
* Bridge → CLI: Response with the result of a command execution.
|
|
11731
|
+
*/
|
|
11732
|
+
export type ExecResponse = {
|
|
11733
|
+
/** The message type discriminator. */
|
|
11734
|
+
type: "execResponse";
|
|
11735
|
+
/** The result of the command execution, if successful. */
|
|
11736
|
+
result?: string;
|
|
11737
|
+
/** An error message, if the execution failed. */
|
|
11738
|
+
error?: string;
|
|
11739
|
+
};
|
|
11740
|
+
/**
|
|
11741
|
+
* Bridge → CLI: Acknowledgement that the bridge is stopping.
|
|
11742
|
+
*/
|
|
11743
|
+
export type StopResponse = {
|
|
11744
|
+
/** The message type discriminator. */
|
|
11745
|
+
type: "stopResponse";
|
|
11746
|
+
/** Whether the bridge stopped successfully. */
|
|
11747
|
+
success: boolean;
|
|
11748
|
+
};
|
|
11749
|
+
/**
|
|
11750
|
+
* All messages that the bridge sends to the CLI.
|
|
11751
|
+
*/
|
|
11752
|
+
export type CliResponse = SessionsResponse | CommandsResponse | ExecResponse | StopResponse;
|
|
11753
|
+
/**
|
|
11754
|
+
* Browser → Bridge: Register a new session.
|
|
11755
|
+
*/
|
|
11756
|
+
export type RegisterRequest = {
|
|
11757
|
+
/** The message type discriminator. */
|
|
11758
|
+
type: "register";
|
|
11759
|
+
/** The display name for this session. */
|
|
11760
|
+
name: string;
|
|
11761
|
+
};
|
|
11762
|
+
/**
|
|
11763
|
+
* Browser → Bridge: Response to a listCommands request from the bridge.
|
|
11764
|
+
*/
|
|
11765
|
+
export type CommandListResponse = {
|
|
11766
|
+
/** The message type discriminator. */
|
|
11767
|
+
type: "commandListResponse";
|
|
11768
|
+
/** The identifier of the original request. */
|
|
11769
|
+
requestId: string;
|
|
11770
|
+
/** The list of registered commands. */
|
|
11771
|
+
commands: CommandInfo[];
|
|
11772
|
+
};
|
|
11773
|
+
/**
|
|
11774
|
+
* Browser → Bridge: Response to an execCommand request from the bridge.
|
|
11775
|
+
*/
|
|
11776
|
+
export type CommandResponse = {
|
|
11777
|
+
/** The message type discriminator. */
|
|
11778
|
+
type: "commandResponse";
|
|
11779
|
+
/** The identifier of the original request. */
|
|
11780
|
+
requestId: string;
|
|
11781
|
+
/** The result of the command execution, if successful. */
|
|
11782
|
+
result?: string;
|
|
11783
|
+
/** An error message, if the execution failed. */
|
|
11784
|
+
error?: string;
|
|
11785
|
+
};
|
|
11786
|
+
/**
|
|
11787
|
+
* Browser → Bridge: Response to a getInfo request from the bridge.
|
|
11788
|
+
*/
|
|
11789
|
+
export type InfoResponse = {
|
|
11790
|
+
/** The message type discriminator. */
|
|
11791
|
+
type: "infoResponse";
|
|
11792
|
+
/** The identifier of the original request. */
|
|
11793
|
+
requestId: string;
|
|
11794
|
+
/** The current display name of the session. */
|
|
11795
|
+
name: string;
|
|
11796
|
+
};
|
|
11797
|
+
/**
|
|
11798
|
+
* All messages that the browser sends to the bridge.
|
|
11799
|
+
*/
|
|
11800
|
+
export type BrowserRequest = RegisterRequest | CommandListResponse | CommandResponse | InfoResponse;
|
|
11801
|
+
/**
|
|
11802
|
+
* Bridge → Browser: Request the list of registered commands.
|
|
11803
|
+
*/
|
|
11804
|
+
export type ListCommandsRequest = {
|
|
11805
|
+
/** The message type discriminator. */
|
|
11806
|
+
type: "listCommands";
|
|
11807
|
+
/** A unique identifier for this request. */
|
|
11808
|
+
requestId: string;
|
|
11809
|
+
};
|
|
11810
|
+
/**
|
|
11811
|
+
* Bridge → Browser: Request execution of a command.
|
|
11812
|
+
*/
|
|
11813
|
+
export type ExecCommandRequest = {
|
|
11814
|
+
/** The message type discriminator. */
|
|
11815
|
+
type: "execCommand";
|
|
11816
|
+
/** A unique identifier for this request. */
|
|
11817
|
+
requestId: string;
|
|
11818
|
+
/** The identifier of the command to execute. */
|
|
11819
|
+
commandId: string;
|
|
11820
|
+
/** Key-value pairs of arguments for the command. */
|
|
11821
|
+
args: Record<string, string>;
|
|
11822
|
+
};
|
|
11823
|
+
/**
|
|
11824
|
+
* Bridge → Browser: Request current session information.
|
|
11825
|
+
*/
|
|
11826
|
+
export type GetInfoRequest = {
|
|
11827
|
+
/** The message type discriminator. */
|
|
11828
|
+
type: "getInfo";
|
|
11829
|
+
/** A unique identifier for this request. */
|
|
11830
|
+
requestId: string;
|
|
11831
|
+
};
|
|
11832
|
+
/**
|
|
11833
|
+
* All messages that the bridge sends to the browser.
|
|
11834
|
+
*/
|
|
11835
|
+
export type BrowserResponse = ListCommandsRequest | ExecCommandRequest | GetInfoRequest;
|
|
11836
|
+
|
|
11837
|
+
|
|
11838
|
+
|
|
11839
|
+
}
|
|
11840
|
+
declare namespace BABYLON.NodeGeometryEditor {
|
|
11841
|
+
|
|
11842
|
+
|
|
11843
|
+
}
|
|
11844
|
+
declare namespace BABYLON.NodeGeometryEditor.SharedUIComponents {
|
|
11845
|
+
/**
|
|
11846
|
+
* Options for the CLI bridge service.
|
|
11847
|
+
* @experimental
|
|
11848
|
+
* @internal
|
|
11849
|
+
*/
|
|
11850
|
+
export type BridgeServiceOptions = {
|
|
11851
|
+
/**
|
|
11852
|
+
* The WebSocket port for the bridge's browser port.
|
|
11853
|
+
*/
|
|
11854
|
+
port: number;
|
|
11855
|
+
/**
|
|
11856
|
+
* The session display name sent to the bridge.
|
|
11857
|
+
* Can be a getter to provide a dynamic value that is re-read
|
|
11858
|
+
* each time the bridge queries session information.
|
|
11859
|
+
*/
|
|
11860
|
+
name: string;
|
|
11861
|
+
/**
|
|
11862
|
+
* Whether to automatically start connecting when the service is created.
|
|
11863
|
+
*/
|
|
11864
|
+
autoStart: boolean;
|
|
11865
|
+
};
|
|
11866
|
+
/**
|
|
11867
|
+
* Creates the service definition for the CLI Bridge Service.
|
|
11868
|
+
* @param options The options for connecting to the bridge.
|
|
11869
|
+
* @returns A service definition that produces an BABYLON.NodeGeometryEditor.SharedUIComponents.IBridgeCommandRegistry and BABYLON.NodeGeometryEditor.SharedUIComponents.ICliConnectionStatus.
|
|
11870
|
+
* @experimental
|
|
11871
|
+
* @internal
|
|
11872
|
+
*/
|
|
11873
|
+
export function MakeBridgeServiceDefinition(options: BridgeServiceOptions): BABYLON.NodeGeometryEditor.SharedUIComponents.ServiceDefinition<[IBridgeCommandRegistry, BABYLON.NodeGeometryEditor.SharedUIComponents.ICliConnectionStatus], []>;
|
|
11874
|
+
|
|
11875
|
+
|
|
11876
|
+
|
|
11877
|
+
}
|
|
11878
|
+
declare namespace BABYLON.NodeGeometryEditor {
|
|
11879
|
+
|
|
11880
|
+
|
|
11881
|
+
}
|
|
11882
|
+
declare namespace BABYLON.NodeGeometryEditor.SharedUIComponents {
|
|
11883
|
+
/**
|
|
11884
|
+
* The service identity for the CLI connection status.
|
|
11885
|
+
* @experimental
|
|
11886
|
+
* @internal
|
|
11887
|
+
*/
|
|
11888
|
+
export var CliConnectionStatusIdentity: unique symbol;
|
|
11889
|
+
/**
|
|
11890
|
+
* Provides the connection status and enable/disable control for the CLI bridge.
|
|
11891
|
+
* @experimental
|
|
11892
|
+
* @internal
|
|
11893
|
+
*/
|
|
11894
|
+
export interface ICliConnectionStatus extends BABYLON.NodeGeometryEditor.SharedUIComponents.IService<typeof CliConnectionStatusIdentity> {
|
|
11895
|
+
/**
|
|
11896
|
+
* Whether the bridge is enabled. When true, the bridge actively tries to
|
|
11897
|
+
* maintain a WebSocket connection. When false, the bridge is disconnected
|
|
11898
|
+
* and idle.
|
|
11899
|
+
*/
|
|
11900
|
+
isEnabled: boolean;
|
|
11901
|
+
/**
|
|
11902
|
+
* Whether the bridge WebSocket is currently connected.
|
|
11903
|
+
*/
|
|
11904
|
+
readonly isConnected: boolean;
|
|
11905
|
+
/**
|
|
11906
|
+
* Observable that fires when either {@link isEnabled} or {@link isConnected} changes.
|
|
11907
|
+
*/
|
|
11908
|
+
readonly onConnectionStatusChanged: BABYLON.IReadonlyObservable<void>;
|
|
11909
|
+
}
|
|
11910
|
+
|
|
11911
|
+
|
|
11912
|
+
|
|
11913
|
+
}
|
|
11914
|
+
declare namespace BABYLON.NodeGeometryEditor {
|
|
11915
|
+
|
|
11916
|
+
|
|
11917
|
+
}
|
|
11918
|
+
declare namespace BABYLON.NodeGeometryEditor.SharedUIComponents {
|
|
11919
|
+
/**
|
|
11920
|
+
* The type of a bridge command argument, which determines how
|
|
11921
|
+
* the CLI processes the value before sending it to the browser.
|
|
11922
|
+
* @experimental
|
|
11923
|
+
* @internal
|
|
11924
|
+
*/
|
|
11925
|
+
export type BridgeCommandArgType = "string" | "file";
|
|
11926
|
+
/**
|
|
11927
|
+
* Describes an argument for a bridge command.
|
|
11928
|
+
* @experimental
|
|
11929
|
+
* @internal
|
|
11930
|
+
*/
|
|
11931
|
+
export type BridgeCommandArg = {
|
|
11932
|
+
/**
|
|
11933
|
+
* The name of the argument.
|
|
11934
|
+
*/
|
|
11935
|
+
name: string;
|
|
11936
|
+
/**
|
|
11937
|
+
* A description of the argument.
|
|
11938
|
+
*/
|
|
11939
|
+
description: string;
|
|
11940
|
+
/**
|
|
11941
|
+
* Whether the argument is required.
|
|
11942
|
+
*/
|
|
11943
|
+
required?: boolean;
|
|
11944
|
+
/**
|
|
11945
|
+
* The type of the argument. Defaults to "string".
|
|
11946
|
+
* When set to "file", the CLI reads the file at the given path
|
|
11947
|
+
* and passes its contents as the argument value.
|
|
11948
|
+
*/
|
|
11949
|
+
type?: BridgeCommandArgType;
|
|
11950
|
+
};
|
|
11951
|
+
/**
|
|
11952
|
+
* Describes a command that can be invoked from the bridge.
|
|
11953
|
+
* @experimental
|
|
11954
|
+
* @internal
|
|
11955
|
+
*/
|
|
11956
|
+
export type BridgeCommandDescriptor = {
|
|
11957
|
+
/**
|
|
11958
|
+
* A unique identifier for the command.
|
|
11959
|
+
*/
|
|
11960
|
+
id: string;
|
|
11961
|
+
/**
|
|
11962
|
+
* A human-readable description of what the command does.
|
|
11963
|
+
*/
|
|
11964
|
+
description: string;
|
|
11965
|
+
/**
|
|
11966
|
+
* The arguments that this command accepts.
|
|
11967
|
+
*/
|
|
11968
|
+
args?: BridgeCommandArg[];
|
|
11969
|
+
/**
|
|
11970
|
+
* Executes the command with the given arguments and returns a result string.
|
|
11971
|
+
* @param args A map of argument names to their values.
|
|
11972
|
+
* @returns A promise that resolves to the result string.
|
|
11973
|
+
*/
|
|
11974
|
+
executeAsync: (args: Record<string, string>) => Promise<string>;
|
|
11975
|
+
};
|
|
11976
|
+
/**
|
|
11977
|
+
* The service identity for the bridge command registry.
|
|
11978
|
+
* @experimental
|
|
11979
|
+
* @internal
|
|
11980
|
+
*/
|
|
11981
|
+
export var BridgeCommandRegistryIdentity: unique symbol;
|
|
11982
|
+
/**
|
|
11983
|
+
* A registry for commands that can be invoked from the bridge.
|
|
11984
|
+
* @experimental
|
|
11985
|
+
* @internal
|
|
11986
|
+
*/
|
|
11987
|
+
export interface IBridgeCommandRegistry extends BABYLON.NodeGeometryEditor.SharedUIComponents.IService<typeof BridgeCommandRegistryIdentity> {
|
|
11988
|
+
/**
|
|
11989
|
+
* Registers a command that can be invoked from the bridge.
|
|
11990
|
+
* @param descriptor The command descriptor.
|
|
11991
|
+
* @returns A disposable token that unregisters the command when disposed.
|
|
11992
|
+
*/
|
|
11993
|
+
addCommand(descriptor: BridgeCommandDescriptor): BABYLON.IDisposable;
|
|
11994
|
+
}
|
|
11995
|
+
|
|
11996
|
+
|
|
11997
|
+
|
|
11158
11998
|
}
|
|
11159
11999
|
declare namespace BABYLON.NodeGeometryEditor {
|
|
11160
12000
|
|
|
@@ -11182,14 +12022,13 @@ declare namespace BABYLON.NodeGeometryEditor.SharedUIComponents {
|
|
|
11182
12022
|
[Index in keyof ServiceContracts]: ExtractContractIdentity<ServiceContracts[Index]>;
|
|
11183
12023
|
};
|
|
11184
12024
|
type UnionToIntersection<Union> = (Union extends any ? (k: Union) => void : never) extends (k: infer Intersection) => void ? Intersection : never;
|
|
11185
|
-
type MaybePromise<T> = T | Promise<T>;
|
|
11186
12025
|
/**
|
|
11187
12026
|
* A factory function responsible for creating a service instance.
|
|
11188
12027
|
* Consumed services are passed as arguments to the factory function.
|
|
11189
|
-
* The returned value must implement all produced services, and may BABYLON.IDisposable.
|
|
11190
|
-
* If
|
|
12028
|
+
* The returned value must implement all produced services, and may implement BABYLON.IDisposable.
|
|
12029
|
+
* If no services are produced, the returned value may implement BABYLON.IDisposable, otherwise it may return void.
|
|
11191
12030
|
*/
|
|
11192
|
-
export type ServiceFactory<Produces extends IService<symbol>[], Consumes extends IService<symbol>[]> = (...dependencies: [...Consumes
|
|
12031
|
+
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]>;
|
|
11193
12032
|
/**
|
|
11194
12033
|
* 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).
|
|
11195
12034
|
*/
|
|
@@ -11258,20 +12097,19 @@ declare namespace BABYLON.NodeGeometryEditor.SharedUIComponents {
|
|
|
11258
12097
|
*/
|
|
11259
12098
|
constructor(_friendlyName: string, _parent?: ServiceContainer | undefined);
|
|
11260
12099
|
/**
|
|
11261
|
-
* Adds a set of service definitions
|
|
12100
|
+
* Adds a set of service definitions to the service container.
|
|
11262
12101
|
* The services are sorted based on their dependencies.
|
|
11263
|
-
* @param
|
|
11264
|
-
* @returns A disposable that will remove the service
|
|
12102
|
+
* @param serviceDefinitions The service definitions to register.
|
|
12103
|
+
* @returns A disposable that will remove the service definitions from the service container.
|
|
11265
12104
|
*/
|
|
11266
|
-
|
|
12105
|
+
addServices(...serviceDefinitions: WeaklyTypedServiceDefinition[]): BABYLON.IDisposable;
|
|
11267
12106
|
/**
|
|
11268
12107
|
* Registers a service definition in the service container.
|
|
11269
12108
|
* @param serviceDefinition The service definition to register.
|
|
11270
|
-
* @param abortSignal An optional abort signal.
|
|
11271
12109
|
* @returns A disposable that will remove the service definition from the service container.
|
|
11272
12110
|
*/
|
|
11273
|
-
|
|
11274
|
-
private
|
|
12111
|
+
addService<Produces extends BABYLON.NodeGeometryEditor.SharedUIComponents.IService<symbol>[] = [], Consumes extends BABYLON.NodeGeometryEditor.SharedUIComponents.IService<symbol>[] = []>(serviceDefinition: BABYLON.NodeGeometryEditor.SharedUIComponents.ServiceDefinition<Produces, Consumes>): BABYLON.IDisposable;
|
|
12112
|
+
private _addService;
|
|
11275
12113
|
/**
|
|
11276
12114
|
* Resolves a dependency by contract identity for a consuming service.
|
|
11277
12115
|
* Checks local services first, then walks up the parent chain.
|