Skip to content

Commit 91f59a4

Browse files
authored
[TypeScript] Add declaration for removeSignalHandlers() (#1023)
This patch adds the declaration for removeSignalHandlers() method into index.d.ts. Fix: #1022
1 parent 38c3502 commit 91f59a4

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

test/types/main.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ rclnodejs.isShutdown();
2121
// $ExpectType void
2222
rclnodejs.shutdown();
2323

24+
// $ExpectType void
25+
rclnodejs.removeSignalHandlers();
26+
2427
// ---- DistroUtil ----
2528

2629
// $ExpectType DistroId

types/index.d.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,13 @@ declare module 'rclnodejs' {
144144
type: T
145145
): MessageType<T>;
146146

147+
/**
148+
* Removes the default signal handler installed by rclnodejs. After calling this, rclnodejs
149+
* will no longer clean itself up when a SIGINT is received, it is the application's
150+
* responsibility to properly shut down all nodes and contexts.
151+
*/
152+
function removeSignalHandlers(): void;
153+
147154
/**
148155
* Get a list of action names and types for action clients associated with a node.
149156
* @param node - The node used for discovery.

0 commit comments

Comments
 (0)