@luxonis/depthai-viewer-common 0.0.2 → 0.0.3

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.
Files changed (117) hide show
  1. package/dist/components/ButtonLink.d.ts +8 -0
  2. package/dist/components/ButtonLink.d.ts.map +1 -0
  3. package/dist/components/ButtonLink.js +8 -0
  4. package/dist/components/ButtonLink.js.map +1 -0
  5. package/dist/components/CTASubLabel.d.ts +2 -0
  6. package/dist/components/CTASubLabel.d.ts.map +1 -0
  7. package/dist/components/CTASubLabel.js +17 -0
  8. package/dist/components/CTASubLabel.js.map +1 -0
  9. package/dist/components/Link.d.ts +5 -0
  10. package/dist/components/Link.d.ts.map +1 -0
  11. package/dist/components/Link.js +8 -0
  12. package/dist/components/Link.js.map +1 -0
  13. package/dist/components/Pipeline.d.ts +3 -0
  14. package/dist/components/Pipeline.d.ts.map +1 -0
  15. package/dist/components/Pipeline.js +22 -0
  16. package/dist/components/Pipeline.js.map +1 -0
  17. package/dist/components/Resizable.d.ts +10 -0
  18. package/dist/components/Resizable.d.ts.map +1 -0
  19. package/dist/components/Resizable.js +12 -0
  20. package/dist/components/Resizable.js.map +1 -0
  21. package/dist/components/Streams.d.ts +10 -0
  22. package/dist/components/Streams.d.ts.map +1 -0
  23. package/dist/components/Streams.js +80 -0
  24. package/dist/components/Streams.js.map +1 -0
  25. package/dist/constants/connection.d.ts +36 -0
  26. package/dist/constants/connection.d.ts.map +1 -0
  27. package/dist/constants/connection.js +35 -0
  28. package/dist/constants/connection.js.map +1 -0
  29. package/dist/constants/streams.d.ts +13 -0
  30. package/dist/constants/streams.d.ts.map +1 -0
  31. package/dist/constants/streams.js +13 -0
  32. package/dist/constants/streams.js.map +1 -0
  33. package/dist/constants/url.d.ts +4 -0
  34. package/dist/constants/url.d.ts.map +1 -0
  35. package/dist/constants/url.js +4 -0
  36. package/dist/constants/url.js.map +1 -0
  37. package/dist/dai-connection/connection.d.ts +55 -0
  38. package/dist/dai-connection/connection.d.ts.map +1 -0
  39. package/dist/dai-connection/connection.js +291 -0
  40. package/dist/dai-connection/connection.js.map +1 -0
  41. package/dist/dai-connection/decoder.worker.d.ts +16 -0
  42. package/dist/dai-connection/decoder.worker.d.ts.map +1 -0
  43. package/dist/dai-connection/decoder.worker.js +24 -0
  44. package/dist/dai-connection/decoder.worker.js.map +1 -0
  45. package/dist/hooks/connection.d.ts +30 -0
  46. package/dist/hooks/connection.d.ts.map +1 -0
  47. package/dist/hooks/connection.js +145 -0
  48. package/dist/hooks/connection.js.map +1 -0
  49. package/dist/hooks/navigation.d.ts +12 -0
  50. package/dist/hooks/navigation.d.ts.map +1 -0
  51. package/dist/hooks/navigation.js +15 -0
  52. package/dist/hooks/navigation.js.map +1 -0
  53. package/dist/hooks/search.d.ts +11 -0
  54. package/dist/hooks/search.d.ts.map +1 -0
  55. package/dist/hooks/search.js +31 -0
  56. package/dist/hooks/search.js.map +1 -0
  57. package/dist/index.d.ts +23 -0
  58. package/dist/index.d.ts.map +1 -0
  59. package/{src/index.ts → dist/index.js} +1 -7
  60. package/dist/index.js.map +1 -0
  61. package/dist/models/device-configuration.d.ts +106 -0
  62. package/dist/models/device-configuration.d.ts.map +1 -0
  63. package/dist/models/device-configuration.js +22 -0
  64. package/dist/models/device-configuration.js.map +1 -0
  65. package/dist/providers/ConnectionProvider.d.ts +9 -0
  66. package/dist/providers/ConnectionProvider.d.ts.map +1 -0
  67. package/dist/providers/ConnectionProvider.js +29 -0
  68. package/dist/providers/ConnectionProvider.js.map +1 -0
  69. package/dist/providers/DataProvider.d.ts +13 -0
  70. package/dist/providers/DataProvider.d.ts.map +1 -0
  71. package/dist/providers/DataProvider.js +43 -0
  72. package/dist/providers/DataProvider.js.map +1 -0
  73. package/dist/utils/arrays.d.ts +2 -0
  74. package/dist/utils/arrays.d.ts.map +1 -0
  75. package/dist/utils/arrays.js +11 -0
  76. package/dist/utils/arrays.js.map +1 -0
  77. package/dist/utils/dynamic-base-worker.d.ts +8 -0
  78. package/dist/utils/dynamic-base-worker.d.ts.map +1 -0
  79. package/dist/utils/dynamic-base-worker.js +19 -0
  80. package/dist/utils/dynamic-base-worker.js.map +1 -0
  81. package/dist/utils/functions.d.ts +2 -0
  82. package/dist/utils/functions.d.ts.map +1 -0
  83. package/dist/utils/functions.js +4 -0
  84. package/dist/utils/functions.js.map +1 -0
  85. package/dist/utils/sorting.d.ts +3 -0
  86. package/dist/utils/sorting.d.ts.map +1 -0
  87. package/dist/utils/sorting.js +34 -0
  88. package/dist/utils/sorting.js.map +1 -0
  89. package/dist/utils/url.d.ts +5 -0
  90. package/dist/utils/url.d.ts.map +1 -0
  91. package/dist/utils/url.js +7 -0
  92. package/dist/utils/url.js.map +1 -0
  93. package/package.json +2 -2
  94. package/src/components/ButtonLink.tsx +0 -12
  95. package/src/components/CTASubLabel.tsx +0 -39
  96. package/src/components/Link.tsx +0 -10
  97. package/src/components/Pipeline.tsx +0 -35
  98. package/src/components/Resizable.tsx +0 -56
  99. package/src/components/Streams.tsx +0 -261
  100. package/src/constants/connection.ts +0 -45
  101. package/src/constants/streams.ts +0 -12
  102. package/src/constants/url.ts +0 -6
  103. package/src/dai-connection/connection.ts +0 -402
  104. package/src/dai-connection/decoder.worker.ts +0 -47
  105. package/src/hooks/connection.ts +0 -204
  106. package/src/hooks/navigation.ts +0 -25
  107. package/src/hooks/search.ts +0 -45
  108. package/src/models/device-configuration.ts +0 -27
  109. package/src/providers/ConnectionProvider.tsx +0 -39
  110. package/src/providers/DataProvider.tsx +0 -71
  111. package/src/utils/arrays.ts +0 -10
  112. package/src/utils/dynamic-base-worker.ts +0 -21
  113. package/src/utils/functions.ts +0 -3
  114. package/src/utils/sorting.ts +0 -42
  115. package/src/utils/url.ts +0 -8
  116. package/src/window.d.ts +0 -7
  117. package/tsconfig.json +0 -37
@@ -0,0 +1,8 @@
1
+ import type React from 'react';
2
+ import { type ButtonProps } from '@luxonis/common-fe-components';
3
+ import { type LinkProps } from './Link.js';
4
+ export type ButtonLinkProps = ButtonProps & {
5
+ linkProps: LinkProps;
6
+ };
7
+ export declare const ButtonLink: React.FC<ButtonLinkProps>;
8
+ //# sourceMappingURL=ButtonLink.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonLink.d.ts","sourceRoot":"","sources":["../../src/components/ButtonLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAU,KAAK,WAAW,EAAE,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAQ,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAEjD,MAAM,MAAM,eAAe,GAAG,WAAW,GAAG;IAC3C,SAAS,EAAE,SAAS,CAAC;CACrB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAGhD,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Button } from '@luxonis/common-fe-components';
3
+ import { Link } from './Link.js';
4
+ export const ButtonLink = ({ linkProps, ...buttonProps }) => {
5
+ const button = _jsx(Button, { ...buttonProps });
6
+ return !buttonProps.disabled ? _jsx(Link, { ...linkProps, children: button }) : button;
7
+ };
8
+ //# sourceMappingURL=ButtonLink.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ButtonLink.js","sourceRoot":"","sources":["../../src/components/ButtonLink.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAoB,MAAM,+BAA+B,CAAC;AACzE,OAAO,EAAE,IAAI,EAAkB,MAAM,WAAW,CAAC;AAMjD,MAAM,CAAC,MAAM,UAAU,GAA8B,CAAC,EAAE,SAAS,EAAE,GAAG,WAAW,EAAE,EAAE,EAAE;IACtF,MAAM,MAAM,GAAG,KAAC,MAAM,OAAK,WAAW,GAAI,CAAC;IAC3C,OAAO,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAC,CAAC,KAAC,IAAI,OAAK,SAAS,YAAG,MAAM,GAAQ,CAAC,CAAC,CAAC,MAAM,CAAC;AAC9E,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare const CTASubLabel: () => false | import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=CTASubLabel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CTASubLabel.d.ts","sourceRoot":"","sources":["../../src/components/CTASubLabel.tsx"],"names":[],"mappings":"AAMA,eAAO,MAAM,WAAW,uDAgCvB,CAAC"}
@@ -0,0 +1,17 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { ExternalLink, Flex, SubLabel } from '@luxonis/common-fe-components';
3
+ import { useConnection } from '../providers/ConnectionProvider.js';
4
+ import React from 'react';
5
+ const DISPLAY_LABEL_TIMEOUT = 30_000;
6
+ export const CTASubLabel = () => {
7
+ const { connected, topics } = useConnection();
8
+ const [shouldDisplayLabel, setShouldDisplayLabel] = React.useState(false);
9
+ React.useEffect(() => {
10
+ if (connected && topics.length === 0 && !shouldDisplayLabel) {
11
+ const timeout = setTimeout(() => setShouldDisplayLabel(true), DISPLAY_LABEL_TIMEOUT);
12
+ return () => clearTimeout(timeout);
13
+ }
14
+ }, [connected, topics, shouldDisplayLabel]);
15
+ return (shouldDisplayLabel && (_jsx(Flex, { textAlign: "center", children: _jsx(SubLabel, { text: _jsxs("p", { children: ["You can purchase an OAK camera from the", ' ', _jsx(ExternalLink, { raw: true, to: "https://shop.luxonis.com", color: "light.active", children: _jsx(SubLabel, { color: "link", text: "Luxonis Store" }) }), ". After your purchase,", _jsx("br", {}), " explore the", ' ', _jsx(ExternalLink, { raw: true, to: "https://rvc4.docs.luxonis.com/hardware", color: "light.active", children: _jsx(SubLabel, { color: "link", text: "Luxonis Documentation" }) }), ' ', "for comprehensive setup tutorials to get started."] }) }) })));
16
+ };
17
+ //# sourceMappingURL=CTASubLabel.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CTASubLabel.js","s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EAAC,cAAc,YACjF,KAAC,QAAQ,IAAC,KAAK,EAAC,MAAM,EAAC,IAAI,EAAC,uBAAuB,GAAG,GACxC,EAAC,GAAG,yDAEhB,GAEJ,GACI,CACP,CACD,CAAC;AACH,CAAC,CAAC"}
@@ -0,0 +1,5 @@
1
+ export type LinkProps = {
2
+ to: 'pipeline' | 'streams';
3
+ };
4
+ export declare const Link: React.FC<React.PropsWithChildren<LinkProps>>;
5
+ //# sourceMappingURL=Link.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Link.d.ts","sourceRoot":"","sources":["../../src/components/Link.tsx"],"names":[],"mappings":"AAGA,MAAM,MAAM,SAAS,GAAG;IAAE,EAAE,EAAE,UAAU,GAAG,SAAS,CAAA;CAAE,CAAC;AAEvD,eAAO,MAAM,IAAI,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAI7D,CAAC"}
@@ -0,0 +1,8 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Link as _Link } from 'react-router-dom';
3
+ import { useNavigation } from '../hooks/navigation.js';
4
+ export const Link = ({ to, children }) => {
5
+ const { makePath } = useNavigation();
6
+ return _jsx(_Link, { to: makePath(to), children: children });
7
+ };
8
+ //# sourceMappingURL=Link.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Link.js","sourceRoot":"","sources":["../../src/components/Link.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,IAAI,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAIvD,MAAM,CAAC,MAAM,IAAI,GAAiD,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE;IACtF,MAAM,EAAE,QAAQ,EAAE,GAAG,aAAa,EAAE,CAAC;IAErC,OAAO,KAAC,KAAK,IAAC,EAAE,EAAE,QAAQ,CAAC,EAAE,CAAC,YAAG,QAAQ,GAAS,CAAC;AACpD,CAAC,CAAC"}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const Pipeline: React.FC;
3
+ //# sourceMappingURL=Pipeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pipeline.d.ts","sourceRoot":"","sources":["../../src/components/Pipeline.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EA2B5B,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import { Flex, Header } from '@luxonis/common-fe-components';
3
+ import { PipelineCanvas } from '@luxonis/depthai-pipeline-lib';
4
+ import { useConnection } from '../providers/ConnectionProvider.js';
5
+ import React from 'react';
6
+ const PIPELINE_LOADING_TIMEOUT = 60_000;
7
+ export const Pipeline = () => {
8
+ const { pipeline, isPipelineLoading, setIsPipelineLoading } = useConnection();
9
+ React.useEffect(() => {
10
+ if (isPipelineLoading && pipeline === undefined) {
11
+ const timeout = setTimeout(() => {
12
+ setIsPipelineLoading(false);
13
+ }, PIPELINE_LOADING_TIMEOUT);
14
+ return () => clearTimeout(timeout);
15
+ }
16
+ }, [isPipelineLoading, pipeline, setIsPipelineLoading]);
17
+ if (isPipelineLoading) {
18
+ return (_jsx(Flex, { align: "center", justify: "center", full: true, children: _jsx(Header, { text: "Loading pipeline..." }) }));
19
+ }
20
+ return pipeline === undefined ? (_jsx(Flex, { align: "center", justify: "center", full: true, children: _jsx(Header, { text: "Pipeline is not available" }) })) : (_jsx(PipelineCanvas, { pipeline: pipeline, height: "full" }));
21
+ };
22
+ //# sourceMappingURL=Pipeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Pipeline.js","sourceRoot":"","sources":["../../src/components/Pipeline.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,EAAE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 export type ResizableItem = {
3
+ component: React.ReactNode;
4
+ };
5
+ export type ResizableLayoutProps = {
6
+ id?: string | null;
7
+ items: ResizableItem[][];
8
+ };
9
+ export declare const ResizableLayout: React.FC<ResizableLayoutProps>;
10
+ //# sourceMappingURL=Resizable.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Resizable.d.ts","sourceRoot":"","sources":["../../src/components/Resizable.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAG1B,MAAM,MAAM,aAAa,GAAG;IAC3B,SAAS,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG;IAClC,EAAE,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACnB,KAAK,EAAE,aAAa,EAAE,EAAE,CAAC;CACzB,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA2C1D,CAAC"}
@@ -0,0 +1,12 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React from 'react';
3
+ import { Panel, PanelGroup, PanelResizeHandle } from 'react-resizable-panels';
4
+ export const ResizableLayout = ({ items, id = 'resizable-layout', }) => {
5
+ const groupStyles = React.useMemo(() => ({
6
+ display: 'flex',
7
+ gap: '5px',
8
+ }), []);
9
+ const panels = React.useMemo(() => items.map((row, rowIndex) => (_jsxs(React.Fragment, { children: [_jsx(Panel, { order: rowIndex, children: _jsx(PanelGroup, { autoSaveId: id && `${id}-${rowIndex}`, direction: "horizontal", style: groupStyles, children: row.map((item, itemIndex) => (_jsxs(React.Fragment, { children: [_jsx(Panel, { order: itemIndex, style: { display: 'flex' }, children: item.component }), itemIndex !== row.length - 1 && _jsx(PanelResizeHandle, {})] }, `resizable-row-${rowIndex}-item-${itemIndex}`))) }) }), rowIndex !== items.length - 1 && _jsx(PanelResizeHandle, {})] }, `resizable-row-${rowIndex}`))), [groupStyles, id, items]);
10
+ return (_jsx(PanelGroup, { autoSaveId: id, direction: "vertical", style: groupStyles, children: panels }));
11
+ };
12
+ //# sourceMappingURL=Resizable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Resizable.js","sourceRoot":"","sources":["../../src/components/Resizable.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAW9E,MAAM,CAAC,MAAM,eAAe,GAAmC,CAAC,EAC/D,KAAK,EACL,EAAE,GAAG,kBAAkB,GACvB,EAAE,EAAE;IACJ,MAAM,WAAW,GAAwB,KAAK,CAAC,OAAO,CACrD,GAAG,EAAE,CAAC,CAAC;QACN,OAAO,EAAE,MAAM;QACf,GAAG,EAAE,KAAK;KACV,CAAC,EACF,EAAE,CACF,CAAC;IAEF,MAAM,MAAM,GAAG,KAAK,CAAC,OAAO,CAC3B,GAAG,EAAE,CACJ,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,QAAQ,EAAE,EAAE,CAAC,CAC5B,MAAC,KAAK,CAAC,QAAQ,eACd,KAAC,KAAK,IAAC,KAAK,EAAE,QAAQ,YACrB,KAAC,UAAU,IACV,UAAU,EAAE,EAAE,IAAI,GAAG,EAAE,IAAI,QAAQ,EAAE,EACrC,SAAS,EAAC,YAAY,EACtB,KAAK,EAAE,WAAW,YAEjB,GAAG,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,SAAS,EAAE,EAAE,CAAC,CAC7B,MAAC,KAAK,CAAC,QAAQ,eACd,KAAC,KAAK,IAAC,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,YACjD,IAAI,CAAC,SAAS,GACR,EACP,SAAS,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC,IAAI,KAAC,iBAAiB,KAAG,KAJlC,iBAAiB,QAAQ,SAAS,SAAS,EAAE,CAKjD,CACjB,CAAC,GACU,GACN,EACP,QAAQ,KAAK,KAAK,CAAC,MAAM,GAAG,CAAC,IAAI,KAAC,iBAAiB,KAAG,KAjBnC,iBAAiB,QAAQ,EAAE,CAkB/B,CACjB,CAAC,EACH,CAAC,WAAW,EAAE,EAAE,EAAE,KAAK,CAAC,CACxB,CAAC;IAEF,OAAO,CACN,KAAC,UAAU,IAAC,UAAU,EAAE,EAAE,EAAE,SAAS,EAAC,UAAU,EAAC,KAAK,EAAE,WAAW,YACjE,MAAM,GACK,CACb,CAAC;AACH,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ import type { DeviceConfiguration } from '../models/device-configuration.js';
3
+ export declare const Streams: React.FC<{
4
+ targetFps?: number;
5
+ triggerToast?: () => void;
6
+ setIsRawSteamEnabledManually?: (value: boolean) => void;
7
+ isRawSteamEnabledManually?: boolean;
8
+ deviceOptions?: DeviceConfiguration | null;
9
+ }>;
10
+ //# sourceMappingURL=Streams.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Streams.d.ts","sourceRoot":"","sources":["../../src/components/Streams.tsx"],"names":[],"mappings":"AAcA,OAAO,KAAK,MAAM,OAAO,CAAC;AAU1B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AA0F7E,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC;IAC9B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,4BAA4B,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IACxD,yBAAyB,CAAC,EAAE,OAAO,CAAC;IACpC,aAAa,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAC;CAC3C,CA4IA,CAAC"}
@@ -0,0 +1,80 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Button, DropdownMenu, DropdownMenuCheckboxItem, DropdownMenuContent, DropdownMenuTrigger, Flex, Header, Input, NormalText, SubHeader, Tooltip, } from '@luxonis/common-fe-components';
3
+ import { ImagePanel, PanelLayout, PointCloudPanel } from '@luxonis/visualizer-protobuf';
4
+ import React from 'react';
5
+ import { ResizableLayout } from '@luxonis/depthai-viewer-common';
6
+ import { StreamTypes } from '../constants/streams.js';
7
+ import { useConnection } from '../providers/ConnectionProvider.js';
8
+ import { useData } from '../providers/DataProvider.js';
9
+ import { makeColumns } from '../utils/arrays.js';
10
+ import { CTASubLabel } from './CTASubLabel.js';
11
+ import { FaUsersViewfinder as VisualizerIcon } from 'react-icons/fa6';
12
+ import { sortStreamsDefault } from '../utils/sorting.js';
13
+ const EnabledStreamsView = ({ topics, targetFps, triggerToast, isRawSteamEnabledManually, setIsRawSteamEnabledManually, }) => {
14
+ const { toggleTopic, topics: allTopics } = useConnection();
15
+ const items = React.useMemo(() => {
16
+ return topics.map((row) => {
17
+ let filteredRow = row.filter((topic) => !topic.name.startsWith('_'));
18
+ if (filteredRow.some((topic) => topic.name === StreamTypes.PointCloud) &&
19
+ filteredRow.some((topic) => topic.name !== StreamTypes.Encoded) &&
20
+ !isRawSteamEnabledManually) {
21
+ filteredRow = filteredRow.filter((topic) => topic.name !== StreamTypes.Encoded);
22
+ }
23
+ return filteredRow.map(({ name, annotations, extraAnnotations, kind }) => ({
24
+ component: kind === 'pointCloud' || name === StreamTypes.PointCloud ? (_jsx(PointCloudPanel, { toggleTopic: (topic) => {
25
+ if (allTopics.find((t) => t.name === StreamTypes._PointCloudColor)) {
26
+ toggleTopic(StreamTypes._PointCloudColor);
27
+ }
28
+ else if (allTopics.find((t) => t.name === StreamTypes.Encoded)) {
29
+ toggleTopic(StreamTypes.Encoded);
30
+ }
31
+ toggleTopic(topic);
32
+ }, topic: name }, name)) : name !== StreamTypes.Raw &&
33
+ name !== StreamTypes.LeftRaw &&
34
+ name !== StreamTypes.RightRaw &&
35
+ !navigator.userAgent.includes('Chrome') ? (_jsx(PanelLayout, { children: _jsxs(Flex, { full: true, justify: "center", align: "center", direction: "column", gap: "sm", textAlign: "center", children: [_jsx(SubHeader, { text: `${name} is only supported in Google Chrome.` }), _jsx(SubHeader, { text: "Please switch to Chrome for the best experience." })] }) })) : (_jsx(ImagePanel, { toggleTopic: (topic) => {
36
+ if (isRawSteamEnabledManually && topic === StreamTypes.Encoded) {
37
+ setIsRawSteamEnabledManually?.(false);
38
+ }
39
+ toggleTopic(topic);
40
+ }, topic: name, annotationTopics: annotations, extraAnnotationTopics: extraAnnotations, targetFps: targetFps, triggerToast: triggerToast, disableAnnotations: name === StreamTypes.LeftRaw ||
41
+ name === StreamTypes.RightRaw ||
42
+ name === StreamTypes.LeftEncoded ||
43
+ name === StreamTypes.RightEncoded }, name)),
44
+ }));
45
+ });
46
+ }, [topics, targetFps, triggerToast, isRawSteamEnabledManually, setIsRawSteamEnabledManually]);
47
+ return _jsx(ResizableLayout, { items: items });
48
+ };
49
+ export const Streams = ({ targetFps, triggerToast, isRawSteamEnabledManually = true, setIsRawSteamEnabledManually, deviceOptions, }) => {
50
+ const { changeWsUrl, columns, connectionType, wsUrl } = useData();
51
+ const { connected, topics, toggleTopic } = useConnection();
52
+ const [shouldDisplayHelper, setShouldDisplayHelper] = React.useState(false);
53
+ const [connecting, setConnecting] = React.useState(false);
54
+ const enabledTopics = React.useMemo(() => makeColumns(topics.filter((topic) => !topic.name.startsWith('_')).filter((topic) => topic.enabled), columns), [columns, topics]);
55
+ const wsUrlRef = React.useRef(null);
56
+ const handleChangeUrl = React.useCallback(() => wsUrlRef.current?.value && changeWsUrl(wsUrlRef.current.value), [changeWsUrl]);
57
+ const shouldSuggestUrlChange = React.useMemo(() => window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1', []);
58
+ React.useEffect(() => {
59
+ if (!shouldDisplayHelper && !shouldSuggestUrlChange) {
60
+ setTimeout(() => {
61
+ setShouldDisplayHelper(true);
62
+ }, 10_000);
63
+ }
64
+ }, [shouldDisplayHelper, shouldSuggestUrlChange]);
65
+ const sortedTopics = React.useMemo(() => sortStreamsDefault(topics.filter((topic) => !topic.name.startsWith('_'))), [topics]);
66
+ // TODO: Store detections in url or global provider
67
+ // to persist on re-renders
68
+ return (_jsx(PanelLayout, { children: enabledTopics.length === 0 || enabledTopics[0].length === 0 ? (_jsxs(Flex, { full: true, justify: "center", align: "center", direction: "column", gap: "sm", children: [_jsx(Header, { text: connected ? (sortedTopics.length === 0 ? ('DepthAI connected, awaiting device...') : (_jsxs("p", { children: ["To view stream(s), select it with Streams Button", ' ', _jsxs(DropdownMenu, { children: [_jsx(Tooltip, { content: "Streams", children: _jsx(DropdownMenuTrigger, { children: _jsx(Button, { icon: VisualizerIcon, variant: "outline", colorVariant: "white" }) }) }), _jsx(DropdownMenuContent, { children: sortedTopics.map((topic, i) => (_jsx(DropdownMenuCheckboxItem, { onClick: () => toggleTopic(topic.name), children: topic.name }, i))) })] }), ' ', "either here or in the top right corner"] }))) : // TODO: connection details (state, errors, retries, webrtc stage)
69
+ connectionType === 'ws' ? ('Connecting to DepthAI via WebSocket...') : ('Connecting to DepthAI via WebRTC...') }), !connected &&
70
+ (shouldSuggestUrlChange ? (_jsxs(_Fragment, { children: [_jsx(SubHeader, { text: connectionType === 'ws' ? 'Use another URL?' : 'Connect via WebSocket?' }), _jsx("form", { onSubmit: (event) => {
71
+ event.stopPropagation();
72
+ event.preventDefault();
73
+ setConnecting(true);
74
+ handleChangeUrl();
75
+ }, children: _jsxs(Flex, { children: [_jsx(Input, { type: "text", ref: wsUrlRef, placeholder: wsUrl, roundedRight: 0, onChange: () => setConnecting(false) }), _jsx(Button, { type: "submit", label: connecting ? 'Connecting...' : 'Connect', style: {
76
+ borderTopLeftRadius: 0,
77
+ borderBottomLeftRadius: 0,
78
+ } })] }) })] })) : (shouldDisplayHelper && (_jsx(NormalText, { text: "Please check that you have the correct link to DepthAI Visualizer and that your device is running. You need a new link after any app or device restart." })))), _jsx(CTASubLabel, {})] })) : (_jsx(EnabledStreamsView, { topics: enabledTopics, targetFps: targetFps, triggerToast: triggerToast, isRawSteamEnabledManually: isRawSteamEnabledManually, setIsRawSteamEnabledManually: setIsRawSteamEnabledManually, deviceOptions: deviceOptions })) }));
79
+ };
80
+ //# sourceMappingURL=Streams.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Streams.js","sourceRoot":"","sources":["../../src/components/Streams.tsx"],"names":[],"mappings":";AAAA,OAAO,EACN,MAAM,EACN,YAAY,EACZ,wBAAwB,EACxB,mBAAmB,EACnB,mBAAmB,EACnB,IAAI,EACJ,MAAM,EACN,KAAK,EACL,UAAU,EACV,SAAS,EACT,OAAO,GACP,MAAM,+BAA+B,CAAC;AACvC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AACxF,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,eAAe,EAAc,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,oCAAoC,CAAC;AACnE,OAAO,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AACvD,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,iBAAiB,IAAI,cAAc,EAAE,MAAM,iBAAiB,CAAC;AACtE,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAGzD,MAAM,kBAAkB,GAOnB,CAAC,EACL,MAAM,EACN,SAAS,EACT,YAAY,EACZ,yBAAyB,EACzB,4BAA4B,GAC5B,EAAE,EAAE;IACJ,MAAM,EAAE,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,GAAG,aAAa,EAAE,CAAC;IAE3D,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE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AC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,EAC/C,KAAK,EAAE;gDACN,mBAAmB,EAAE,CAAC;gDACtB,sBAAsB,EAAE,CAAC;6CACzB,GACA,IACI,GACD,IACL,CACH,CAAC,CAAC,CAAC,CACH,mBAAmB,IAAI,CACtB,KAAC,UAAU,IAAC,IAAI,EAAC,yJAAyJ,GAAG,CAC7K,CACD,CAAC,EACH,KAAC,WAAW,KAAG,IACT,CACP,CAAC,CAAC,CAAC,CACH,KAAC,kBAAkB,IAClB,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,SAAS,EACpB,YAAY,EAAE,YAAY,EAC1B,yBAAyB,EAAE,yBAAyB,EACpD,4BAA4B,EAAE,4BAA4B,EAC1D,aAAa,EAAE,aAAa,GAC3B,CACF,GACY,CACd,CAAC;AACH,CAAC,CAAC"}
@@ -0,0 +1,36 @@
1
+ export type DAIResponse<T = any> = {
2
+ data: T;
3
+ error: Error | string | null;
4
+ message: string | null;
5
+ status: number;
6
+ };
7
+ export declare const DAI_SERVICE_NAME: {
8
+ topicGroups: string;
9
+ pipelineSchema: string;
10
+ keyPressed: string;
11
+ getDevices: string;
12
+ startDevice: string;
13
+ stopDevice: string;
14
+ getDeviceOptions: string;
15
+ getFpsRange: string;
16
+ getSensors: string;
17
+ setSensors: string;
18
+ getStereoDepth: string;
19
+ setStereoDepth: string;
20
+ getStereoDepthPreset: string;
21
+ setStereoDepthPreset: string;
22
+ getStereoDepthCalibration: string;
23
+ setStereoDepthCalibration: string;
24
+ setIr: string;
25
+ setPointCloud: string;
26
+ setThermal: string;
27
+ getCameraIntrinsics: string;
28
+ getNeuralNetworks: string;
29
+ setNeuralNetwork: string;
30
+ getNeuralNetworkConfiguration: string;
31
+ setNeuralNetworkConfiguration: string;
32
+ };
33
+ export declare const SIGNALING_SERVER_URL = "wss://signal.cloud.luxonis.com/session/";
34
+ export declare const ICE_SERVERS_API_ENDPOINT = "https://signal.cloud-stg.luxonis.com/api/v1/turn-credentials";
35
+ export declare const DEFAULT_ICE_SERVERS: RTCIceServer[];
36
+ //# sourceMappingURL=connection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/constants/connection.ts"],"names":[],"mappings":"AACA,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,GAAG,IAAI;IAClC,IAAI,EAAE,CAAC,CAAC;IACR,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI,CAAC;IAC7B,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;CA4B5B,CAAC;AAEF,eAAO,MAAM,oBAAoB,4CAA4C,CAAC;AAC9E,eAAO,MAAM,wBAAwB,iEAC0B,CAAC;AAEhE,eAAO,MAAM,mBAAmB,EAAE,YAAY,EAE7C,CAAC"}
@@ -0,0 +1,35 @@
1
+ export const DAI_SERVICE_NAME = {
2
+ topicGroups: 'topicGroups',
3
+ pipelineSchema: 'pipelineSchema',
4
+ keyPressed: 'keyPressed',
5
+ // Devices
6
+ getDevices: 'getDevices',
7
+ startDevice: 'startDevice',
8
+ stopDevice: 'stopDevice',
9
+ getDeviceOptions: 'getDeviceOptions',
10
+ getFpsRange: 'getFpsRange',
11
+ // Configs
12
+ getSensors: 'getSensors',
13
+ setSensors: 'setSensors',
14
+ getStereoDepth: 'getStereoDepth',
15
+ setStereoDepth: 'setStereoDepth',
16
+ getStereoDepthPreset: 'getStereoDepthPreset',
17
+ setStereoDepthPreset: 'setStereoDepthPreset',
18
+ getStereoDepthCalibration: 'getStereoDepthCalibration',
19
+ setStereoDepthCalibration: 'setStereoDepthCalibration',
20
+ setIr: 'setIr',
21
+ setPointCloud: 'setPointCloud',
22
+ setThermal: 'setThermal',
23
+ getCameraIntrinsics: 'getCameraIntrinsics',
24
+ // Neural networks
25
+ getNeuralNetworks: 'getNeuralNetworks',
26
+ setNeuralNetwork: 'setNeuralNetwork',
27
+ getNeuralNetworkConfiguration: 'getNeuralNetworkConfiguration',
28
+ setNeuralNetworkConfiguration: 'setNeuralNetworkConfiguration',
29
+ };
30
+ export const SIGNALING_SERVER_URL = 'wss://signal.cloud.luxonis.com/session/';
31
+ export const ICE_SERVERS_API_ENDPOINT = 'https://signal.cloud-stg.luxonis.com/api/v1/turn-credentials';
32
+ export const DEFAULT_ICE_SERVERS = [
33
+ { urls: ['stun:stun.l.google.com:19302', 'stun:stun1.l.google.com:19302'] },
34
+ ];
35
+ //# sourceMappingURL=connection.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.js","sourceRoot":"","sources":["../../src/constants/connection.ts"],"names":[],"mappings":"AAQA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC/B,WAAW,EAAE,aAAa;IAC1B,cAAc,EAAE,gBAAgB;IAChC,UAAU,EAAE,YAAY;IACxB,UAAU;IACV,UAAU,EAAE,YAAY;IACxB,WAAW,EAAE,aAAa;IAC1B,UAAU,EAAE,YAAY;IACxB,gBAAgB,EAAE,kBAAkB;IACpC,WAAW,EAAE,aAAa;IAC1B,UAAU;IACV,UAAU,EAAE,YAAY;IACxB,UAAU,EAAE,YAAY;IACxB,cAAc,EAAE,gBAAgB;IAChC,cAAc,EAAE,gBAAgB;IAChC,oBAAoB,EAAE,sBAAsB;IAC5C,oBAAoB,EAAE,sBAAsB;IAC5C,yBAAyB,EAAE,2BAA2B;IACtD,yBAAyB,EAAE,2BAA2B;IACtD,KAAK,EAAE,OAAO;IACd,aAAa,EAAE,eAAe;IAC9B,UAAU,EAAE,YAAY;IACxB,mBAAmB,EAAE,qBAAqB;IAC1C,kBAAkB;IAClB,iBAAiB,EAAE,mBAAmB;IACtC,gBAAgB,EAAE,kBAAkB;IACpC,6BAA6B,EAAE,+BAA+B;IAC9D,6BAA6B,EAAE,+BAA+B;CAC9D,CAAC;AAEF,MAAM,CAAC,MAAM,oBAAoB,GAAG,yCAAyC,CAAC;AAC9E,MAAM,CAAC,MAAM,wBAAwB,GACpC,8DAA8D,CAAC;AAEhE,MAAM,CAAC,MAAM,mBAAmB,GAAmB;IAClD,EAAE,IAAI,EAAE,CAAC,8BAA8B,EAAE,+BAA+B,CAAC,EAAE;CAC3E,CAAC"}
@@ -0,0 +1,13 @@
1
+ export declare const StreamTypes: {
2
+ readonly Encoded: "H.264 Stream";
3
+ readonly LeftEncoded: "Left H.264 Stream";
4
+ readonly RightEncoded: "Right H.264 Stream";
5
+ readonly Disparity: "Disparity Stream";
6
+ readonly Raw: "Raw Stream";
7
+ readonly LeftRaw: "Left Raw Stream";
8
+ readonly RightRaw: "Right Raw Stream";
9
+ readonly PointCloud: "Point Cloud";
10
+ readonly NeuralNetwork: "Neural Network Stream";
11
+ readonly _PointCloudColor: "_Point Cloud Color";
12
+ };
13
+ //# sourceMappingURL=streams.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streams.d.ts","sourceRoot":"","sources":["../../src/constants/streams.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,WAAW;;;;;;;;;;;CAWd,CAAC"}
@@ -0,0 +1,13 @@
1
+ export const StreamTypes = {
2
+ Encoded: 'H.264 Stream',
3
+ LeftEncoded: 'Left H.264 Stream',
4
+ RightEncoded: 'Right H.264 Stream',
5
+ Disparity: 'Disparity Stream',
6
+ Raw: 'Raw Stream',
7
+ LeftRaw: 'Left Raw Stream',
8
+ RightRaw: 'Right Raw Stream',
9
+ PointCloud: 'Point Cloud',
10
+ NeuralNetwork: 'Neural Network Stream',
11
+ _PointCloudColor: '_Point Cloud Color',
12
+ };
13
+ //# sourceMappingURL=streams.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"streams.js","sourceRoot":"","sources":["../../src/constants/streams.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG;IAC1B,OAAO,EAAE,cAAc;IACvB,WAAW,EAAE,mBAAmB;IAChC,YAAY,EAAE,oBAAoB;IAClC,SAAS,EAAE,kBAAkB;IAC7B,GAAG,EAAE,YAAY;IACjB,OAAO,EAAE,iBAAiB;IAC1B,QAAQ,EAAE,kBAAkB;IAC5B,UAAU,EAAE,aAAa;IACzB,aAAa,EAAE,uBAAuB;IACtC,gBAAgB,EAAE,oBAAoB;CAC7B,CAAC"}
@@ -0,0 +1,4 @@
1
+ export declare const DEFAULT_WS_URL: string;
2
+ export declare const LOCALHOST_WS_URL = "ws://localhost:8765";
3
+ export declare const IS_LOCALHOST: boolean;
4
+ //# sourceMappingURL=url.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.d.ts","sourceRoot":"","sources":["../../src/constants/url.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,cAAc,QAA+C,CAAC;AAE3E,eAAO,MAAM,gBAAgB,wBAAwB,CAAC;AAEtD,eAAO,MAAM,YAAY,SACkD,CAAC"}
@@ -0,0 +1,4 @@
1
+ export const DEFAULT_WS_URL = `wss://${window.location.hostname}:8000/dai`;
2
+ export const LOCALHOST_WS_URL = 'ws://localhost:8765';
3
+ export const IS_LOCALHOST = window.origin.includes('localhost') || window.origin.includes('127.0.0.1');
4
+ //# sourceMappingURL=url.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"url.js","sourceRoot":"","sources":["../../src/constants/url.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,cAAc,GAAG,SAAS,MAAM,CAAC,QAAQ,CAAC,QAAQ,WAAW,CAAC;AAE3E,MAAM,CAAC,MAAM,gBAAgB,GAAG,qBAAqB,CAAC;AAEtD,MAAM,CAAC,MAAM,YAAY,GACxB,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,IAAI,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC"}
@@ -0,0 +1,55 @@
1
+ import type { Pipeline } from '@luxonis/depthai-pipeline-lib';
2
+ import { type PublicChannelData, VisualizerConnection } from '@luxonis/visualizer-protobuf';
3
+ import { DAI_SERVICE_NAME } from '../constants/connection.js';
4
+ import type { Topic } from '../hooks/connection.js';
5
+ export type DAIConnectionInitArgs = {
6
+ type: 'ws' | 'webrtc';
7
+ connectionUrl: string;
8
+ clientId: string;
9
+ token: string;
10
+ automaticTokenRefresh?: (token: string) => void;
11
+ } & {
12
+ enabledStreams: string[];
13
+ };
14
+ type DaiConnectionEventMap = {
15
+ open: () => void;
16
+ error: (error: MessageEvent<unknown> | ErrorEvent) => void;
17
+ close: () => void;
18
+ pipeline: (pipeline: Pipeline | null) => void;
19
+ topics: (topics: Topic[]) => void;
20
+ disconnect: (error: ErrorEvent) => void;
21
+ };
22
+ export type DAIService = keyof typeof DAI_SERVICE_NAME;
23
+ export declare class DAIConnection {
24
+ alive: boolean;
25
+ connection?: VisualizerConnection;
26
+ protected listeners: Partial<Record<keyof DaiConnectionEventMap, any[]>>;
27
+ protected serviceListeners: Record<string, (data: any) => void>;
28
+ protected enabledTopics: string[];
29
+ protected previouslyEnabledTopics: string[];
30
+ protected decoderWorker: Worker;
31
+ protected allowedServices: Set<DAIService>;
32
+ protected activeServices: Set<DAIService>;
33
+ protected serviceInterval: NodeJS.Timeout | null;
34
+ protected topicsTouched: boolean;
35
+ protected channels: PublicChannelData[];
36
+ protected groups: Record<string, string>;
37
+ protected topics: Topic[];
38
+ protected pipeline: Pipeline | null;
39
+ protected recreateDecoderWorker(): void;
40
+ protected reportTopics(type?: 'ws' | 'webrtc'): void;
41
+ protected pollServices(): void;
42
+ init({ enabledStreams, ...args }: DAIConnectionInitArgs): void;
43
+ setupConnection({ type, connectionUrl, clientId, token, automaticTokenRefresh, }: Pick<DAIConnectionInitArgs, 'type' | 'clientId' | 'connectionUrl' | 'token' | 'automaticTokenRefresh'>): void;
44
+ fetchService(service: DAIService, body?: Record<string, any> | string | number): Promise<void>;
45
+ setActiveServices(services: DAIService[]): void;
46
+ dispose(): void;
47
+ handleKeyPress(key: string): void;
48
+ toggleTopic(topic: string): void;
49
+ stopTopics(): void;
50
+ restartTopics(): void;
51
+ on<T extends keyof DaiConnectionEventMap>(event: T, callback: DaiConnectionEventMap[T]): void;
52
+ setOnService<T>(service: string, callback: (data: T) => void): void;
53
+ }
54
+ export {};
55
+ //# sourceMappingURL=connection.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/dai-connection/connection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,KAAK,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,8BAA8B,CAAC;AAG5F,OAAO,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AAC9D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAKpD,MAAM,MAAM,qBAAqB,GAAG;IACnC,IAAI,EAAE,IAAI,GAAG,QAAQ,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;IACtB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;IACd,qBAAqB,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CAChD,GAAG;IACH,cAAc,EAAE,MAAM,EAAE,CAAC;CACzB,CAAC;AAEF,KAAK,qBAAqB,GAAG;IAC5B,IAAI,EAAE,MAAM,IAAI,CAAC;IACjB,KAAK,EAAE,CAAC,KAAK,EAAE,YAAY,CAAC,OAAO,CAAC,GAAG,UAAU,KAAK,IAAI,CAAC;IAC3D,KAAK,EAAE,MAAM,IAAI,CAAC;IAClB,QAAQ,EAAE,CAAC,QAAQ,EAAE,QAAQ,GAAG,IAAI,KAAK,IAAI,CAAC;IAC9C,MAAM,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,KAAK,IAAI,CAAC;IAClC,UAAU,EAAE,CAAC,KAAK,EAAE,UAAU,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF,MAAM,MAA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