mirror of
https://github.com/meshtastic/web.git
synced 2026-06-12 15:35:19 -04:00
52 lines
919 B
TypeScript
52 lines
919 B
TypeScript
import type { Message } from "@bufbuild/protobuf";
|
|
import { Protobuf } from "@meshtastic/core";
|
|
import {
|
|
IsBoolean,
|
|
IsEnum,
|
|
IsInt,
|
|
IsNumber,
|
|
IsString,
|
|
Length,
|
|
} from "class-validator";
|
|
|
|
export class ChannelValidation
|
|
implements Omit<Protobuf.Channel.Channel, keyof Message | "settings"> {
|
|
@IsNumber()
|
|
index: number;
|
|
|
|
settings: Channel_SettingsValidation;
|
|
|
|
@IsEnum(Protobuf.Channel.Channel_Role)
|
|
role: Protobuf.Channel.Channel_Role;
|
|
}
|
|
|
|
export class Channel_SettingsValidation
|
|
implements Omit<Protobuf.Channel.ChannelSettings, keyof Message | "psk"> {
|
|
@IsNumber()
|
|
channelNum: number;
|
|
|
|
@IsString()
|
|
psk: string;
|
|
|
|
@Length(0, 11)
|
|
name: string;
|
|
|
|
@IsInt()
|
|
id: number;
|
|
|
|
@IsBoolean()
|
|
uplinkEnabled: boolean;
|
|
|
|
@IsBoolean()
|
|
downlinkEnabled: boolean;
|
|
|
|
@IsBoolean()
|
|
positionEnabled: boolean;
|
|
|
|
@IsBoolean()
|
|
preciseLocation: boolean;
|
|
|
|
@IsInt()
|
|
positionPrecision: number;
|
|
}
|