@iobroker/js-controller-common-db
Version:
The Library contains the common utils for the ioBroker controller which can be used by db classes too, as they do not rely on the db (circular dependencies).
44 lines • 2.02 kB
TypeScript
/// <reference types="@iobroker/types-dev" />
interface ApplyAliasTransformerOptions {
/** State used for calculations */
state: ioBroker.State;
/** Properties from this StateCommon will be provided first to the conversion function */
firstCommon: Partial<ioBroker.StateCommon>;
/** Properties from this StateCommon will be provided second to the conversion function */
secondCommon: Partial<ioBroker.StateCommon>;
/** The actual transformer function as a string */
transformer: string;
/** If this is a read function, determines the naming of the passed variables */
isRead: boolean;
}
interface ApplyAliasConvenienceConversionOptions {
/** State used for calculations */
state: ioBroker.State;
/** The common attribute of the alias target */
targetCommon?: Partial<ioBroker.StateCommon>;
}
interface ApplyAliasAutoScalingOptions extends ApplyAliasConvenienceConversionOptions {
/** The common attribute of the alias source */
sourceCommon?: Partial<ioBroker.StateCommon>;
}
/**
* Applies a user-given transformer function and provides the type, min and max of the
* passed StateCommon variables as well as the state's value
*
* @param options state, common information and transformer function
*/
export declare function applyAliasTransformer(options: ApplyAliasTransformerOptions): ioBroker.StateValue;
/**
* Applies some convenience conversions of aliases, e.g. transforming string 'off' to a boolean false, if target is a boolean
*
* @param options state and target common information
*/
export declare function applyAliasConvenienceConversion(options: ApplyAliasConvenienceConversionOptions): ioBroker.StateValue;
/**
* Applies autoscaling between alias source and target if one has % unit and the other not
*
* @param options state, source and target common information
*/
export declare function applyAliasAutoScaling(options: ApplyAliasAutoScalingOptions): ioBroker.StateValue;
export {};
//# sourceMappingURL=aliasProcessing.d.ts.map