babylonjs-node-particle-editor 9.2.2 → 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.
|
@@ -2666,7 +2666,69 @@ declare namespace BABYLON.NodeParticleEditor.SharedUIComponents {
|
|
|
2666
2666
|
* @param options The options for the tool.
|
|
2667
2667
|
* @returns A token that can be used to dispose of the tool.
|
|
2668
2668
|
*/
|
|
2669
|
-
export function MakeModularTool(options: ModularToolOptions):
|
|
2669
|
+
export function MakeModularTool(options: ModularToolOptions): {
|
|
2670
|
+
dispose: () => Promise<void>;
|
|
2671
|
+
};
|
|
2672
|
+
|
|
2673
|
+
|
|
2674
|
+
|
|
2675
|
+
}
|
|
2676
|
+
declare namespace BABYLON.NodeParticleEditor {
|
|
2677
|
+
|
|
2678
|
+
|
|
2679
|
+
}
|
|
2680
|
+
declare namespace BABYLON.NodeParticleEditor.SharedUIComponents {
|
|
2681
|
+
/**
|
|
2682
|
+
* Options for creating a modular bridge container.
|
|
2683
|
+
* @experimental
|
|
2684
|
+
* @internal
|
|
2685
|
+
*/
|
|
2686
|
+
export type ModularBridgeOptions = {
|
|
2687
|
+
/**
|
|
2688
|
+
* WebSocket port for the bridge's browser port. Defaults to 4400.
|
|
2689
|
+
*/
|
|
2690
|
+
port?: number;
|
|
2691
|
+
/**
|
|
2692
|
+
* Session display name reported to the bridge. Defaults to `document.title`.
|
|
2693
|
+
*/
|
|
2694
|
+
name?: string;
|
|
2695
|
+
/**
|
|
2696
|
+
* Whether the bridge should automatically start trying to connect.
|
|
2697
|
+
* Defaults to false.
|
|
2698
|
+
*/
|
|
2699
|
+
autoStart?: boolean;
|
|
2700
|
+
/**
|
|
2701
|
+
* Additional service definitions to register with the bridge container.
|
|
2702
|
+
*/
|
|
2703
|
+
serviceDefinitions?: readonly BABYLON.NodeParticleEditor.SharedUIComponents.WeaklyTypedServiceDefinition[];
|
|
2704
|
+
};
|
|
2705
|
+
/**
|
|
2706
|
+
* A token returned by {@link MakeModularBridge} that owns the headless
|
|
2707
|
+
* {@link BABYLON.NodeParticleEditor.SharedUIComponents.ServiceContainer}. Dispose it to tear down the bridge and all services.
|
|
2708
|
+
* @experimental
|
|
2709
|
+
* @internal
|
|
2710
|
+
*/
|
|
2711
|
+
export type ModularBridgeToken = BABYLON.IDisposable & {
|
|
2712
|
+
/**
|
|
2713
|
+
* The headless BABYLON.NodeParticleEditor.SharedUIComponents.ServiceContainer that hosts the bridge.
|
|
2714
|
+
*/
|
|
2715
|
+
readonly serviceContainer: BABYLON.NodeParticleEditor.SharedUIComponents.ServiceContainer;
|
|
2716
|
+
/**
|
|
2717
|
+
* Whether this token has been disposed.
|
|
2718
|
+
*/
|
|
2719
|
+
readonly isDisposed: boolean;
|
|
2720
|
+
};
|
|
2721
|
+
/**
|
|
2722
|
+
* Creates a headless {@link BABYLON.NodeParticleEditor.SharedUIComponents.ServiceContainer} that hosts a bridge service.
|
|
2723
|
+
*
|
|
2724
|
+
* The returned token owns the container. Dispose it to tear down the bridge.
|
|
2725
|
+
*
|
|
2726
|
+
* @param options Optional configuration for the bridge.
|
|
2727
|
+
* @returns A {@link ModularBridgeToken} that owns the container.
|
|
2728
|
+
* @experimental
|
|
2729
|
+
* @internal
|
|
2730
|
+
*/
|
|
2731
|
+
export function MakeModularBridge(options?: ModularBridgeOptions): ModularBridgeToken;
|
|
2670
2732
|
|
|
2671
2733
|
|
|
2672
2734
|
|
|
@@ -3186,6 +3248,376 @@ declare namespace BABYLON.NodeParticleEditor.SharedUIComponents {
|
|
|
3186
3248
|
|
|
3187
3249
|
|
|
3188
3250
|
|
|
3251
|
+
}
|
|
3252
|
+
declare namespace BABYLON.NodeParticleEditor {
|
|
3253
|
+
|
|
3254
|
+
|
|
3255
|
+
}
|
|
3256
|
+
declare namespace BABYLON.NodeParticleEditor.SharedUIComponents {
|
|
3257
|
+
/**
|
|
3258
|
+
* Serializable description of a command argument, used in protocol messages.
|
|
3259
|
+
*/
|
|
3260
|
+
export type CommandArgInfo = {
|
|
3261
|
+
/** The name of the argument. */
|
|
3262
|
+
name: string;
|
|
3263
|
+
/** A human-readable description of the argument. */
|
|
3264
|
+
description: string;
|
|
3265
|
+
/** Whether this argument is required. */
|
|
3266
|
+
required?: boolean;
|
|
3267
|
+
/** The type of the argument. Defaults to "string". When "file", the CLI reads the file and sends its contents. */
|
|
3268
|
+
type?: "string" | "file";
|
|
3269
|
+
};
|
|
3270
|
+
/**
|
|
3271
|
+
* Serializable description of a command, used in protocol messages.
|
|
3272
|
+
*/
|
|
3273
|
+
export type CommandInfo = {
|
|
3274
|
+
/** A unique identifier for the command. */
|
|
3275
|
+
id: string;
|
|
3276
|
+
/** A human-readable description of the command. */
|
|
3277
|
+
description: string;
|
|
3278
|
+
/** The arguments this command accepts. */
|
|
3279
|
+
args?: CommandArgInfo[];
|
|
3280
|
+
};
|
|
3281
|
+
/**
|
|
3282
|
+
* Serializable description of a session, used in protocol messages.
|
|
3283
|
+
*/
|
|
3284
|
+
export type SessionInfo = {
|
|
3285
|
+
/** The numeric session identifier. */
|
|
3286
|
+
id: number;
|
|
3287
|
+
/** The display name of the session. */
|
|
3288
|
+
name: string;
|
|
3289
|
+
/** ISO 8601 timestamp of when the session connected. */
|
|
3290
|
+
connectedAt: string;
|
|
3291
|
+
};
|
|
3292
|
+
/**
|
|
3293
|
+
* CLI → Bridge: Request the list of active browser sessions.
|
|
3294
|
+
*/
|
|
3295
|
+
export type SessionsRequest = {
|
|
3296
|
+
/** The message type discriminator. */
|
|
3297
|
+
type: "sessions";
|
|
3298
|
+
};
|
|
3299
|
+
/**
|
|
3300
|
+
* CLI → Bridge: Request the list of commands available from a session.
|
|
3301
|
+
*/
|
|
3302
|
+
export type CommandsRequest = {
|
|
3303
|
+
/** The message type discriminator. */
|
|
3304
|
+
type: "commands";
|
|
3305
|
+
/** The session to query for commands. */
|
|
3306
|
+
sessionId: number;
|
|
3307
|
+
};
|
|
3308
|
+
/**
|
|
3309
|
+
* CLI → Bridge: Execute a command on a session.
|
|
3310
|
+
*/
|
|
3311
|
+
export type ExecRequest = {
|
|
3312
|
+
/** The message type discriminator. */
|
|
3313
|
+
type: "exec";
|
|
3314
|
+
/** The session to execute the command on. */
|
|
3315
|
+
sessionId: number;
|
|
3316
|
+
/** The identifier of the command to execute. */
|
|
3317
|
+
commandId: string;
|
|
3318
|
+
/** Key-value pairs of arguments for the command. */
|
|
3319
|
+
args: Record<string, string>;
|
|
3320
|
+
};
|
|
3321
|
+
/**
|
|
3322
|
+
* CLI → Bridge: Stop the bridge process.
|
|
3323
|
+
*/
|
|
3324
|
+
export type StopRequest = {
|
|
3325
|
+
/** The message type discriminator. */
|
|
3326
|
+
type: "stop";
|
|
3327
|
+
};
|
|
3328
|
+
/**
|
|
3329
|
+
* All messages that the CLI sends to the bridge.
|
|
3330
|
+
*/
|
|
3331
|
+
export type CliRequest = SessionsRequest | CommandsRequest | ExecRequest | StopRequest;
|
|
3332
|
+
/**
|
|
3333
|
+
* Bridge → CLI: Response with the list of active sessions.
|
|
3334
|
+
*/
|
|
3335
|
+
export type SessionsResponse = {
|
|
3336
|
+
/** The message type discriminator. */
|
|
3337
|
+
type: "sessionsResponse";
|
|
3338
|
+
/** The list of active sessions. */
|
|
3339
|
+
sessions: SessionInfo[];
|
|
3340
|
+
};
|
|
3341
|
+
/**
|
|
3342
|
+
* Bridge → CLI: Response with the list of commands from a session.
|
|
3343
|
+
*/
|
|
3344
|
+
export type CommandsResponse = {
|
|
3345
|
+
/** The message type discriminator. */
|
|
3346
|
+
type: "commandsResponse";
|
|
3347
|
+
/** The list of available commands, if successful. */
|
|
3348
|
+
commands?: CommandInfo[];
|
|
3349
|
+
/** An error message, if the request failed. */
|
|
3350
|
+
error?: string;
|
|
3351
|
+
};
|
|
3352
|
+
/**
|
|
3353
|
+
* Bridge → CLI: Response with the result of a command execution.
|
|
3354
|
+
*/
|
|
3355
|
+
export type ExecResponse = {
|
|
3356
|
+
/** The message type discriminator. */
|
|
3357
|
+
type: "execResponse";
|
|
3358
|
+
/** The result of the command execution, if successful. */
|
|
3359
|
+
result?: string;
|
|
3360
|
+
/** An error message, if the execution failed. */
|
|
3361
|
+
error?: string;
|
|
3362
|
+
};
|
|
3363
|
+
/**
|
|
3364
|
+
* Bridge → CLI: Acknowledgement that the bridge is stopping.
|
|
3365
|
+
*/
|
|
3366
|
+
export type StopResponse = {
|
|
3367
|
+
/** The message type discriminator. */
|
|
3368
|
+
type: "stopResponse";
|
|
3369
|
+
/** Whether the bridge stopped successfully. */
|
|
3370
|
+
success: boolean;
|
|
3371
|
+
};
|
|
3372
|
+
/**
|
|
3373
|
+
* All messages that the bridge sends to the CLI.
|
|
3374
|
+
*/
|
|
3375
|
+
export type CliResponse = SessionsResponse | CommandsResponse | ExecResponse | StopResponse;
|
|
3376
|
+
/**
|
|
3377
|
+
* Browser → Bridge: Register a new session.
|
|
3378
|
+
*/
|
|
3379
|
+
export type RegisterRequest = {
|
|
3380
|
+
/** The message type discriminator. */
|
|
3381
|
+
type: "register";
|
|
3382
|
+
/** The display name for this session. */
|
|
3383
|
+
name: string;
|
|
3384
|
+
};
|
|
3385
|
+
/**
|
|
3386
|
+
* Browser → Bridge: Response to a listCommands request from the bridge.
|
|
3387
|
+
*/
|
|
3388
|
+
export type CommandListResponse = {
|
|
3389
|
+
/** The message type discriminator. */
|
|
3390
|
+
type: "commandListResponse";
|
|
3391
|
+
/** The identifier of the original request. */
|
|
3392
|
+
requestId: string;
|
|
3393
|
+
/** The list of registered commands. */
|
|
3394
|
+
commands: CommandInfo[];
|
|
3395
|
+
};
|
|
3396
|
+
/**
|
|
3397
|
+
* Browser → Bridge: Response to an execCommand request from the bridge.
|
|
3398
|
+
*/
|
|
3399
|
+
export type CommandResponse = {
|
|
3400
|
+
/** The message type discriminator. */
|
|
3401
|
+
type: "commandResponse";
|
|
3402
|
+
/** The identifier of the original request. */
|
|
3403
|
+
requestId: string;
|
|
3404
|
+
/** The result of the command execution, if successful. */
|
|
3405
|
+
result?: string;
|
|
3406
|
+
/** An error message, if the execution failed. */
|
|
3407
|
+
error?: string;
|
|
3408
|
+
};
|
|
3409
|
+
/**
|
|
3410
|
+
* Browser → Bridge: Response to a getInfo request from the bridge.
|
|
3411
|
+
*/
|
|
3412
|
+
export type InfoResponse = {
|
|
3413
|
+
/** The message type discriminator. */
|
|
3414
|
+
type: "infoResponse";
|
|
3415
|
+
/** The identifier of the original request. */
|
|
3416
|
+
requestId: string;
|
|
3417
|
+
/** The current display name of the session. */
|
|
3418
|
+
name: string;
|
|
3419
|
+
};
|
|
3420
|
+
/**
|
|
3421
|
+
* All messages that the browser sends to the bridge.
|
|
3422
|
+
*/
|
|
3423
|
+
export type BrowserRequest = RegisterRequest | CommandListResponse | CommandResponse | InfoResponse;
|
|
3424
|
+
/**
|
|
3425
|
+
* Bridge → Browser: Request the list of registered commands.
|
|
3426
|
+
*/
|
|
3427
|
+
export type ListCommandsRequest = {
|
|
3428
|
+
/** The message type discriminator. */
|
|
3429
|
+
type: "listCommands";
|
|
3430
|
+
/** A unique identifier for this request. */
|
|
3431
|
+
requestId: string;
|
|
3432
|
+
};
|
|
3433
|
+
/**
|
|
3434
|
+
* Bridge → Browser: Request execution of a command.
|
|
3435
|
+
*/
|
|
3436
|
+
export type ExecCommandRequest = {
|
|
3437
|
+
/** The message type discriminator. */
|
|
3438
|
+
type: "execCommand";
|
|
3439
|
+
/** A unique identifier for this request. */
|
|
3440
|
+
requestId: string;
|
|
3441
|
+
/** The identifier of the command to execute. */
|
|
3442
|
+
commandId: string;
|
|
3443
|
+
/** Key-value pairs of arguments for the command. */
|
|
3444
|
+
args: Record<string, string>;
|
|
3445
|
+
};
|
|
3446
|
+
/**
|
|
3447
|
+
* Bridge → Browser: Request current session information.
|
|
3448
|
+
*/
|
|
3449
|
+
export type GetInfoRequest = {
|
|
3450
|
+
/** The message type discriminator. */
|
|
3451
|
+
type: "getInfo";
|
|
3452
|
+
/** A unique identifier for this request. */
|
|
3453
|
+
requestId: string;
|
|
3454
|
+
};
|
|
3455
|
+
/**
|
|
3456
|
+
* All messages that the bridge sends to the browser.
|
|
3457
|
+
*/
|
|
3458
|
+
export type BrowserResponse = ListCommandsRequest | ExecCommandRequest | GetInfoRequest;
|
|
3459
|
+
|
|
3460
|
+
|
|
3461
|
+
|
|
3462
|
+
}
|
|
3463
|
+
declare namespace BABYLON.NodeParticleEditor {
|
|
3464
|
+
|
|
3465
|
+
|
|
3466
|
+
}
|
|
3467
|
+
declare namespace BABYLON.NodeParticleEditor.SharedUIComponents {
|
|
3468
|
+
/**
|
|
3469
|
+
* Options for the CLI bridge service.
|
|
3470
|
+
* @experimental
|
|
3471
|
+
* @internal
|
|
3472
|
+
*/
|
|
3473
|
+
export type BridgeServiceOptions = {
|
|
3474
|
+
/**
|
|
3475
|
+
* The WebSocket port for the bridge's browser port.
|
|
3476
|
+
*/
|
|
3477
|
+
port: number;
|
|
3478
|
+
/**
|
|
3479
|
+
* The session display name sent to the bridge.
|
|
3480
|
+
* Can be a getter to provide a dynamic value that is re-read
|
|
3481
|
+
* each time the bridge queries session information.
|
|
3482
|
+
*/
|
|
3483
|
+
name: string;
|
|
3484
|
+
/**
|
|
3485
|
+
* Whether to automatically start connecting when the service is created.
|
|
3486
|
+
*/
|
|
3487
|
+
autoStart: boolean;
|
|
3488
|
+
};
|
|
3489
|
+
/**
|
|
3490
|
+
* Creates the service definition for the CLI Bridge Service.
|
|
3491
|
+
* @param options The options for connecting to the bridge.
|
|
3492
|
+
* @returns A service definition that produces an BABYLON.NodeParticleEditor.SharedUIComponents.IBridgeCommandRegistry and BABYLON.NodeParticleEditor.SharedUIComponents.ICliConnectionStatus.
|
|
3493
|
+
* @experimental
|
|
3494
|
+
* @internal
|
|
3495
|
+
*/
|
|
3496
|
+
export function MakeBridgeServiceDefinition(options: BridgeServiceOptions): BABYLON.NodeParticleEditor.SharedUIComponents.ServiceDefinition<[IBridgeCommandRegistry, BABYLON.NodeParticleEditor.SharedUIComponents.ICliConnectionStatus], []>;
|
|
3497
|
+
|
|
3498
|
+
|
|
3499
|
+
|
|
3500
|
+
}
|
|
3501
|
+
declare namespace BABYLON.NodeParticleEditor {
|
|
3502
|
+
|
|
3503
|
+
|
|
3504
|
+
}
|
|
3505
|
+
declare namespace BABYLON.NodeParticleEditor.SharedUIComponents {
|
|
3506
|
+
/**
|
|
3507
|
+
* The service identity for the CLI connection status.
|
|
3508
|
+
* @experimental
|
|
3509
|
+
* @internal
|
|
3510
|
+
*/
|
|
3511
|
+
export var CliConnectionStatusIdentity: unique symbol;
|
|
3512
|
+
/**
|
|
3513
|
+
* Provides the connection status and enable/disable control for the CLI bridge.
|
|
3514
|
+
* @experimental
|
|
3515
|
+
* @internal
|
|
3516
|
+
*/
|
|
3517
|
+
export interface ICliConnectionStatus extends BABYLON.NodeParticleEditor.SharedUIComponents.IService<typeof CliConnectionStatusIdentity> {
|
|
3518
|
+
/**
|
|
3519
|
+
* Whether the bridge is enabled. When true, the bridge actively tries to
|
|
3520
|
+
* maintain a WebSocket connection. When false, the bridge is disconnected
|
|
3521
|
+
* and idle.
|
|
3522
|
+
*/
|
|
3523
|
+
isEnabled: boolean;
|
|
3524
|
+
/**
|
|
3525
|
+
* Whether the bridge WebSocket is currently connected.
|
|
3526
|
+
*/
|
|
3527
|
+
readonly isConnected: boolean;
|
|
3528
|
+
/**
|
|
3529
|
+
* Observable that fires when either {@link isEnabled} or {@link isConnected} changes.
|
|
3530
|
+
*/
|
|
3531
|
+
readonly onConnectionStatusChanged: BABYLON.IReadonlyObservable<void>;
|
|
3532
|
+
}
|
|
3533
|
+
|
|
3534
|
+
|
|
3535
|
+
|
|
3536
|
+
}
|
|
3537
|
+
declare namespace BABYLON.NodeParticleEditor {
|
|
3538
|
+
|
|
3539
|
+
|
|
3540
|
+
}
|
|
3541
|
+
declare namespace BABYLON.NodeParticleEditor.SharedUIComponents {
|
|
3542
|
+
/**
|
|
3543
|
+
* The type of a bridge command argument, which determines how
|
|
3544
|
+
* the CLI processes the value before sending it to the browser.
|
|
3545
|
+
* @experimental
|
|
3546
|
+
* @internal
|
|
3547
|
+
*/
|
|
3548
|
+
export type BridgeCommandArgType = "string" | "file";
|
|
3549
|
+
/**
|
|
3550
|
+
* Describes an argument for a bridge command.
|
|
3551
|
+
* @experimental
|
|
3552
|
+
* @internal
|
|
3553
|
+
*/
|
|
3554
|
+
export type BridgeCommandArg = {
|
|
3555
|
+
/**
|
|
3556
|
+
* The name of the argument.
|
|
3557
|
+
*/
|
|
3558
|
+
name: string;
|
|
3559
|
+
/**
|
|
3560
|
+
* A description of the argument.
|
|
3561
|
+
*/
|
|
3562
|
+
description: string;
|
|
3563
|
+
/**
|
|
3564
|
+
* Whether the argument is required.
|
|
3565
|
+
*/
|
|
3566
|
+
required?: boolean;
|
|
3567
|
+
/**
|
|
3568
|
+
* The type of the argument. Defaults to "string".
|
|
3569
|
+
* When set to "file", the CLI reads the file at the given path
|
|
3570
|
+
* and passes its contents as the argument value.
|
|
3571
|
+
*/
|
|
3572
|
+
type?: BridgeCommandArgType;
|
|
3573
|
+
};
|
|
3574
|
+
/**
|
|
3575
|
+
* Describes a command that can be invoked from the bridge.
|
|
3576
|
+
* @experimental
|
|
3577
|
+
* @internal
|
|
3578
|
+
*/
|
|
3579
|
+
export type BridgeCommandDescriptor = {
|
|
3580
|
+
/**
|
|
3581
|
+
* A unique identifier for the command.
|
|
3582
|
+
*/
|
|
3583
|
+
id: string;
|
|
3584
|
+
/**
|
|
3585
|
+
* A human-readable description of what the command does.
|
|
3586
|
+
*/
|
|
3587
|
+
description: string;
|
|
3588
|
+
/**
|
|
3589
|
+
* The arguments that this command accepts.
|
|
3590
|
+
*/
|
|
3591
|
+
args?: BridgeCommandArg[];
|
|
3592
|
+
/**
|
|
3593
|
+
* Executes the command with the given arguments and returns a result string.
|
|
3594
|
+
* @param args A map of argument names to their values.
|
|
3595
|
+
* @returns A promise that resolves to the result string.
|
|
3596
|
+
*/
|
|
3597
|
+
executeAsync: (args: Record<string, string>) => Promise<string>;
|
|
3598
|
+
};
|
|
3599
|
+
/**
|
|
3600
|
+
* The service identity for the bridge command registry.
|
|
3601
|
+
* @experimental
|
|
3602
|
+
* @internal
|
|
3603
|
+
*/
|
|
3604
|
+
export var BridgeCommandRegistryIdentity: unique symbol;
|
|
3605
|
+
/**
|
|
3606
|
+
* A registry for commands that can be invoked from the bridge.
|
|
3607
|
+
* @experimental
|
|
3608
|
+
* @internal
|
|
3609
|
+
*/
|
|
3610
|
+
export interface IBridgeCommandRegistry extends BABYLON.NodeParticleEditor.SharedUIComponents.IService<typeof BridgeCommandRegistryIdentity> {
|
|
3611
|
+
/**
|
|
3612
|
+
* Registers a command that can be invoked from the bridge.
|
|
3613
|
+
* @param descriptor The command descriptor.
|
|
3614
|
+
* @returns A disposable token that unregisters the command when disposed.
|
|
3615
|
+
*/
|
|
3616
|
+
addCommand(descriptor: BridgeCommandDescriptor): BABYLON.IDisposable;
|
|
3617
|
+
}
|
|
3618
|
+
|
|
3619
|
+
|
|
3620
|
+
|
|
3189
3621
|
}
|
|
3190
3622
|
declare namespace BABYLON.NodeParticleEditor {
|
|
3191
3623
|
|
|
@@ -3213,14 +3645,13 @@ declare namespace BABYLON.NodeParticleEditor.SharedUIComponents {
|
|
|
3213
3645
|
[Index in keyof ServiceContracts]: ExtractContractIdentity<ServiceContracts[Index]>;
|
|
3214
3646
|
};
|
|
3215
3647
|
type UnionToIntersection<Union> = (Union extends any ? (k: Union) => void : never) extends (k: infer Intersection) => void ? Intersection : never;
|
|
3216
|
-
type MaybePromise<T> = T | Promise<T>;
|
|
3217
3648
|
/**
|
|
3218
3649
|
* A factory function responsible for creating a service instance.
|
|
3219
3650
|
* Consumed services are passed as arguments to the factory function.
|
|
3220
|
-
* The returned value must implement all produced services, and may BABYLON.IDisposable.
|
|
3221
|
-
* If
|
|
3651
|
+
* The returned value must implement all produced services, and may implement BABYLON.IDisposable.
|
|
3652
|
+
* If no services are produced, the returned value may implement BABYLON.IDisposable, otherwise it may return void.
|
|
3222
3653
|
*/
|
|
3223
|
-
export type ServiceFactory<Produces extends IService<symbol>[], Consumes extends IService<symbol>[]> = (...dependencies: [...Consumes
|
|
3654
|
+
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]>;
|
|
3224
3655
|
/**
|
|
3225
3656
|
* 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).
|
|
3226
3657
|
*/
|
|
@@ -3289,20 +3720,19 @@ declare namespace BABYLON.NodeParticleEditor.SharedUIComponents {
|
|
|
3289
3720
|
*/
|
|
3290
3721
|
constructor(_friendlyName: string, _parent?: ServiceContainer | undefined);
|
|
3291
3722
|
/**
|
|
3292
|
-
* Adds a set of service definitions
|
|
3723
|
+
* Adds a set of service definitions to the service container.
|
|
3293
3724
|
* The services are sorted based on their dependencies.
|
|
3294
|
-
* @param
|
|
3295
|
-
* @returns A disposable that will remove the service
|
|
3725
|
+
* @param serviceDefinitions The service definitions to register.
|
|
3726
|
+
* @returns A disposable that will remove the service definitions from the service container.
|
|
3296
3727
|
*/
|
|
3297
|
-
|
|
3728
|
+
addServices(...serviceDefinitions: WeaklyTypedServiceDefinition[]): BABYLON.IDisposable;
|
|
3298
3729
|
/**
|
|
3299
3730
|
* Registers a service definition in the service container.
|
|
3300
3731
|
* @param serviceDefinition The service definition to register.
|
|
3301
|
-
* @param abortSignal An optional abort signal.
|
|
3302
3732
|
* @returns A disposable that will remove the service definition from the service container.
|
|
3303
3733
|
*/
|
|
3304
|
-
|
|
3305
|
-
private
|
|
3734
|
+
addService<Produces extends BABYLON.NodeParticleEditor.SharedUIComponents.IService<symbol>[] = [], Consumes extends BABYLON.NodeParticleEditor.SharedUIComponents.IService<symbol>[] = []>(serviceDefinition: BABYLON.NodeParticleEditor.SharedUIComponents.ServiceDefinition<Produces, Consumes>): BABYLON.IDisposable;
|
|
3735
|
+
private _addService;
|
|
3306
3736
|
/**
|
|
3307
3737
|
* Resolves a dependency by contract identity for a consuming service.
|
|
3308
3738
|
* Checks local services first, then walks up the parent chain.
|