Skip to content

Commit

Permalink
refactor: 🏷️ add correct type output to FormatTle
Browse files Browse the repository at this point in the history
  • Loading branch information
thkruz committed Jan 24, 2024
1 parent 4a51899 commit c16fe23
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/coordinate/FormatTle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* SOFTWARE.
*/

import { Tle, StringifiedNumber, TleParams } from '../main';
import { Tle, StringifiedNumber, TleParams, TleLine1, TleLine2 } from '../main';

/**
* A class containing static methods for formatting TLEs (Two-Line Elements).
Expand All @@ -36,7 +36,7 @@ export abstract class FormatTle {
* @param tleParams - The parameters used to generate the TLE.
* @returns An object containing the TLE strings tle1 and tle2.
*/
static createTle(tleParams: TleParams): { tle1: string; tle2: string } {
static createTle(tleParams: TleParams): { tle1: TleLine1; tle2: TleLine2 } {
const { inc, meanmo, rasc, argPe, meana, ecen, epochyr, epochday, intl } = tleParams;
const scc = Tle.convert6DigitToA5(tleParams.scc);
const epochYrStr = epochyr.padStart(2, '0');
Expand All @@ -61,7 +61,7 @@ export abstract class FormatTle {
const tle1 = `1 ${scc}U ${intlStr} ${epochYrStr}${epochdayStr}${TLE1Ending}`;
const tle2 = `2 ${scc} ${incStr} ${rascStr} ${ecenStr} ${argPeStr} ${meanaStr} ${meanmoStr} 00010`;

return { tle1, tle2 };
return { tle1: tle1 as TleLine1, tle2: tle2 as TleLine2 };
}

/**
Expand Down

0 comments on commit c16fe23

Please sign in to comment.