зеркало из https://github.com/microsoft/jacdac-ts.git
fix: add help to launch 1 single server
This commit is contained in:
Родитель
6519fcad21
Коммит
e969131d15
|
@ -1892,6 +1892,32 @@ export function addServiceProvider(
|
|||
return d
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a single server device on the bus.
|
||||
* @param bus
|
||||
* @param name
|
||||
* @param server
|
||||
* @param serviceOptions
|
||||
* @returns
|
||||
*/
|
||||
export function addServer(
|
||||
bus: JDBus,
|
||||
name: string,
|
||||
server: JDServiceServer,
|
||||
serviceOptions?: ServiceProviderOptions[]
|
||||
) {
|
||||
const services = [server]
|
||||
return addServiceProvider(
|
||||
bus,
|
||||
{
|
||||
name,
|
||||
serviceClasses: services.map(srv => srv.serviceClass),
|
||||
services: () => services,
|
||||
},
|
||||
serviceOptions
|
||||
)
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds the first service provider that supports the given service class
|
||||
* @category Servers
|
||||
|
|
Загрузка…
Ссылка в новой задаче