JaiaBot  1.12.0+18+g85da5f82
JaiaBot micro-AUV software
Jaia Coding Standards

Function Comments (TypeScript)

``` /**

  • Describe what the function does
  • Parameters
    {string}name Briefly explain why we need this parameter
  • Returns
    {string} Briefly describe what is being returned */ function createGreeting(name: string) { return Hello ${name}, }
    ### Explanation of the comments:
    * **Description**: Provides a brief overview of what the function is designed to do
    * **Parameters**: Justifies why the parameters are needed
    * **Return Value**: Specifies the output of the function
    *This type of comment helps future developers understand the purpose of the function and what to expect when using it.*
    ### More Examples
    /**
  • Determines which runs in a mission are eligible to start and plays those runs
  • Parameters
    {MissionInterface}mission Holds the runs
  • Parameters
    {CommandList}addRuns A set of runs to be added to the mission
  • Returns
    {void} */ runMission(mission: MissionInterface, addRuns: CommandList) { // Run mission }
    /**
  • Reset mission planning
  • Parameters
    {MissionInterface}mission Used to access the mission state
  • Parameters
    {boolean}needConfirmation Does the deletion require a confirmation by the opertor?
  • Returns
    {Promise<boolean>} Did the deletion occur? */ async deleteAllRunsInMission(mission: MissionInterface, needConfirmation: boolean) { // Delete all runs } ```