import { PGN, PGN_126208_NmeaRequestGroupFunction, PGN_126208_NmeaCommandGroupFunction, PGN_126208_NmeaAcknowledgeGroupFunction, PGN_126208_NmeaReadFieldsGroupFunction, PGN_126208_NmeaReadFieldsReplyGroupFunction, PGN_126208_NmeaWriteFieldsGroupFunction, PGN_126208_NmeaWriteFieldsReplyGroupFunction } from './pgns'; import { GroupFunction } from './enums'; import { Definition } from './definition'; export { getEnumerations, getEnumeration, getEnumerationValue, getEnumerationName, getBitEnumerations, getBitEnumeration, getBitEnumerationValue, getBitEnumerationName, getFieldTypeEnumerations, getFieldTypeEnumeration, getFieldTypeEnumerationValue, getFieldTypeEnumerationName, getFieldTypeEnumerationBits, updateLookup, removeLookup, updateBitLookup, removeBitLookup } from './lookups'; /** * @category PGN Definition Access */ export declare const getAllPGNs: () => Definition[]; /** * @category PGN Definition Editing */ export declare const updatePGN: (updatedDefinition: Definition) => void; export declare const removePGN: (pgn: Definition) => void; /** * Retrieves the PGN definitions associated with a given number. * * @param num - The number used to look up PGN definitions. * @returns An array of `Definition` objects if found, or `undefined` if no definitions exist for the provided number. * @category PGN Definition Access */ export declare const getPGNWithNumber: (num: number) => Definition[] | undefined; /** * Retrieves a PGN definition by its unique identifier. * * @param id - The unique identifier of the PGN definition to retrieve. * @returns The corresponding {@link Definition} object if found; otherwise, `undefined`. * @category PGN Definition Access */ export declare const getPGNWithId: (id: string) => Definition | undefined; export declare const findFallBackPGN: (pgn: number) => Definition | undefined; /** * Determines whether a given PGN object matches all specified fields. * * @param pgn - The PGN object to check, expected to have a `fields` property. * @param matchFields - An object containing key-value pairs to match against `pgn.fields`. * @returns `true` if all keys in `matchFields` exist in `pgn.fields` and have equal values; otherwise, `false`. * @category Utilities */ export declare const isMatch: (pgn: any, matchFields: any) => boolean; /** * Maps the keys of a PGN object to camelCase names based on its definition. * * This function transforms the keys of the provided PGN object by looking up a matching definition, * and then mapping field IDs to their corresponding camelCase field names. It handles both regular * and repeating fields, and supports PGN objects with or without a `fields` property. * * @param pgn - The PGN object to map. * @returns An object with keys mapped to camelCase field names, including nested fields and repeating field sets. * @throws If no matching definition is found for the provided PGN object. * @category Utilities */ export declare const mapCamelCaseKeys: (pgn: PGN) => any; /** * Maps the keys of a PGN object from their original names to camelCase IDs as defined in a matching definition. * * This function searches for a matching definition for the provided PGN object, creates a new PGN structure, * and copies over non-field properties. It then maps field values from their original names to their corresponding * IDs, including handling repeating field sets if present. * * @param pgn - The PGN object to be transformed. * @returns A new PGN object with keys mapped to camelCase IDs. * @throws If no matching definition is found for the provided PGN object. * @category Utilities */ export declare const mapNameKeysToCamelCase: (pgn: any) => PGN; /** * Finds and returns the matching PGN definition for a given PGN object. * * This function retrieves possible definitions for the provided PGN, filters out fallback definitions, * and iteratively matches fields with specific criteria. If a field has a `Match` property, it compares * the numeric value of the field in the PGN with the definition. Throws an error if no matching definition * is found or if a field value is invalid. * * @param pgn - The PGN object containing the PGN string and associated fields to match against definitions. * @returns The matching `Definition` object for the provided PGN. * @throws If the PGN is unknown, if a field value is invalid, or if no matching definition is found. * @category PGN Definition Access */ export declare const findMatchingDefinition: (pgn: PGN) => Definition; /** * Converts a given name string to a valid identifier by first transforming it to camel case, * then fixing any invalid characters using underscores as replacements. * * @param name - The input string to be converted into an identifier. * @returns A string representing the fixed identifier in camel case format. * @category Utilities */ export declare const nameToId: (name: string) => string; /** * Set whether the signalk-server supports camelCase keys in PGNs. * This is mainly useful for testing purposes. * * @category Utilities */ export declare const setSupportsCamelCaseCacheEnabled: (enabled: boolean) => void; export declare function isCamelCaseSupported(app: any): boolean; /** * Converts the keys of a PGN object to camelCase if the server does not support camelCase. * * @param pluginApp - The plugin application instance used to determine camelCase support. * @param pgn - The PGN object whose keys may be converted to camelCase. * @returns The PGN object with camelCase keys if not supported by the server; otherwise, returns the original PGN object. * @category Utilities */ export declare const convertCamelCase: (pluginApp: any, pgn: PGN) => any; /** * Converts the property names of a PGN object to camelCase if the server does not support camelCase. * * @param pluginApp - The plugin application instance used to determine camelCase support. * @param pgn - The PGN object whose property names may be converted. * @returns The PGN object with property names in camelCase if not supported by the server; otherwise, returns the original PGN object. * @category Utilities */ export declare const convertNamesToCamel: (pluginApp: any, pgn: any) => any; /** * Creates an instance of a NMEA 2000 group function PGN message based on the specified group function type, * PGN definition, and optional destination address. * * This utility function maps the provided group function to the appropriate PGN message constructor, * populating its parameters and values from the PGN's field definitions. * * @param groupFunction - The type of group function to create (e.g., Request, Command, Acknowledge, ReadFields, etc.). * @param pgn - The PGN object containing the definition and field values. * @param fields - Optional additional fields to include in the message. * @param dst - Optional destination address for the message. * @returns An instance of the corresponding NMEA 2000 group function PGN message. * @throws Error if the provided group function is not supported. * @category Utilities */ export declare const createNmeaGroupFunction: (groupFunction: GroupFunction, pgn: PGN, fields?: any, dst?: number) => PGN_126208_NmeaRequestGroupFunction | PGN_126208_NmeaCommandGroupFunction | PGN_126208_NmeaAcknowledgeGroupFunction | PGN_126208_NmeaReadFieldsGroupFunction | PGN_126208_NmeaReadFieldsReplyGroupFunction | PGN_126208_NmeaWriteFieldsGroupFunction | PGN_126208_NmeaWriteFieldsReplyGroupFunction; export { generatePgnHeaderEntry, generateMultiplePgnHeaderEntries, generateLookupHeaderEntry, generateBitLookupHeaderEntry, generateFieldTypeLookupHeaderEntry, generateMultipleLookupEntries } from './pgnHeaderGenerator'; //# sourceMappingURL=utilities.d.ts.map