You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: demo/typescript/topics/README.md
+6-15Lines changed: 6 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,30 +105,21 @@ For development, you can run TypeScript files directly with ts-node:
105
105
106
106
## TypeScript Setup
107
107
108
-
This demo includes a self-contained TypeScript configuration that allows compilation without requiring the full rclnodejs installation to be built first. The key components are:
109
-
110
-
### Local Type Definitions
111
-
112
-
The `types/rclnodejs.d.ts` file provides basic TypeScript declarations for rclnodejs, enabling:
113
-
114
-
- ✅ TypeScript compilation without dependencies
115
-
- ✅ Type checking and IntelliSense support
116
-
- ✅ Proper interface definitions for common ROS2 operations
108
+
This demo builds against the in-tree **rclnodejs** package
109
+
(`"rclnodejs": "file:../../.."`), so it uses the package's own TypeScript
110
+
declarations — there are no local stub types.
117
111
118
112
### TypeScript Configuration
119
113
120
114
The `tsconfig.json` is configured to:
121
115
122
-
- Use local type definitions from the `types/` directory
116
+
- Use modern `NodeNext` module resolution, matching how Node.js resolves the
117
+
package's `exports` map
118
+
- Target `ES2022`, consistent with the rclnodejs package itself
123
119
- Compile TypeScript to JavaScript in the `dist/` directory
124
120
- Generate source maps and declaration files
125
121
- Enable strict type checking
126
122
127
-
### Development vs Runtime
128
-
129
-
-**Compilation**: Uses local type definitions (no rclnodejs dependency)
130
-
-**Runtime**: Requires actual rclnodejs installation and ROS 2 environment
0 commit comments