node-insim
Version:
An InSim library for NodeJS with TypeScript support
40 lines (39 loc) • 1.55 kB
TypeScript
import { SendablePacket } from './base';
import { PacketType } from './enums';
import type { PacketData } from './types';
/**
* Button FunctioN - delete buttons / receive button requests
*
* NOTE: {@link BFN_REQUEST} allows the user to bring up buttons with SHIFT+B or SHIFT+I
*
* - SHIFT+I clears all host buttons if any - or sends a {@link BFN_REQUEST} to host instances
* - SHIFT+B is the same but for local buttons and local instances
*/
export declare class IS_BFN extends SendablePacket {
readonly Size = 8;
readonly Type = PacketType.ISP_BFN;
readonly ReqI = 0;
/** Subtype */
readonly SubT: ButtonFunction;
/** Connection to send to or received from (0 = local / 255 = all) */
UCID: number;
/** If SubT is {@link BFN_DEL_BTN}: ID of single button to delete or first button in range */
ClickID: number;
/** If SubT is {@link BFN_DEL_BTN}: ID of last button in range (if greater than ClickID) */
ClickMax: number;
/** Used internally by InSim */
Inst: number;
constructor(data?: IS_BFN_Data);
pack(): Uint8Array<ArrayBuffer>;
}
export declare enum ButtonFunction {
/** Instruction: delete one button or range of buttons (must set ClickID) */
BFN_DEL_BTN = 0,
/** Instruction: clear all buttons made by this insim instance */
BFN_CLEAR = 1,
/** Info: user cleared this insim instance's buttons */
BFN_USER_CLEAR = 2,
/** User request: SHIFT+B or SHIFT+I - request for buttons */
BFN_REQUEST = 3
}
export type IS_BFN_Data = PacketData<IS_BFN>;