diff --git a/src/core/Action.js b/src/core/Action.js index cc1efdf9f..f65c2a44e 100644 --- a/src/core/Action.js +++ b/src/core/Action.js @@ -5,21 +5,7 @@ import { EventEmitter } from 'eventemitter3'; import Ros from '../core/Ros.js'; - -/** - * An "enumeration" for goal statuses. - * This is directly based on the action_msgs/GoalStatus ROS message: - * https://docs.ros2.org/latest/api/action_msgs/msg/GoalStatus.html - */ -const GoalStatus = Object.freeze({ - STATUS_UNKNOWN: 0, - STATUS_ACCEPTED: 1, - STATUS_EXECUTING: 2, - STATUS_CANCELING: 3, - STATUS_SUCCEEDED: 4, - STATUS_CANCELED: 5, - STATUS_ABORTED: 6 -}); +import { GoalStatus } from '../core/GoalStatus.ts' /** * A ROS 2 action client. diff --git a/src/core/GoalStatus.ts b/src/core/GoalStatus.ts new file mode 100644 index 000000000..7b2a3cd11 --- /dev/null +++ b/src/core/GoalStatus.ts @@ -0,0 +1,14 @@ +/** + * An enumeration for goal statuses. + * This is directly based on the action_msgs/GoalStatus ROS message: + * https://docs.ros2.org/latest/api/action_msgs/msg/GoalStatus.html + */ +export enum GoalStatus { + STATUS_UNKNOWN = 0, + STATUS_ACCEPTED = 1, + STATUS_EXECUTING = 2, + STATUS_CANCELING = 3, + STATUS_SUCCEEDED = 4, + STATUS_CANCELED = 5, + STATUS_ABORTED = 6 +} diff --git a/tsconfig.json b/tsconfig.json index f462b1b0c..7ffadcc31 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,6 +5,7 @@ "rootDir": "./src" /* Specify the root folder within your source files. */, "allowJs": true /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */, "checkJs": true /* Enable error reporting in type-checked JavaScript files. */, + "allowImportingTsExtensions": true /* Enable importing TypeScript files. */, "declaration": true /* Generate .d.ts files from TypeScript and JavaScript files in your project. */, "outDir": "./tsbuild" /* Specify an output folder for all emitted files. */, "declarationDir": "./build" /* Specify the output directory for generated declaration files. */,