{"version":3,"file":"custom-client-C0m_K6v_.mjs","names":[],"sources":["../src/custom/custom-client.ts"],"sourcesContent":["/* SPDX-FileCopyrightText: 2026 Espressif Systems (Shanghai) CO LTD */\n/* SPDX-License-Identifier: Apache-2.0 */\n\nimport {\n  callServiceFunction,\n  closeService,\n  isServiceAvailable,\n  openService,\n  resolveHost,\n  type ServiceClientOptions,\n  type ServiceHandle,\n} from '../common/service-rpc.ts';\n\n/** Registered name (`CustomService::CustomServiceName`). */\nexport const CUSTOM_SERVICE_NAME = 'CustomService';\n\nexport type CustomClientOptions = ServiceClientOptions;\n\nexport { type ServiceHandle as CustomHandle };\n\nexport function isCustomAvailable(options?: CustomClientOptions): boolean {\n  return isServiceAvailable(CUSTOM_SERVICE_NAME, options);\n}\n\nexport function openCustom(options?: CustomClientOptions): ServiceHandle {\n  return openService(CUSTOM_SERVICE_NAME, options);\n}\n\nexport function closeCustom(handle: ServiceHandle, options?: CustomClientOptions): void {\n  closeService(handle, options);\n}\n\n/** Invoke a dynamically registered function on CustomService. */\nexport function callCustomFunction<T>(\n  handle: ServiceHandle,\n  functionName: string,\n  params: Record<string, unknown> = {},\n  options?: CustomClientOptions,\n): T {\n  return callServiceFunction<T>(resolveHost(options), handle, functionName, params);\n}\n"],"mappings":";;;AAcA,MAAa,sBAAsB;AAMnC,SAAgB,kBAAkB,SAAwC;CACxE,OAAO,mBAAmB,qBAAqB,OAAO;AACxD;AAEA,SAAgB,WAAW,SAA8C;CACvE,OAAO,YAAY,qBAAqB,OAAO;AACjD;AAEA,SAAgB,YAAY,QAAuB,SAAqC;CACtF,aAAa,QAAQ,OAAO;AAC9B;;AAGA,SAAgB,mBACd,QACA,cACA,SAAkC,CAAC,GACnC,SACG;CACH,OAAO,oBAAuB,YAAY,OAAO,GAAG,QAAQ,cAAc,MAAM;AAClF"}