import { EncoderConfigurationUsage } from './encoder'; import { OblacDrivesRelease } from './oblac-drives-release'; import { FirmwareProductSupportedOptions, PartConfigurationTable } from './types'; /** * The brand ID for OBLAC Drives. */ export declare const oblacDrivesBrandId = "a7e925fa-57b7-4741-9126-0840a63cdb71"; /** * The hostname of the current environment. * Defaults to 'localhost' if running outside a browser (e.g., Node.js). */ export declare const hostname: string; /** * AWS API Gateway endpoint for OBLAC Drives services. * S3 URI: s3://synapticon/oblac-drives/ */ export declare const oblacDrivesApiGatewayOrigin = "https://pc27e3jixd.execute-api.us-east-1.amazonaws.com"; /** * Base URL for the CDN hosting OBLAC Drives assets. */ export declare const cdnBasePath = "https://d9k1r8ajdoczx.cloudfront.net"; /** * Hostname and port for the local cache server (OBLAC Drives Update Service). */ export declare const cacheHostname: string; /** * Base origin URL for the local cache server. */ export declare const cacheOrigin: string; /** * Base path for accessing cached S3 resources via the local cache server. */ export declare const cacheS3BasePath: string; /** * Base path for the local cache API. */ export declare const cacheApiBasePath: string; /** * Caches the specified object (file) locally, either on the box or within the native Electron app. * * @param path - The destination path where the object should be cached. * @param body - The object (file) data to cache, provided as a Blob. * @returns A promise that resolves when caching completes (only resolves in Electron; * for other environments, caching is attempted but not awaited). */ export declare function cacheOnBox(path: string, body: Blob): Promise; /** * Compares two OBLAC Drives bundle filenames by their embedded version strings, * sorting them in descending order based on version. * * The version is extracted from the filename suffix matching the pattern `_.odbx`. * * @param a - The first bundle filename to compare. * @param b - The second bundle filename to compare. * @returns A negative number if `b` has a newer version than `a`, positive if `a` is newer, * or 0 if they are equal or the version cannot be determined. */ export declare function compareBundlesByVersionDesc(a: string, b: string): number; /** * Constructs a full CDN URL by appending the given path to the base CDN URL. * * @param path - The relative path to the object (file) on the CDN. * @returns The complete URL pointing to the resource on the CDN. */ export declare function makeCdnUrl(path: string): string; /** * Retrieves a previously cached object (file) from the OBLAC box or native app cache. * * When running in an Electron app, it uses the native API to get the cached file, * otherwise it fetches from a local cache HTTP path. * * @param path - The path to the cached object within the box or app cache. * @param resolveTo - The format to resolve the fetched object to: `'blob'`, `'json'`, or `'text'`. * @returns A promise that resolves to the cached object in the specified format, * or `undefined` if the file could not be retrieved. */ export declare function fetchFromBox(path: string, resolveTo: 'blob' | 'json' | 'text'): Promise; /** * Fetches an object (file) from S3, resolves it to the specified format (JSON, text, or binary), * and optionally caches it locally (on the box or within the native app). * * **Note:** Cached data is stored under the `/synapticon/oblac-drives/` prefix to align with the bundle's cache location. * * If offline or if the fetch fails (including HTTP errors), the function falls back to retrieving the cached version. * * @param path - The S3 path to the object. * @param resolveTo - The desired response format: `'blob'`, `'json'`, or `'text'`. * @param cache - Whether to cache the fetched object locally. Defaults to false if not specified. * @returns A promise that resolves to the fetched object in the specified format. */ export declare function fetchAndResolve(path: string, resolveTo: 'blob' | 'json' | 'text', cache: boolean): Promise; /** * Fetches the brand JSON data, then retrieves and adds the logo and Bootstrap theme URLs to the object. * * @param brandJsonUrl - The URL of the brand JSON file. Defaults to `'brand.json'`. * @param themeVersion - The version number of the Bootstrap theme to fetch. Defaults to `1`. * @param cache - If `true`, caches the fetched resources locally. Defaults to `true`. * @returns A promise that resolves to the brand object extended with `logo` and `bootstrap` CSS content, * or `undefined` if fetching or parsing fails. */ export declare function fetchBrandData(brandJsonUrl?: string, themeVersion?: number, cache?: boolean): Promise<{ bootstrap: string; id: string; logo: string; name: string; } | undefined>; /** * Fetches the ESI file for a specified brand and firmware version. * * @param brandId - The unique identifier of the brand. * @param version - The firmware version to fetch the ESI file for. * @param cache - If `true`, caches the fetched ESI file locally. Defaults to `true`. * @returns A promise that resolves to the ESI file content as a string. */ export declare function fetchEsi(brandId: string, version: string, cache?: boolean): Promise; /** * Fetches the content of a firmware package as a Blob. * * @param brandId - The unique identifier of the brand. * @param filename - The name of the firmware package file. * @param cache - If `true`, caches the fetched package locally. Defaults to `true`. * @returns A promise that resolves to the firmware package content as a Blob. */ export declare function fetchFirmwarePackage(brandId: string, filename: string, cache?: boolean): Promise; /** * Fetches the SVG product image for a given brand using a product ID or image ID. * * @param brandId - The unique identifier of the brand. * @param id - The product ID or image ID (number or string). * @param cache - If `true`, caches the fetched image locally. Defaults to `true`. * @returns A promise that resolves to the SVG image as a string. */ export declare function fetchProductImage(brandId: string, id: number | string, cache?: boolean): Promise; /** * Fetches the firmware changelog in Markdown format for a specified minor version. * * @param brandId - The unique identifier of the brand. * @param minorVersion - The minor firmware version to fetch the changelog for. * @param cache - If `true`, caches the fetched changelog locally. Defaults to `true`. * @returns A promise that resolves to the changelog content as a Markdown string. * Rejects if the fetched content is invalid or not found. */ export declare function fetchFirmwareChangelog(brandId: string, minorVersion: string, cache?: boolean): Promise; /** * Fetches both production and development OBLAC Drives releases. * * @param cache - If `true`, caches the fetched data locally. Defaults to `true`. * @returns A promise that resolves to a tuple containing two arrays: * - The first array holds production releases (`OblacDrivesRelease[]`). * - The second array holds development releases (`OblacDrivesRelease[]`). */ export declare function fetchOblacDrivesReleases(cache?: boolean): Promise<[OblacDrivesRelease[], OblacDrivesRelease[]]>; /** * Lists firmware package filenames for a given brand. * * @param brandId - The unique identifier of the brand. * @param latestMinorVersionsOnly - If `true`, only includes the latest minor versions; otherwise includes all versions. Defaults to `false`. * @param cache - If `true`, caches the fetched data locally. Defaults to `true`. * @returns A promise that resolves to an array of firmware package filenames. */ export declare function listFirmwarePackages(brandId: string, latestMinorVersionsOnly?: boolean, cache?: boolean): Promise; /** * Retrieves a list of available Oblac Drives Update Service versions. * * Waits for the online state to initialize, then fetches the version list * either from the live API or a local cache depending on connectivity. * * @returns A promise that resolves to an array of version strings. */ export declare function listOblacDrivesUpdateServiceVersions(): Promise; /** * Retrieves the list of supported encoder configuration types from a JSON resource hosted on AWS S3. * * @deprecated Use new structure with `fetchEncoderConfigurationsUsage` instead * @returns A promise that resolves to a `FirmwareProductSupportedOptions` object * containing the supported encoder configuration types. */ export declare function fetchSupportedEncoderConfigurationTypes(): Promise; /** * Retrieves the list of encoder configuration usage information from a JSON resource hosted on AWS S3. * * @returns A promise that resolves to a `EncoderConfigurationUsage` object * containing the encoder configuration supported types and subindexes usage . */ export declare function fetchEncoderConfigurationsUsage(): Promise; /** * Retrieves the list of supported analog inputs from a JSON resource hosted on AWS S3. * * @returns A promise that resolves to a `FirmwareProductSupportedOptions` object * containing the supported analog inputs. */ export declare function fetchSupportedAis(): Promise; /** * Retrieves the list of supported digital input/output from a JSON resource hosted on AWS S3. * * @returns A promise that resolves to a `FirmwareProductSupportedOptions` object * containing the supported digital input/output. */ export declare function fetchSupportedDios(): Promise; /** * Retrieves the motor configuration data from a JSON resource hosted on AWS S3. * * @returns A promise that resolves to a `PartConfigurationTable` object * containing available motor configurations. */ export declare function fetchMotorConfigurations(): Promise; /** * Retrieves the encoder configuration data from a JSON resource hosted on AWS S3. * * @returns A promise that resolves to a `PartConfigurationTable` object * containing available encoder configurations. */ export declare function fetchEncoderConfigurations(firmwareMajorVersion: number): Promise;