cleaned for new home

This commit is contained in:
2025-06-23 12:40:35 +02:00
parent e426efb80f
commit 1f4970c17c
173 changed files with 16228 additions and 24225 deletions

View File

@@ -0,0 +1,8 @@
export declare const DEFAULT_VEHICLE_IMAGE = "/hacsfiles/Ultra-Vehicle-Card/assets/default-car.png";
export declare const DEFAULT_CONFIG: {
title: string;
title_alignment: string;
formatted_entities: boolean;
};
export declare const truncateText: (text: string, maxLength?: number) => string;
export declare const hexToRgb: (colorValue: string) => string;

View File

@@ -0,0 +1,23 @@
import { HomeAssistant } from 'custom-card-helpers';
export interface ImageUploadResponse {
path: string;
file_id: string;
success: boolean;
error?: string;
warning?: string;
}
/**
* Uploads a file to the Home Assistant media source OR older image API.
* @param hass The Home Assistant object.
* @param file The file to upload.
* @returns The path of the uploaded file (/api/image/serve/<id> format).
* @throws An error if the upload fails or the response is invalid.
*/
export declare function uploadImage(hass: HomeAssistant, file: File): Promise<string>;
/**
* Gets the full URL for an uploaded image
* @param hass - Home Assistant instance
* @param path - Image path returned from upload
* @returns Full URL to the image
*/
export declare function getImageUrl(hass: HomeAssistant, path: string): string;

View File

@@ -0,0 +1,7 @@
import { UltraVehicleCardConfig } from '../types';
/**
* Migrates a configuration object from version 1.x to the current format.
* @param oldConfig The configuration object from version 1.x.
* @returns The migrated configuration object conforming to UltraVehicleCardConfig.
*/
export declare function migrateV1Config(oldConfig: any): UltraVehicleCardConfig;

View File

@@ -0,0 +1,27 @@
/**
* Translation Helper Utilities
*
* This file provides utilities to help developers manage translations
* in the Ultra Vehicle Card project. These functions are intended
* for development use only and will not be included in production builds.
*/
/**
* Adds a new translation entry to the collection.
* This is used during development to mark strings that need to be added
* to the translation files.
*
* @param fullKey The full dot-notation key for the translation (e.g., 'editor.vehicle_info.title')
* @param text The English text for this translation
* @param description Optional description to explain the context of this string
*/
export declare function addTranslation(fullKey: string, text: string, description?: string): void;
/**
* Logs all collected translation entries that need to be added to the translation files.
* Call this function in development to see all the translations that need to be added.
*/
export declare function logNewTranslations(): void;
/**
* Clears all collected translation entries.
* Call this after you've added the translations to the files.
*/
export declare function clearNewTranslations(): void;