Compat with latest JS lib
This commit is contained in:
@@ -2,7 +2,10 @@ import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class BluetoothValidation implements Protobuf.Config_BluetoothConfig {
|
||||
export class BluetoothValidation
|
||||
implements
|
||||
Omit<Protobuf.Config_BluetoothConfig, keyof Protobuf.native.Message>
|
||||
{
|
||||
@IsBoolean()
|
||||
enabled: boolean;
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@ import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class DeviceValidation implements Protobuf.Config_DeviceConfig {
|
||||
export class DeviceValidation
|
||||
implements Omit<Protobuf.Config_DeviceConfig, keyof Protobuf.native.Message>
|
||||
{
|
||||
@IsEnum(Protobuf.Config_DeviceConfig_Role)
|
||||
role: Protobuf.Config_DeviceConfig_Role;
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@ import { IsBoolean, IsEnum, IsInt } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class DisplayValidation implements Protobuf.Config_DisplayConfig {
|
||||
export class DisplayValidation
|
||||
implements Omit<Protobuf.Config_DisplayConfig, keyof Protobuf.native.Message>
|
||||
{
|
||||
@IsInt()
|
||||
screenOnSecs: number;
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@ import { IsArray, IsBoolean, IsEnum, IsInt, Max, Min } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class LoRaValidation implements Protobuf.Config_LoRaConfig {
|
||||
export class LoRaValidation
|
||||
implements Omit<Protobuf.Config_LoRaConfig, keyof Protobuf.native.Message>
|
||||
{
|
||||
@IsBoolean()
|
||||
usePreset: boolean;
|
||||
|
||||
|
||||
@@ -2,7 +2,13 @@ import { IsBoolean, IsEnum, IsIP, IsOptional, Length } from "class-validator";
|
||||
|
||||
import { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class NetworkValidation implements Protobuf.Config_NetworkConfig {
|
||||
export class NetworkValidation
|
||||
implements
|
||||
Omit<
|
||||
Protobuf.Config_NetworkConfig,
|
||||
keyof Protobuf.native.Message | "ipv4Config"
|
||||
>
|
||||
{
|
||||
@IsBoolean()
|
||||
wifiEnabled: boolean;
|
||||
|
||||
@@ -21,14 +27,17 @@ export class NetworkValidation implements Protobuf.Config_NetworkConfig {
|
||||
ethEnabled: boolean;
|
||||
|
||||
@IsEnum(Protobuf.Config_NetworkConfig_AddressMode)
|
||||
// @IsOptional()
|
||||
addressMode: Protobuf.Config_NetworkConfig_AddressMode;
|
||||
|
||||
ipv4Config: NetworkValidation_IpV4Config;
|
||||
}
|
||||
|
||||
export class NetworkValidation_IpV4Config
|
||||
implements Protobuf.Config_NetworkConfig_IpV4Config
|
||||
implements
|
||||
Omit<
|
||||
Protobuf.Config_NetworkConfig_IpV4Config,
|
||||
keyof Protobuf.native.Message
|
||||
>
|
||||
{
|
||||
@IsIP()
|
||||
@IsOptional()
|
||||
|
||||
@@ -2,7 +2,10 @@ import { IsBoolean, IsInt, IsNumber } from "class-validator";
|
||||
|
||||
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class PositionValidation implements Protobuf.Config_PositionConfig {
|
||||
export class PositionValidation
|
||||
implements
|
||||
Omit<Protobuf.Config_PositionConfig, keyof Protobuf.native.Message>
|
||||
{
|
||||
@IsInt()
|
||||
positionBroadcastSecs: number;
|
||||
|
||||
|
||||
@@ -2,7 +2,9 @@ import { IsBoolean, IsInt, Max, Min } from "class-validator";
|
||||
|
||||
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class PowerValidation implements Protobuf.Config_PowerConfig {
|
||||
export class PowerValidation
|
||||
implements Omit<Protobuf.Config_PowerConfig, keyof Protobuf.native.Message>
|
||||
{
|
||||
@IsBoolean()
|
||||
isPowerSaving: boolean;
|
||||
|
||||
|
||||
@@ -3,7 +3,11 @@ import { IsBoolean, IsOptional, IsString, Length } from "class-validator";
|
||||
import type { Protobuf } from "@meshtastic/meshtasticjs";
|
||||
|
||||
export class UserValidation
|
||||
implements Omit<Protobuf.User, "ID" | "macaddr" | "hwModel">
|
||||
implements
|
||||
Omit<
|
||||
Protobuf.User,
|
||||
keyof Protobuf.native.Message | "ID" | "macaddr" | "hwModel"
|
||||
>
|
||||
{
|
||||
@IsString()
|
||||
@IsOptional()
|
||||
|
||||
Reference in New Issue
Block a user