@nordicsemiconductor/pc-nrfconnect-shared 78.0.0 → 80.0.0
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.
- package/Changelog.md +32 -1
- package/ipc/MetaFiles.ts +64 -0
- package/ipc/README.md +43 -0
- package/ipc/appDetails.ts +47 -0
- package/ipc/apps.ts +151 -0
- package/ipc/infrastructure/mainToRenderer.ts +49 -0
- package/ipc/infrastructure/rendererToMain.ts +51 -0
- package/ipc/openWindow.ts +35 -0
- package/ipc/preventSleep.ts +23 -0
- package/ipc/serialPort.ts +167 -0
- package/ipc/sources.ts +19 -0
- package/package.json +5 -4
- package/src/About/DeviceCard.tsx +1 -1
- package/src/Device/DeviceSelector/DeviceList/MoreDeviceInfo.tsx +2 -2
- package/src/Device/deviceInfo/deviceInfo.ts +2 -2
- package/src/index.ts +14 -1
- package/src/utils/packageJson.ts +1 -1
- package/src/utils/systemReport.ts +3 -3
- package/typings/generated/ipc/apps.d.ts +8 -0
- package/typings/generated/ipc/apps.d.ts.map +1 -1
- package/typings/generated/src/index.d.ts +1 -1
- package/typings/generated/src/index.d.ts.map +1 -1
package/Changelog.md
CHANGED
|
@@ -7,7 +7,7 @@ This project does _not_ adhere to
|
|
|
7
7
|
[Semantic Versioning](https://semver.org/spec/v2.0.0.html) but contrary to it
|
|
8
8
|
every new version is a new major version.
|
|
9
9
|
|
|
10
|
-
##
|
|
10
|
+
## 80 - Unreleased
|
|
11
11
|
|
|
12
12
|
### Changed
|
|
13
13
|
|
|
@@ -16,6 +16,37 @@ every new version is a new major version.
|
|
|
16
16
|
and use the new name `@nordicsemiconductor/pc-nrfconnect-shared` when
|
|
17
17
|
importing components from shared
|
|
18
18
|
|
|
19
|
+
### Steps to upgrade when using this package
|
|
20
|
+
|
|
21
|
+
- Change all references from `pc-nrfconnect-shared` to
|
|
22
|
+
`@nordicsemiconductor/pc-nrfconnect-shared`
|
|
23
|
+
|
|
24
|
+
```diff
|
|
25
|
+
- import { App } from 'pc-nrfconnect-shared';
|
|
26
|
+
+ import { App } from '@nordicsemiconductor/pc-nrfconnect-shared';
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
- Also check references in `tsconfig.json`, s`jest.config.js` and
|
|
30
|
+
`.scss`-files.
|
|
31
|
+
|
|
32
|
+
## 79 - 2023-08-04
|
|
33
|
+
|
|
34
|
+
### Added
|
|
35
|
+
|
|
36
|
+
- Export app utility functions (like `isInstalled`) and types.
|
|
37
|
+
|
|
38
|
+
## 78 - 2023-08-03
|
|
39
|
+
|
|
40
|
+
### Changed
|
|
41
|
+
|
|
42
|
+
- Shared now only uses `device.jlink.boardversion` instead of
|
|
43
|
+
`jlink.boardVersion`.
|
|
44
|
+
|
|
45
|
+
### Fixed
|
|
46
|
+
|
|
47
|
+
- `deviceInfo` can now be used in applications that don't make use of the
|
|
48
|
+
shared redux store.
|
|
49
|
+
|
|
19
50
|
## 77 - 2023-08-01
|
|
20
51
|
|
|
21
52
|
### Added
|
package/ipc/MetaFiles.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
export type UrlString = string;
|
|
8
|
+
|
|
9
|
+
export interface SourceJson {
|
|
10
|
+
name: string;
|
|
11
|
+
apps: UrlString[];
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export type WithdrawnJson = UrlString[];
|
|
15
|
+
|
|
16
|
+
export type AppVersions = {
|
|
17
|
+
[version: string]: {
|
|
18
|
+
shasum?: string;
|
|
19
|
+
tarballUrl: UrlString;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export interface AppInfo {
|
|
24
|
+
name: string;
|
|
25
|
+
displayName: string;
|
|
26
|
+
description: string;
|
|
27
|
+
homepage?: UrlString;
|
|
28
|
+
iconUrl: UrlString;
|
|
29
|
+
releaseNotesUrl: UrlString;
|
|
30
|
+
latestVersion: string;
|
|
31
|
+
versions: AppVersions;
|
|
32
|
+
installed?: {
|
|
33
|
+
path: string;
|
|
34
|
+
shasum?: string;
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface ObjectContainingOptionalStrings {
|
|
39
|
+
[index: string]: string | undefined;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface PackageJson {
|
|
43
|
+
name: string;
|
|
44
|
+
version: string;
|
|
45
|
+
|
|
46
|
+
// Several optional properties
|
|
47
|
+
author?: string;
|
|
48
|
+
bin?: ObjectContainingOptionalStrings | string;
|
|
49
|
+
dependencies?: ObjectContainingOptionalStrings;
|
|
50
|
+
description?: string;
|
|
51
|
+
homepage?: UrlString;
|
|
52
|
+
devDependencies?: ObjectContainingOptionalStrings;
|
|
53
|
+
displayName?: string;
|
|
54
|
+
engines?: ObjectContainingOptionalStrings;
|
|
55
|
+
files?: readonly string[];
|
|
56
|
+
license?: string;
|
|
57
|
+
main?: string;
|
|
58
|
+
peerDependencies?: ObjectContainingOptionalStrings;
|
|
59
|
+
repository?: {
|
|
60
|
+
type: string;
|
|
61
|
+
url: UrlString;
|
|
62
|
+
};
|
|
63
|
+
scripts?: ObjectContainingOptionalStrings;
|
|
64
|
+
}
|
package/ipc/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
The folder `ipc/` is meant as a middle layer between the main and renderer
|
|
2
|
+
processes.
|
|
3
|
+
|
|
4
|
+
Some of the code here should be called from the main process, usually to
|
|
5
|
+
register IPC handlers. Other code here should be called from the renderer
|
|
6
|
+
process(es), usually the ones to send IPC messages. They are both kept together
|
|
7
|
+
to keep them in sync, especially that the channel names and the shape of the
|
|
8
|
+
messages are the same.
|
|
9
|
+
|
|
10
|
+
All the code for the main process here is ran by the launcher. The launcher or
|
|
11
|
+
apps can invoke the functions from here, e.g. to do things like opening an app.
|
|
12
|
+
This means, the API must be kept stable here and in the launcher, so that the
|
|
13
|
+
launcher will react in the way the apps expect it.
|
|
14
|
+
|
|
15
|
+
## Code conventions
|
|
16
|
+
|
|
17
|
+
There are a few conventions we follow with the code here in `ipc/`:
|
|
18
|
+
|
|
19
|
+
- In each file there are pairs of functions: One to send a message over an IPC
|
|
20
|
+
channel (e.g. `openApp`) and another to register a handler for the messages
|
|
21
|
+
on that same channel (e.g. `registerOpenApp`).
|
|
22
|
+
|
|
23
|
+
Usually these two functions utilize a shared signature which is defined in a
|
|
24
|
+
type above them. Usually the functions are defined by invoking functions
|
|
25
|
+
from `infrastructure/mainToRenderer.ts` or
|
|
26
|
+
`infrastructure/rendererToMain.ts` which also use that type.
|
|
27
|
+
|
|
28
|
+
- The functions mentioned before are then exported in objects with the names
|
|
29
|
+
`inMain`, `forRenderer`, `inRenderer`, and `forMain` to signify how the
|
|
30
|
+
functions are supposed to be used. E.g. the mentioned `openApp` is in
|
|
31
|
+
`inMain` because it is called by code in the renderer processes to invoke
|
|
32
|
+
code in the main process to open an window. `registerOpenApp` is in
|
|
33
|
+
`forRenderer` because the handler is registered so that code in the renderer
|
|
34
|
+
processes can invoke it.
|
|
35
|
+
|
|
36
|
+
So, `inMain` and `forRenderer` are used when sending messages from the
|
|
37
|
+
renderer processes to the main process. `inRenderer` and `forMain` are used,
|
|
38
|
+
when sending messages from the main process to the renderer processes.
|
|
39
|
+
|
|
40
|
+
- The code here in `ipc/` must neither reference any code in `src/` (which is
|
|
41
|
+
for code of the renderer processes) nor in `main/` (which is for code in the
|
|
42
|
+
main process). Only the other way around code in those two folders can
|
|
43
|
+
reference code in `ipc/`.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { ipcMain, WebContents } from 'electron';
|
|
8
|
+
|
|
9
|
+
import { LaunchableApp } from './apps';
|
|
10
|
+
import { handleWithSender, invoke } from './infrastructure/rendererToMain';
|
|
11
|
+
|
|
12
|
+
const channel = {
|
|
13
|
+
request: 'get-app-details',
|
|
14
|
+
response: 'app-details',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
interface AppDetails {
|
|
18
|
+
coreVersion: string;
|
|
19
|
+
corePath: string;
|
|
20
|
+
homeDir: string;
|
|
21
|
+
tmpDir: string;
|
|
22
|
+
bundledJlink: string;
|
|
23
|
+
path: string;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export type AppDetailsFromLauncher = AppDetails & LaunchableApp;
|
|
27
|
+
|
|
28
|
+
type GetAppDetails = () => AppDetailsFromLauncher;
|
|
29
|
+
|
|
30
|
+
const getAppDetails = invoke<GetAppDetails>(channel.request);
|
|
31
|
+
|
|
32
|
+
const registerGetAppDetails = (
|
|
33
|
+
onGetAppDetails: (webContents: WebContents) => AppDetailsFromLauncher
|
|
34
|
+
) => {
|
|
35
|
+
handleWithSender<GetAppDetails>(channel.request)(onGetAppDetails);
|
|
36
|
+
|
|
37
|
+
// This legacy implementation is still needed, because we currently still
|
|
38
|
+
// send the corresponding message in apps using shared 76 or earlier.
|
|
39
|
+
// When all apps are updated and required a launcher using shared 77 or
|
|
40
|
+
// later, we can remove this.
|
|
41
|
+
ipcMain.on(channel.request, event => {
|
|
42
|
+
event.sender.send(channel.response, onGetAppDetails(event.sender));
|
|
43
|
+
});
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
export const forRenderer = { registerGetAppDetails };
|
|
47
|
+
export const inMain = { getAppDetails };
|
package/ipc/apps.ts
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { handle, invoke } from './infrastructure/rendererToMain';
|
|
8
|
+
import { AppVersions, UrlString } from './MetaFiles';
|
|
9
|
+
import { LOCAL, Source, SourceName } from './sources';
|
|
10
|
+
|
|
11
|
+
export interface AppSpec {
|
|
12
|
+
name: string;
|
|
13
|
+
source: SourceName;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface BaseApp {
|
|
17
|
+
name: string;
|
|
18
|
+
displayName: string;
|
|
19
|
+
description: string;
|
|
20
|
+
iconPath: string;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
interface Downloadable {
|
|
24
|
+
source: SourceName;
|
|
25
|
+
homepage?: UrlString;
|
|
26
|
+
versions?: AppVersions;
|
|
27
|
+
releaseNotes?: string;
|
|
28
|
+
latestVersion: string;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
interface Installed {
|
|
32
|
+
currentVersion: string;
|
|
33
|
+
engineVersion?: string;
|
|
34
|
+
repositoryUrl?: UrlString;
|
|
35
|
+
html?: string;
|
|
36
|
+
installed: {
|
|
37
|
+
path: string;
|
|
38
|
+
shasum?: string;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export interface LocalApp extends Installed, BaseApp {
|
|
43
|
+
source: typeof LOCAL;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface InstalledDownloadableApp
|
|
47
|
+
extends BaseApp,
|
|
48
|
+
Installed,
|
|
49
|
+
Downloadable {
|
|
50
|
+
isWithdrawn: false;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface UninstalledDownloadableApp extends BaseApp, Downloadable {
|
|
54
|
+
isWithdrawn: false;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export interface WithdrawnApp extends BaseApp, Installed, Downloadable {
|
|
58
|
+
isWithdrawn: true;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export type DownloadableApp =
|
|
62
|
+
| InstalledDownloadableApp
|
|
63
|
+
| UninstalledDownloadableApp
|
|
64
|
+
| WithdrawnApp;
|
|
65
|
+
|
|
66
|
+
export type LaunchableApp = LocalApp | InstalledDownloadableApp | WithdrawnApp;
|
|
67
|
+
|
|
68
|
+
export type App = LocalApp | DownloadableApp;
|
|
69
|
+
|
|
70
|
+
export interface AppWithError extends AppSpec {
|
|
71
|
+
reason: unknown;
|
|
72
|
+
path: string;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
const channel = {
|
|
76
|
+
getDownloadableApps: 'apps:get-downloadable-apps',
|
|
77
|
+
installDownloadableApp: 'apps:install-downloadable-app',
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export type SourceWithError = { source: Source; reason?: string };
|
|
81
|
+
|
|
82
|
+
export const isDownloadable = (app?: App): app is DownloadableApp =>
|
|
83
|
+
app != null && app?.source !== LOCAL;
|
|
84
|
+
|
|
85
|
+
export const isInstalled = (app?: App): app is LaunchableApp =>
|
|
86
|
+
app != null && 'installed' in app;
|
|
87
|
+
|
|
88
|
+
export const isWithdrawn = (app?: App): app is WithdrawnApp =>
|
|
89
|
+
isDownloadable(app) && app.isWithdrawn;
|
|
90
|
+
|
|
91
|
+
const latestVersionHasDifferentChecksum = (app: InstalledDownloadableApp) => {
|
|
92
|
+
const shaOfLatest = app.versions?.[app.latestVersion]?.shasum;
|
|
93
|
+
const shaOfInstalled = app.installed.shasum;
|
|
94
|
+
|
|
95
|
+
return (
|
|
96
|
+
shaOfLatest != null &&
|
|
97
|
+
shaOfInstalled != null &&
|
|
98
|
+
shaOfInstalled !== shaOfLatest
|
|
99
|
+
);
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
export const isUpdatable = (app?: App): app is InstalledDownloadableApp =>
|
|
103
|
+
!isWithdrawn(app) &&
|
|
104
|
+
isInstalled(app) &&
|
|
105
|
+
isDownloadable(app) &&
|
|
106
|
+
(app.currentVersion !== app.latestVersion ||
|
|
107
|
+
latestVersionHasDifferentChecksum(app));
|
|
108
|
+
|
|
109
|
+
// getDownloadableApps
|
|
110
|
+
type GetDownloadableAppsResult = {
|
|
111
|
+
apps: DownloadableApp[];
|
|
112
|
+
appsWithErrors: AppWithError[];
|
|
113
|
+
sourcesWithErrors: SourceWithError[];
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
type GetDownloadableApps = () => GetDownloadableAppsResult;
|
|
117
|
+
|
|
118
|
+
const getDownloadableApps = invoke<GetDownloadableApps>(
|
|
119
|
+
channel.getDownloadableApps
|
|
120
|
+
);
|
|
121
|
+
const registerGetDownloadableApps = handle<GetDownloadableApps>(
|
|
122
|
+
channel.getDownloadableApps
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
// installDownloadableApp
|
|
126
|
+
type InstallDownloadableApp = (
|
|
127
|
+
app: DownloadableApp,
|
|
128
|
+
version?: string
|
|
129
|
+
) => DownloadableApp;
|
|
130
|
+
|
|
131
|
+
const installDownloadableApp = invoke<InstallDownloadableApp>(
|
|
132
|
+
channel.installDownloadableApp
|
|
133
|
+
);
|
|
134
|
+
const registerInstallDownloadableApp = handle<InstallDownloadableApp>(
|
|
135
|
+
channel.installDownloadableApp
|
|
136
|
+
);
|
|
137
|
+
|
|
138
|
+
export const forRenderer = {
|
|
139
|
+
registerGetDownloadableApps,
|
|
140
|
+
registerInstallDownloadableApp,
|
|
141
|
+
};
|
|
142
|
+
|
|
143
|
+
export const inMain = {
|
|
144
|
+
getDownloadableApps,
|
|
145
|
+
installDownloadableApp,
|
|
146
|
+
|
|
147
|
+
isDownloadable,
|
|
148
|
+
isInstalled,
|
|
149
|
+
isWithdrawn,
|
|
150
|
+
isUpdatable,
|
|
151
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { BrowserWindow, ipcRenderer, WebContents } from 'electron';
|
|
8
|
+
|
|
9
|
+
let launcherWindow: BrowserWindow | undefined;
|
|
10
|
+
|
|
11
|
+
export const registerLauncherWindowFromMain = (window: BrowserWindow) => {
|
|
12
|
+
launcherWindow = window;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export const send =
|
|
16
|
+
<T extends (...args: never[]) => void>(channel: string) =>
|
|
17
|
+
(...args: Parameters<T>) =>
|
|
18
|
+
launcherWindow?.webContents.send(channel, ...args);
|
|
19
|
+
|
|
20
|
+
export const on =
|
|
21
|
+
<T extends (...args: never[]) => void>(channel: string) =>
|
|
22
|
+
(handler: T) =>
|
|
23
|
+
ipcRenderer.on(channel, (_event, ...args: unknown[]) =>
|
|
24
|
+
handler(...(args as Parameters<T>))
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
// Broadcast with a subchannel
|
|
28
|
+
|
|
29
|
+
export const broadcast =
|
|
30
|
+
<T extends (...args: never[]) => void>(channel: string) =>
|
|
31
|
+
(
|
|
32
|
+
subChannel: string,
|
|
33
|
+
targets: Pick<WebContents, 'send'>[] = [],
|
|
34
|
+
...args: Parameters<T>
|
|
35
|
+
) =>
|
|
36
|
+
targets.forEach(target => {
|
|
37
|
+
target.send(`${channel}_${subChannel}`, ...args);
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export const onBroadcasted =
|
|
41
|
+
<T extends (...args: never[]) => void>(
|
|
42
|
+
channel: string,
|
|
43
|
+
subChannel: string
|
|
44
|
+
) =>
|
|
45
|
+
(handler: T) =>
|
|
46
|
+
ipcRenderer.on(
|
|
47
|
+
`${channel}_${subChannel}`,
|
|
48
|
+
(_event, ...args: unknown[]) => handler(...(args as Parameters<T>))
|
|
49
|
+
);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { ipcMain, ipcRenderer, WebContents } from 'electron';
|
|
8
|
+
|
|
9
|
+
// Send
|
|
10
|
+
export const send =
|
|
11
|
+
<T extends (...args: never[]) => void>(channel: string) =>
|
|
12
|
+
(...args: Parameters<T>) =>
|
|
13
|
+
ipcRenderer.send(channel, ...args);
|
|
14
|
+
|
|
15
|
+
export const on =
|
|
16
|
+
<T extends (...args: never[]) => void>(channel: string) =>
|
|
17
|
+
(handler: T) =>
|
|
18
|
+
ipcMain.on(channel, (_event, ...args: unknown[]) =>
|
|
19
|
+
handler(...(args as Parameters<T>))
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
// Invoke
|
|
23
|
+
export const invoke =
|
|
24
|
+
<T extends (...args: never[]) => unknown>(channel: string) =>
|
|
25
|
+
(...args: Parameters<T>) =>
|
|
26
|
+
ipcRenderer.invoke(channel, ...args) as Promise<ReturnType<T>>;
|
|
27
|
+
|
|
28
|
+
export const handle =
|
|
29
|
+
<T extends (...args: never[]) => unknown>(channel: string) =>
|
|
30
|
+
(
|
|
31
|
+
handler:
|
|
32
|
+
| ((...args: Parameters<T>) => ReturnType<T>)
|
|
33
|
+
| ((...args: Parameters<T>) => Promise<ReturnType<T>>)
|
|
34
|
+
) =>
|
|
35
|
+
ipcMain.handle(channel, (_event, ...args: unknown[]) =>
|
|
36
|
+
handler(...(args as Parameters<T>))
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
export const handleWithSender =
|
|
40
|
+
<T extends (...args: never[]) => unknown>(channel: string) =>
|
|
41
|
+
(
|
|
42
|
+
handler:
|
|
43
|
+
| ((sender: WebContents, ...args: Parameters<T>) => ReturnType<T>)
|
|
44
|
+
| ((
|
|
45
|
+
sender: WebContents,
|
|
46
|
+
...args: Parameters<T>
|
|
47
|
+
) => Promise<ReturnType<T>>)
|
|
48
|
+
) =>
|
|
49
|
+
ipcMain.handle(channel, ({ sender }, ...args: unknown[]) =>
|
|
50
|
+
handler(sender, ...(args as Parameters<T>))
|
|
51
|
+
);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type { AppSpec } from './apps';
|
|
8
|
+
import { on, send } from './infrastructure/rendererToMain';
|
|
9
|
+
|
|
10
|
+
const channel = {
|
|
11
|
+
app: 'open:app',
|
|
12
|
+
launcher: 'open-app-launcher', // It would be nice to call this `open:launcher` but we have to stick to the current name, because that is used by supported apps.
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export interface OpenAppOptions {
|
|
16
|
+
device?: { serialNumber: string; serialPortPath?: string };
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
type OpenApp = (app: AppSpec, openAppOptions?: OpenAppOptions) => void;
|
|
20
|
+
const openApp = send<OpenApp>(channel.app);
|
|
21
|
+
const registerOpenApp = on<OpenApp>(channel.app);
|
|
22
|
+
|
|
23
|
+
type OpenLauncher = () => void;
|
|
24
|
+
const openLauncher = send<OpenLauncher>(channel.launcher);
|
|
25
|
+
const registerOpenLauncher = on<OpenLauncher>(channel.launcher);
|
|
26
|
+
|
|
27
|
+
export const forRenderer = {
|
|
28
|
+
registerOpenApp,
|
|
29
|
+
registerOpenLauncher,
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const inMain = {
|
|
33
|
+
openApp,
|
|
34
|
+
openLauncher,
|
|
35
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { handle, invoke, on, send } from './infrastructure/rendererToMain';
|
|
8
|
+
|
|
9
|
+
const channel = {
|
|
10
|
+
start: 'prevent-sleep:start',
|
|
11
|
+
end: 'prevent-sleep:end',
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
type Start = () => number;
|
|
15
|
+
const start = invoke<Start>(channel.start);
|
|
16
|
+
const registerStart = handle<Start>(channel.start);
|
|
17
|
+
|
|
18
|
+
type End = (id: number) => void;
|
|
19
|
+
const end = send<End>(channel.end);
|
|
20
|
+
const registerEnd = on<End>(channel.end);
|
|
21
|
+
|
|
22
|
+
export const forRenderer = { registerStart, registerEnd };
|
|
23
|
+
export const inMain = { start, end };
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2023 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import type {
|
|
8
|
+
AutoDetectTypes,
|
|
9
|
+
SetOptions,
|
|
10
|
+
UpdateOptions,
|
|
11
|
+
} from '@serialport/bindings-cpp';
|
|
12
|
+
import type { SerialPortOpenOptions } from 'serialport';
|
|
13
|
+
|
|
14
|
+
import { broadcast, onBroadcasted } from './infrastructure/mainToRenderer';
|
|
15
|
+
import {
|
|
16
|
+
handle,
|
|
17
|
+
handleWithSender,
|
|
18
|
+
invoke,
|
|
19
|
+
} from './infrastructure/rendererToMain';
|
|
20
|
+
|
|
21
|
+
const channel = {
|
|
22
|
+
// **************
|
|
23
|
+
// Commands (from the renderer processes of apps to the main process)
|
|
24
|
+
// **************
|
|
25
|
+
open: 'serialport:open',
|
|
26
|
+
close: 'serialport:close',
|
|
27
|
+
write: 'serialport:write',
|
|
28
|
+
update: 'serialport:update',
|
|
29
|
+
set: 'serialport:set',
|
|
30
|
+
|
|
31
|
+
// **************
|
|
32
|
+
// Queries (from the renderer processes of apps to the main process)
|
|
33
|
+
// **************
|
|
34
|
+
isOpen: 'serialport:is-open',
|
|
35
|
+
getOptions: 'serialport:get-options',
|
|
36
|
+
|
|
37
|
+
// **************
|
|
38
|
+
// Callbacks (from the the main process to the renderer processes of apps)
|
|
39
|
+
// **************
|
|
40
|
+
onClosed: 'serialport:on-close',
|
|
41
|
+
onUpdated: 'serialport:on-update',
|
|
42
|
+
onSet: 'serialport:on-set',
|
|
43
|
+
onChanged: 'serialport:on-changed',
|
|
44
|
+
|
|
45
|
+
// Would be nice to rename the next two channels, but we cannot change the
|
|
46
|
+
// string because it would break interoperability between apps and launchers
|
|
47
|
+
onDataReived: 'serialport:on-data',
|
|
48
|
+
onDataWritten: 'serialport:on-write',
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export type OverwriteOptions = {
|
|
52
|
+
overwrite?: boolean;
|
|
53
|
+
settingsLocked?: boolean;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
// **************
|
|
57
|
+
// Commands (from the renderer processes of apps to the main process)
|
|
58
|
+
// **************
|
|
59
|
+
|
|
60
|
+
type Open = (
|
|
61
|
+
options: SerialPortOpenOptions<AutoDetectTypes>,
|
|
62
|
+
overwriteOptions: OverwriteOptions
|
|
63
|
+
) => void;
|
|
64
|
+
const open = invoke<Open>(channel.open);
|
|
65
|
+
const registerOpen = handleWithSender<Open>(channel.open);
|
|
66
|
+
|
|
67
|
+
type Close = (path: string) => void;
|
|
68
|
+
const close = invoke<Close>(channel.close);
|
|
69
|
+
const registerClose = handleWithSender<Close>(channel.close);
|
|
70
|
+
|
|
71
|
+
type Write = (path: string, data: string | number[] | Buffer) => void;
|
|
72
|
+
const write = invoke<Write>(channel.write);
|
|
73
|
+
const registerWrite = handle<Write>(channel.write);
|
|
74
|
+
|
|
75
|
+
type Update = (path: string, options: UpdateOptions) => void;
|
|
76
|
+
const update = invoke<Update>(channel.update);
|
|
77
|
+
const registerUpdate = handle<Update>(channel.update);
|
|
78
|
+
|
|
79
|
+
type Set = (path: string, set: SetOptions) => void;
|
|
80
|
+
const set = invoke<Set>(channel.set);
|
|
81
|
+
const registerSet = handle<Set>(channel.set);
|
|
82
|
+
|
|
83
|
+
// **************
|
|
84
|
+
// Queries (from the renderer processes of apps to the main process)
|
|
85
|
+
// **************
|
|
86
|
+
|
|
87
|
+
type IsOpen = (path: string) => boolean;
|
|
88
|
+
const isOpen = invoke<IsOpen>(channel.isOpen);
|
|
89
|
+
const registerIsOpen = handle<IsOpen>(channel.isOpen);
|
|
90
|
+
|
|
91
|
+
type GetOptions = (
|
|
92
|
+
path: string
|
|
93
|
+
) => SerialPortOpenOptions<AutoDetectTypes> | undefined;
|
|
94
|
+
const getOptions = invoke<GetOptions>(channel.getOptions);
|
|
95
|
+
const registerGetOptions = handle<GetOptions>(channel.getOptions);
|
|
96
|
+
|
|
97
|
+
// **************
|
|
98
|
+
// Callbacks (from the the main process to the renderer processes of apps)
|
|
99
|
+
// **************
|
|
100
|
+
|
|
101
|
+
type OnDataReceived = (data: unknown) => void;
|
|
102
|
+
const broadcastDataReceived = broadcast<OnDataReceived>(channel.onDataReived);
|
|
103
|
+
const registerOnDataReceived = (path: string) =>
|
|
104
|
+
onBroadcasted<OnDataReceived>(channel.onDataReived, path);
|
|
105
|
+
|
|
106
|
+
type OnDataWritten = (data: string | number[] | Buffer) => void;
|
|
107
|
+
const broadcastDataWritten = broadcast<OnDataWritten>(channel.onDataWritten);
|
|
108
|
+
const registerOnDataWritten = (path: string) =>
|
|
109
|
+
onBroadcasted<OnDataWritten>(channel.onDataWritten, path);
|
|
110
|
+
|
|
111
|
+
type OnClosed = () => void;
|
|
112
|
+
const broadcastClosed = broadcast<OnClosed>(channel.onClosed);
|
|
113
|
+
const registerOnClosed = (path: string) =>
|
|
114
|
+
onBroadcasted<OnClosed>(channel.onClosed, path);
|
|
115
|
+
|
|
116
|
+
type OnUpdate = (newOptions: UpdateOptions) => void;
|
|
117
|
+
const broadcastUpdated = broadcast<OnUpdate>(channel.onUpdated);
|
|
118
|
+
const registerOnUpdated = (path: string) =>
|
|
119
|
+
onBroadcasted<OnUpdate>(channel.onUpdated, path);
|
|
120
|
+
|
|
121
|
+
type OnSet = (newOptions: SetOptions) => void;
|
|
122
|
+
const broadcastSet = broadcast<OnSet>(channel.onSet);
|
|
123
|
+
const registerOnSet = (path: string) =>
|
|
124
|
+
onBroadcasted<OnSet>(channel.onSet, path);
|
|
125
|
+
|
|
126
|
+
type OnChanged = (newOptions: SerialPortOpenOptions<AutoDetectTypes>) => void;
|
|
127
|
+
const broadcastChanged = broadcast<OnChanged>(channel.onChanged);
|
|
128
|
+
const registerOnChanged = (path: string) =>
|
|
129
|
+
onBroadcasted<OnChanged>(channel.onChanged, path);
|
|
130
|
+
|
|
131
|
+
export const inRenderer = {
|
|
132
|
+
broadcastChanged,
|
|
133
|
+
broadcastClosed,
|
|
134
|
+
broadcastDataReceived,
|
|
135
|
+
broadcastDataWritten,
|
|
136
|
+
broadcastSet,
|
|
137
|
+
broadcastUpdated,
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
export const forRenderer = {
|
|
141
|
+
registerClose,
|
|
142
|
+
registerGetOptions,
|
|
143
|
+
registerIsOpen,
|
|
144
|
+
registerOpen,
|
|
145
|
+
registerSet,
|
|
146
|
+
registerUpdate,
|
|
147
|
+
registerWrite,
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
export const inMain = {
|
|
151
|
+
open,
|
|
152
|
+
close,
|
|
153
|
+
write,
|
|
154
|
+
update,
|
|
155
|
+
set,
|
|
156
|
+
isOpen,
|
|
157
|
+
getOptions,
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
export const forMain = {
|
|
161
|
+
registerOnDataReceived,
|
|
162
|
+
registerOnDataWritten,
|
|
163
|
+
registerOnClosed,
|
|
164
|
+
registerOnUpdated,
|
|
165
|
+
registerOnSet,
|
|
166
|
+
registerOnChanged,
|
|
167
|
+
};
|
package/ipc/sources.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) 2022 Nordic Semiconductor ASA
|
|
3
|
+
*
|
|
4
|
+
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
import { UrlString } from './MetaFiles';
|
|
8
|
+
|
|
9
|
+
enum StandardSourceNames {
|
|
10
|
+
OFFICIAL = 'official',
|
|
11
|
+
LOCAL = 'local',
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const { LOCAL, OFFICIAL } = StandardSourceNames;
|
|
15
|
+
export const allStandardSourceNames: SourceName[] = [OFFICIAL, LOCAL];
|
|
16
|
+
|
|
17
|
+
export type SourceName = string;
|
|
18
|
+
export type SourceUrl = UrlString;
|
|
19
|
+
export type Source = { name: SourceName; url: SourceUrl };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nordicsemiconductor/pc-nrfconnect-shared",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "80.0.0",
|
|
4
4
|
"description": "Shared commodities for developing pc-nrfconnect-* packages",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,9 +18,10 @@
|
|
|
18
18
|
"files": [
|
|
19
19
|
"./config",
|
|
20
20
|
"./dist",
|
|
21
|
-
"fw",
|
|
22
|
-
"
|
|
23
|
-
"
|
|
21
|
+
"./fw",
|
|
22
|
+
"./ipc",
|
|
23
|
+
"./main",
|
|
24
|
+
"./mocks",
|
|
24
25
|
"./scripts",
|
|
25
26
|
"./src",
|
|
26
27
|
"./test",
|
package/src/About/DeviceCard.tsx
CHANGED
|
@@ -20,11 +20,11 @@ const Row = ({ children }: { children: ReactNode }) => (
|
|
|
20
20
|
);
|
|
21
21
|
|
|
22
22
|
const PcaNumber = ({ device }: { device: Device }) => {
|
|
23
|
-
if (device.boardVersion
|
|
23
|
+
if (!device.jlink?.boardVersion) {
|
|
24
24
|
return null;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
return <div>{device.boardVersion}</div>;
|
|
27
|
+
return <div>{device.jlink.boardVersion}</div>;
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
const MaybeDeviceName = ({ device }: { device: Device }) => {
|
|
@@ -181,7 +181,7 @@ const devicesByPca: { [P in DevicePCA]: DeviceInfo } = {
|
|
|
181
181
|
};
|
|
182
182
|
|
|
183
183
|
const deviceByPca = (device: Device) =>
|
|
184
|
-
devicesByPca[String(device.boardVersion).toUpperCase() as DevicePCA];
|
|
184
|
+
devicesByPca[String(device.jlink?.boardVersion).toUpperCase() as DevicePCA];
|
|
185
185
|
|
|
186
186
|
const NORDIC_VENDOR_ID = '1915';
|
|
187
187
|
const isNordicDevice = (device: Device) =>
|
|
@@ -240,7 +240,7 @@ export const displayedDeviceName = (
|
|
|
240
240
|
return device.nickname;
|
|
241
241
|
}
|
|
242
242
|
|
|
243
|
-
return deviceInfo(device).name || device.boardVersion || 'Unknown';
|
|
243
|
+
return deviceInfo(device).name || device.jlink?.boardVersion || 'Unknown';
|
|
244
244
|
};
|
|
245
245
|
|
|
246
246
|
export const productPageUrl = (device: Device) =>
|
package/src/index.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
|
|
5
5
|
*/
|
|
6
|
+
|
|
6
7
|
import { hideDialog, showDialog } from './ErrorDialog/errorDialogSlice';
|
|
7
8
|
|
|
8
9
|
export const ErrorDialogActions = { hideDialog, showDialog };
|
|
@@ -145,6 +146,18 @@ export {
|
|
|
145
146
|
newSuccessFlashMessage,
|
|
146
147
|
} from './FlashMessage/FlashMessageSlice';
|
|
147
148
|
|
|
148
|
-
export {
|
|
149
|
+
export {
|
|
150
|
+
inMain as apps,
|
|
151
|
+
type App as AppType,
|
|
152
|
+
type AppSpec,
|
|
153
|
+
type AppWithError,
|
|
154
|
+
type DownloadableApp,
|
|
155
|
+
type InstalledDownloadableApp,
|
|
156
|
+
type LaunchableApp,
|
|
157
|
+
type LocalApp,
|
|
158
|
+
type SourceWithError,
|
|
159
|
+
type UninstalledDownloadableApp,
|
|
160
|
+
type WithdrawnApp,
|
|
161
|
+
} from '../ipc/apps';
|
|
149
162
|
export { inMain as openWindow } from '../ipc/openWindow';
|
|
150
163
|
export { inMain as preventSleep } from '../ipc/preventSleep';
|
package/src/utils/packageJson.ts
CHANGED
|
@@ -32,7 +32,7 @@ import { readFileSync } from 'fs';
|
|
|
32
32
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
33
33
|
// @ts-ignore This will be available when the app uses it.
|
|
34
34
|
// eslint-disable-next-line import/no-unresolved
|
|
35
|
-
import packageJsons from '
|
|
35
|
+
import packageJsons from '../../../../../package.json';
|
|
36
36
|
import type { PackageJson } from '../../ipc/MetaFiles';
|
|
37
37
|
|
|
38
38
|
let packageJson: PackageJson = packageJsons;
|
|
@@ -95,9 +95,9 @@ const allDevicesReport = (allDevices: Device[] = []) => [
|
|
|
95
95
|
'- Connected devices:',
|
|
96
96
|
...allDevices.map(
|
|
97
97
|
d =>
|
|
98
|
-
` - ${d.serialNumber} ${
|
|
99
|
-
?.
|
|
100
|
-
|
|
98
|
+
` - ${d.serialNumber} ${
|
|
99
|
+
d.jlink?.boardVersion || ''
|
|
100
|
+
}: ${d.serialPorts?.map(s => s.comName).join(', ')}`
|
|
101
101
|
),
|
|
102
102
|
'',
|
|
103
103
|
];
|
|
@@ -50,6 +50,10 @@ export type SourceWithError = {
|
|
|
50
50
|
source: Source;
|
|
51
51
|
reason?: string;
|
|
52
52
|
};
|
|
53
|
+
export declare const isDownloadable: (app?: App) => app is DownloadableApp;
|
|
54
|
+
export declare const isInstalled: (app?: App) => app is LaunchableApp;
|
|
55
|
+
export declare const isWithdrawn: (app?: App) => app is WithdrawnApp;
|
|
56
|
+
export declare const isUpdatable: (app?: App) => app is InstalledDownloadableApp;
|
|
53
57
|
type GetDownloadableAppsResult = {
|
|
54
58
|
apps: DownloadableApp[];
|
|
55
59
|
appsWithErrors: AppWithError[];
|
|
@@ -62,6 +66,10 @@ export declare const forRenderer: {
|
|
|
62
66
|
export declare const inMain: {
|
|
63
67
|
getDownloadableApps: () => Promise<GetDownloadableAppsResult>;
|
|
64
68
|
installDownloadableApp: (app: DownloadableApp, version?: string | undefined) => Promise<DownloadableApp>;
|
|
69
|
+
isDownloadable: (app?: App) => app is DownloadableApp;
|
|
70
|
+
isInstalled: (app?: App) => app is LaunchableApp;
|
|
71
|
+
isWithdrawn: (app?: App) => app is WithdrawnApp;
|
|
72
|
+
isUpdatable: (app?: App) => app is InstalledDownloadableApp;
|
|
65
73
|
};
|
|
66
74
|
export {};
|
|
67
75
|
//# sourceMappingURL=apps.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../../ipc/apps.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEtD,MAAM,WAAW,OAAO;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,UAAU,CAAC;CACtB;AAED,UAAU,OAAO;IACb,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,UAAU,YAAY;IAClB,MAAM,EAAE,UAAU,CAAC;IACnB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,QAAQ,CAAC,EAAE,WAAW,CAAC;IACvB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,EAAE,MAAM,CAAC;CACzB;AAED,UAAU,SAAS;IACf,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS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MAAM,EAAE,MAAM,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAElE,eAAO,MAAM,cAAc,SAAU,GAAG,2BACA,CAAC;AAEzC,eAAO,MAAM,WAAW,SAAU,GAAG,yBACA,CAAC;AAEtC,eAAO,MAAM,WAAW,SAAU,GAAG,wBACK,CAAC;AAa3C,eAAO,MAAM,WAAW,SAAU,GAAG,oCAKU,CAAC;AAGhD,KAAK,yBAAyB,GAAG;IAC7B,IAAI,EAAE,eAAe,EAAE,CAAC;IACxB,cAAc,EAAE,YAAY,EAAE,CAAC;IAC/B,iBAAiB,EAAE,eAAe,EAAE,CAAC;CACxC,CAAC;AAwBF,eAAO,MAAM,WAAW;;;CAGvB,CAAC;AAEF,eAAO,MAAM,MAAM;;;2BA7DkB,GAAG;wBAGN,GAAG;wBAGH,GAAG;wBAcH,GAAG;CAiDpC,CAAC"}
|
|
@@ -67,7 +67,7 @@ export { default as ConflictingSettingsDialog } from './SerialPort/ConflictingSe
|
|
|
67
67
|
export type { AppDispatch, AppThunk, NrfConnectState } from './store';
|
|
68
68
|
export { type DeviceSetupConfig, type DeviceSetup, prepareDevice, } from './Device/deviceSetup';
|
|
69
69
|
export { addNewMessage, newCopiedFlashMessage, newInfoFlashMessage, newWarningFlashMessage, newErrorFlashMessage, newSuccessFlashMessage, } from './FlashMessage/FlashMessageSlice';
|
|
70
|
-
export { inMain as apps } from '../ipc/apps';
|
|
70
|
+
export { inMain as apps, type App as AppType, type AppSpec, type AppWithError, type DownloadableApp, type InstalledDownloadableApp, type LaunchableApp, type LocalApp, type SourceWithError, type UninstalledDownloadableApp, type WithdrawnApp, } from '../ipc/apps';
|
|
71
71
|
export { inMain as openWindow } from '../ipc/openWindow';
|
|
72
72
|
export { inMain as preventSleep } from '../ipc/preventSleep';
|
|
73
73
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../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