import type { TServiceParams } from "@digital-alchemy/core"; import type { ByIdProxy, PICK_ENTITY } from "@digital-alchemy/hass"; import type { Dayjs } from "dayjs"; import type { AddEntityOptions, BasicAddParams, CallbackData, SettableConfiguration, SynapseEntityProxy } from "../../helpers/index.mts"; type Year = `${number}${number}${number}${number}`; type MD = `${number}${number}`; /** * YYYY-MM-DD */ export type SynapseDateFormat = `${Year}-${MD}-${MD}`; export type DateConfiguration = { /** * default: true */ managed?: boolean; date_type?: DATE_TYPE; native_value?: SettableConfiguration, DATA>; }; export type DateEvents = { set_value: { value: VALUE; }; }; type TypeOptions = "dayjs" | "date" | "iso"; type DateParams = BasicAddParams & { date_type?: TypeOptions; }; type SerializeTypes = SynapseDateFormat | Date | Dayjs; type CallbackType = D extends "dayjs" ? Dayjs : D extends "date" ? Date : SynapseDateFormat; /** * Convenient type for date entities with optional attributes and locals */ export type SynapseDate = SynapseEntityProxy, DateEvents, ATTRIBUTES, LOCALS, DATA, PICK_ENTITY<"date">> & { entity: ByIdProxy>; }; export declare function VirtualDate({ context, synapse, logger }: TServiceParams): >>(options: AddEntityOptions, DateEvents, PARAMS["attributes"], PARAMS["locals"], DATA>) => SynapseDate; export {};