Files
meshtastic-web/src/validation/config/device.ts
T
2024-06-28 12:36:32 -04:00

44 lines
923 B
TypeScript

import type { Message } from "@bufbuild/protobuf";
import { Protobuf } from "@meshtastic/js";
import { IsBoolean, IsEnum, IsInt, IsString } from "class-validator";
export class DeviceValidation
implements Omit<Protobuf.Config.Config_DeviceConfig, keyof Message>
{
@IsEnum(Protobuf.Config.Config_DeviceConfig_Role)
role: Protobuf.Config.Config_DeviceConfig_Role;
@IsBoolean()
serialEnabled: boolean;
@IsBoolean()
debugLogEnabled: boolean;
@IsInt()
buttonGpio: number;
@IsInt()
buzzerGpio: number;
@IsEnum(Protobuf.Config.Config_DeviceConfig_RebroadcastMode)
rebroadcastMode: Protobuf.Config.Config_DeviceConfig_RebroadcastMode;
@IsInt()
nodeInfoBroadcastSecs: number;
@IsBoolean()
doubleTapAsButtonPress: boolean;
@IsBoolean()
isManaged: boolean;
@IsBoolean()
disableTripleClick: boolean;
@IsBoolean()
ledHeartbeatDisabled: boolean;
@IsString()
tzdef: string;
}