///////////////////////////////////////////////////////////////////////////////////////////// // Copyright 2026 Garmin International, Inc. // Licensed under the Flexible and Interoperable Data Transfer (FIT) Protocol License; you // may not use this file except in compliance with the Flexible and Interoperable Data // Transfer (FIT) Protocol License. ///////////////////////////////////////////////////////////////////////////////////////////// // ****WARNING**** This file is auto-generated! Do NOT edit this file. // Profile Version = 21.222.0Release // Tag = production/release/21.222.0-0-g71fae187 ///////////////////////////////////////////////////////////////////////////////////////////// import { Encodable, Mesg } from "./mesg.js"; import { DeveloperDataIdMesg, FieldDescriptionMesg } from "./mesgs.js"; export interface FieldDescription { /** The Developer Data Id message. */ developerDataIdMesg: DeveloperDataIdMesg; /** The Field Description message. */ fieldDescriptionMesg: FieldDescriptionMesg; } /** Options for constructing an {@link Encoder}. */ export interface EncoderOptions { /** Developer field descriptions keyed by developer data index. Equivalent to calling {@link Encoder.addDeveloperField} for each entry. */ fieldDescriptions?: Record; } /** Encodes FIT messages into a binary FIT file. */ export class Encoder { /** * Creates a FIT File Encoder. * @param options - Encoder options. See {@link EncoderOptions}. */ constructor(options?: EncoderOptions); /** * Closes the encoder and returns the encoded file data. * @returns A `Uint8Array` containing the encoded FIT file. */ close(): Uint8Array; /** * Encodes a message into the file. * @param mesg - The message data, must include a `mesgNum` property. * @returns `this`. */ writeMesg(mesg: Encodable): this; /** * Encodes a message into the file. * Can be used directly as a {@link DecoderOptions.mesgListener} callback. * @param mesgNum - The message number. * @param mesg - The message data. * @returns `this`. */ onMesg(mesgNum: number, mesg: Mesg): this; /** * Adds a Developer Data Field Description and associated Developer Data Id Message to the Encoder. * Does not write these messages to the output stream. * Can be used directly as a {@link DecoderOptions.fieldDescriptionListener} callback. * @param key - The key associated with this developer field pairing. * @param developerDataIdMesg - The Developer Data Id message. * @param fieldDescriptionMesg - The Field Description message. * @returns `this`. */ addDeveloperField(key: number, developerDataIdMesg: DeveloperDataIdMesg, fieldDescriptionMesg: FieldDescriptionMesg): this; }