@imperosoft/ch5-typescript
v1.0.0
Published
TypeScript declarations for Crestron CH5 Web Components with React JSX support
Maintainers
Readme
ch5-typescript
TypeScript declarations for Crestron CH5 Web Components with React JSX support.
Installation
npm install @imperosoft/ch5-typescriptUsage
After installation, CH5 elements are automatically available in JSX:
import React from 'react';
function App() {
return (
<div>
{/* Simple click button */}
<ch5-button sendeventonclick="101" label="Power" />
{/* Toggle button with feedback */}
<ch5-button
sendeventonclick="101"
receivestateselected="101"
mode="toggle"
label="Mute"
/>
{/* Slider with analog join */}
<ch5-slider
sendeventonchange="1"
receivestatevalue="1"
orientation="vertical"
/>
{/* Text display from serial join */}
<ch5-text receivestatelabel="5" label="Default" />
</div>
);
}Join Communication
Send Events (UI → Processor)
| Attribute | Description |
|-----------|-------------|
| sendeventonclick | Sends a pulse (true→false) on click/tap |
| sendeventontouch | Sends true every 200ms while touched, false on release |
| sendeventonchange | Sends value changes (analog/serial joins) |
Receive States (Processor → UI)
| Attribute | Description |
|-----------|-------------|
| receivestateselected | Digital join: true = selected/pressed state |
| receivestatevalue | Analog join: numeric value (0-65535) |
| receivestatelabel | Serial join: text content |
| receivestateshow | Digital join: true = visible, false = hidden |
| receivestateenable | Digital join: true = enabled, false = disabled |
Event Behavior
sendeventonclick (Press Mode)
Sends a momentary pulse when clicked:
- User presses → sends
true - Immediately sends
false(pulse)
sendeventontouch (Touch Mode)
For hold-to-repeat functionality:
- User presses → sends
true - While held → sends
trueevery 200ms - User releases → sends
false
Included Components
ch5-animation- Animation objectch5-background- Background with video supportch5-button- Interactive buttonch5-button-list- Button collectionch5-color-chip- RGB color displaych5-color-picker- Color selectionch5-datetime- Date/time displaych5-dpad- Directional padch5-form- Form containerch5-image- Image displaych5-import-htmlsnippet- HTML snippet loaderch5-jointotext-boolean- Digital to textch5-jointotext-numeric- Analog to textch5-jointotext-string- Serial to textch5-keypad- Numeric keypadch5-list- Dynamic listch5-media-player- Audio player (Beta)ch5-modal-dialog- Modal dialogch5-overlay-panel- Overlay containerch5-qrcode- QR code generatorch5-segmented-gauge- LED gaugech5-select- Selection listch5-select-option- Select optionch5-signal-level-gauge- Signal level displaych5-slider- Analog sliderch5-spinner- Loading spinnerch5-subpage-reference-list- Subpage listch5-tab-button- Tabbed buttonsch5-template- Template instantiationch5-text- Text displaych5-textinput- Text inputch5-toggle- Toggle switchch5-triggerview- View switcherch5-video- Video playerch5-video-switcher- Video switchingch5-wifi-signal-level-gauge- WiFi signal display
Exported Types
import type {
JoinType,
CrComLibInterface,
WebXPanelInterface,
Ch5Size,
Ch5Stretch,
Ch5Type,
Ch5Orientation,
Ch5ButtonShape,
Ch5ButtonMode,
Ch5IconPosition,
Ch5HandleShape,
Ch5CommonAttributes,
// ... and more
} from '@imperosoft/ch5-typescript';Documentation
License
MIT
