@norgate-av/react-crestron-ch5-hooks 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +914 -0
- package/dist/hooks/index.d.ts +18 -0
- package/dist/hooks/useCrestronAnalog/index.d.ts +11 -0
- package/dist/hooks/useCrestronAnalogCollection/index.d.ts +12 -0
- package/dist/hooks/useCrestronDigital/index.d.ts +11 -0
- package/dist/hooks/useCrestronDigitalCollection/index.d.ts +12 -0
- package/dist/hooks/useCrestronPublishAnalog/index.d.ts +9 -0
- package/dist/hooks/useCrestronPublishAnalogCollection/index.d.ts +10 -0
- package/dist/hooks/useCrestronPublishDigital/index.d.ts +9 -0
- package/dist/hooks/useCrestronPublishDigitalCollection/index.d.ts +10 -0
- package/dist/hooks/useCrestronPublishSerial/index.d.ts +9 -0
- package/dist/hooks/useCrestronPublishSerialCollection/index.d.ts +10 -0
- package/dist/hooks/useCrestronSerial/index.d.ts +11 -0
- package/dist/hooks/useCrestronSerialCollection/index.d.ts +12 -0
- package/dist/hooks/useCrestronSubscribeAnalog/index.d.ts +11 -0
- package/dist/hooks/useCrestronSubscribeAnalogCollection/index.d.ts +12 -0
- package/dist/hooks/useCrestronSubscribeDigital/index.d.ts +11 -0
- package/dist/hooks/useCrestronSubscribeDigitalCollection/index.d.ts +12 -0
- package/dist/hooks/useCrestronSubscribeSerial/index.d.ts +11 -0
- package/dist/hooks/useCrestronSubscribeSerialCollection/index.d.ts +12 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +8 -0
- package/dist/react-crestron-ch5-hooks.cjs.development.js +643 -0
- package/dist/react-crestron-ch5-hooks.cjs.development.js.map +1 -0
- package/dist/react-crestron-ch5-hooks.cjs.production.min.js +2 -0
- package/dist/react-crestron-ch5-hooks.cjs.production.min.js.map +1 -0
- package/dist/react-crestron-ch5-hooks.esm.js +602 -0
- package/dist/react-crestron-ch5-hooks.esm.js.map +1 -0
- package/dist/react-crestron-ch5-hooks.umd.development.js +645 -0
- package/dist/react-crestron-ch5-hooks.umd.development.js.map +1 -0
- package/dist/react-crestron-ch5-hooks.umd.production.min.js +2 -0
- package/dist/react-crestron-ch5-hooks.umd.production.min.js.map +1 -0
- package/dist/types/Analog/index.d.ts +1 -0
- package/dist/types/AnalogStateCallback/index.d.ts +3 -0
- package/dist/types/Digital/index.d.ts +1 -0
- package/dist/types/DigitalStateCallback/index.d.ts +3 -0
- package/dist/types/IAnalogEventAction/index.d.ts +4 -0
- package/dist/types/IAnalogSignal/index.d.ts +5 -0
- package/dist/types/IAnalogState/index.d.ts +4 -0
- package/dist/types/IBaseEventAction/index.d.ts +3 -0
- package/dist/types/IBaseSignal/index.d.ts +4 -0
- package/dist/types/IBaseState/index.d.ts +3 -0
- package/dist/types/IDigitalEventAction/index.d.ts +7 -0
- package/dist/types/IDigitalSignal/index.d.ts +5 -0
- package/dist/types/IDigitalState/index.d.ts +4 -0
- package/dist/types/ISerialEventAction/index.d.ts +4 -0
- package/dist/types/ISerialSignal/index.d.ts +5 -0
- package/dist/types/ISerialState/index.d.ts +4 -0
- package/dist/types/IStateSubscription/index.d.ts +4 -0
- package/dist/types/Serial/index.d.ts +1 -0
- package/dist/types/SerialStateCallback/index.d.ts +3 -0
- package/dist/types/StateCallback/index.d.ts +1 -0
- package/dist/types/index.d.ts +20 -0
- package/dist/utils/getSignalCollection.d.ts +3 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +135 -0
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from "./useCrestronAnalog";
|
|
2
|
+
export * from "./useCrestronDigital";
|
|
3
|
+
export * from "./useCrestronSerial";
|
|
4
|
+
export * from "./useCrestronAnalogCollection";
|
|
5
|
+
export * from "./useCrestronDigitalCollection";
|
|
6
|
+
export * from "./useCrestronSerialCollection";
|
|
7
|
+
export * from "./useCrestronPublishAnalog";
|
|
8
|
+
export * from "./useCrestronPublishDigital";
|
|
9
|
+
export * from "./useCrestronPublishSerial";
|
|
10
|
+
export * from "./useCrestronPublishAnalogCollection";
|
|
11
|
+
export * from "./useCrestronPublishDigitalCollection";
|
|
12
|
+
export * from "./useCrestronPublishSerialCollection";
|
|
13
|
+
export * from "./useCrestronSubscribeAnalog";
|
|
14
|
+
export * from "./useCrestronSubscribeDigital";
|
|
15
|
+
export * from "./useCrestronSubscribeSerial";
|
|
16
|
+
export * from "./useCrestronSubscribeAnalogCollection";
|
|
17
|
+
export * from "./useCrestronSubscribeDigitalCollection";
|
|
18
|
+
export * from "./useCrestronSubscribeSerialCollection";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AnalogStateCallback, IAnalogSignal } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* `useCrestronAnalog` is a hook that returns an object with a state and action property.
|
|
4
|
+
* @param {string} signalName - The name of the signal you want to use.
|
|
5
|
+
* @param {AnalogStateCallback} [callback] - An optional callback function that will be called whenever the state of the signal
|
|
6
|
+
* changes.
|
|
7
|
+
* @returns An array with a single IAnalogSignal object.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useCrestronAnalog(signalName: string, callback?: AnalogStateCallback): [IAnalogSignal];
|
|
10
|
+
export default useCrestronAnalog;
|
|
11
|
+
export declare const useCrestronNumber: typeof useCrestronAnalog;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AnalogStateCallback, IAnalogSignal } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* `useCrestronAnalogCollection` is a hook that returns an array of objects each with state and action properties.
|
|
4
|
+
* @param {string[]} signalNames - An array of strings that represent the names of the signals you want
|
|
5
|
+
* to use.
|
|
6
|
+
* @param {AnalogStateCallback} [callback] - A optional callback function that will be called whenever the state of
|
|
7
|
+
* the signal changes.
|
|
8
|
+
* @returns An array of IAnalogSignal objects.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useCrestronAnalogCollection(signalNames: string[], callback?: AnalogStateCallback): IAnalogSignal[];
|
|
11
|
+
export default useCrestronAnalogCollection;
|
|
12
|
+
export declare const useCrestronNumberCollection: typeof useCrestronAnalogCollection;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DigitalStateCallback, IDigitalSignal } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* `useCrestronDigital` is a hook that returns an object with a state and action property.
|
|
4
|
+
* @param {string} signalName - The name of the signal you want to use.
|
|
5
|
+
* @param {DigitalStateCallback} [callback] - An optional callback function that will be called whenever the state of the signal
|
|
6
|
+
* changes.
|
|
7
|
+
* @returns An array with a single IDigitalSignal object
|
|
8
|
+
*/
|
|
9
|
+
export declare function useCrestronDigital(signalName: string, callback?: DigitalStateCallback): [IDigitalSignal];
|
|
10
|
+
export default useCrestronDigital;
|
|
11
|
+
export declare const useCrestronBoolean: typeof useCrestronDigital;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DigitalStateCallback, IDigitalSignal } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* `useCrestronDigitalCollection` is a hook that returns an array of objects each with state and action properties.
|
|
4
|
+
* @param {string[]} signalNames - An array of strings that represent the names of the signals you want
|
|
5
|
+
* to use.
|
|
6
|
+
* @param {DigitalStateCallback} [callback] - A optional callback function that will be called whenever the state of
|
|
7
|
+
* the signal changes.
|
|
8
|
+
* @returns An array of IDigitalSignal objects.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useCrestronDigitalCollection(signalNames: string[], callback?: DigitalStateCallback): IDigitalSignal[];
|
|
11
|
+
export default useCrestronDigitalCollection;
|
|
12
|
+
export declare const useCrestronBooleanCollection: typeof useCrestronDigitalCollection;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IAnalogEventAction } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* `useCrestronPublishAnalog` is a hook that returns an object with a setValue function.
|
|
4
|
+
* @param {string} signalName - The name of the signal you want to publish to.
|
|
5
|
+
* @returns An array with a single IAnalogEventAction object.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useCrestronPublishAnalog(signalName: string): [IAnalogEventAction];
|
|
8
|
+
export default useCrestronPublishAnalog;
|
|
9
|
+
export declare const useCrestronPublishNumber: typeof useCrestronPublishAnalog;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IAnalogEventAction } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* `useCrestronPublishAnalogCollection` is a hook that returns an array of objects each with a setValue function.
|
|
4
|
+
* @param {string[]} signalNames - An array of strings that represent the names of the signals you want
|
|
5
|
+
* to publish to.
|
|
6
|
+
* @returns An array of IAnalogEventAction objects.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useCrestronPublishAnalogCollection(signalNames: string[]): IAnalogEventAction[];
|
|
9
|
+
export default useCrestronPublishAnalogCollection;
|
|
10
|
+
export declare const useCrestronPublishNumberCollection: typeof useCrestronPublishAnalogCollection;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IDigitalEventAction } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* `useCrestronPublishDigital` is a hook that returns an object with setValue, push, release and click functions.
|
|
4
|
+
* @param {string} signalName - The name of the signal you want to publish to.
|
|
5
|
+
* @returns An array with a single IDigitalEventAction object.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useCrestronPublishDigital(signalName: string): [IDigitalEventAction];
|
|
8
|
+
export default useCrestronPublishDigital;
|
|
9
|
+
export declare const useCrestronPublishBoolean: typeof useCrestronPublishDigital;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { IDigitalEventAction } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* `useCrestronPublishDigitalCollection` is a hook that returns an array of objects each with setValue, push, release and click functions.
|
|
4
|
+
* @param {string[]} signalNames - An array of strings that represent the names of the signals you want
|
|
5
|
+
* to publish to.
|
|
6
|
+
* @returns An array of IDigitalEventAction objects.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useCrestronPublishDigitalCollection(signalNames: string[]): IDigitalEventAction[];
|
|
9
|
+
export default useCrestronPublishDigitalCollection;
|
|
10
|
+
export declare const useCrestronPublishBooleanCollection: typeof useCrestronPublishDigitalCollection;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ISerialEventAction } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* `useCrestronPublishSerial` is a hook that returns an object with a setValue function.
|
|
4
|
+
* @param {string} signalName - The name of the signal you want to publish to.
|
|
5
|
+
* @returns An array with a single ISerialEventAction object.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useCrestronPublishSerial(signalName: string): [ISerialEventAction];
|
|
8
|
+
export default useCrestronPublishSerial;
|
|
9
|
+
export declare const useCrestronPublishString: typeof useCrestronPublishSerial;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ISerialEventAction } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* `useCrestronPublishSerialCollection` is a hook that returns an array of objects each with a setValue function.
|
|
4
|
+
* @param {string[]} signalNames - An array of strings that represent the names of the signals you want
|
|
5
|
+
* to publish to.
|
|
6
|
+
* @returns An array of ISerialEventAction objects.
|
|
7
|
+
*/
|
|
8
|
+
export declare function useCrestronPublishSerialCollection(signalNames: string[]): ISerialEventAction[];
|
|
9
|
+
export default useCrestronPublishSerialCollection;
|
|
10
|
+
export declare const useCrestronPublishStringCollection: typeof useCrestronPublishSerialCollection;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ISerialSignal, SerialStateCallback } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* `useCrestronSerial` is a hook that returns an object with a state and action property.
|
|
4
|
+
* @param {string} signalName - The name of the signal you want to use.
|
|
5
|
+
* @param {SerialStateCallback} [callback] - An optional callback function that will be called whenever the state of the signal
|
|
6
|
+
* changes.
|
|
7
|
+
* @returns An array with a single ISerialSignal object.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useCrestronSerial(signalName: string, callback?: SerialStateCallback): [ISerialSignal];
|
|
10
|
+
export default useCrestronSerial;
|
|
11
|
+
export declare const useCrestronString: typeof useCrestronSerial;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ISerialSignal, SerialStateCallback } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* `useCrestronSerialCollection` is a hook that returns an array of objects each with state and action properties.
|
|
4
|
+
* @param {string[]} signalNames - An array of strings that represent the names of the signals you want
|
|
5
|
+
* to use.
|
|
6
|
+
* @param {SerialStateCallback} [callback] - A optional callback function that will be called whenever the state of
|
|
7
|
+
* the signal changes.
|
|
8
|
+
* @returns An array of ISerialSignal objects.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useCrestronSerialCollection(signalNames: string[], callback?: SerialStateCallback): ISerialSignal[];
|
|
11
|
+
export default useCrestronSerialCollection;
|
|
12
|
+
export declare const useCrestronStringCollection: typeof useCrestronSerialCollection;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AnalogStateCallback, IAnalogState } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* `useCrestronSubscribeAnalog` is a hook that returns an object with a value property.
|
|
4
|
+
* @param {string} signalName - The name of the signal you want to subscribe to.
|
|
5
|
+
* @param {AnalogStateCallback} [callback] - An optional callback function that will be called whenever the state
|
|
6
|
+
* changes.
|
|
7
|
+
* @returns An array with a single IAnalogState object.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useCrestronSubscribeAnalog(signalName: string, callback?: AnalogStateCallback): [IAnalogState];
|
|
10
|
+
export default useCrestronSubscribeAnalog;
|
|
11
|
+
export declare const useCrestronSubscribeNumber: typeof useCrestronSubscribeAnalog;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { AnalogStateCallback, IAnalogState } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* `useCrestronSubscribeAnalogCollection` is a hook that returns an array of objects each with a value property.
|
|
4
|
+
* @param {string[]} signalNames - An array of strings that represent the names of the signals you want
|
|
5
|
+
* to subscribe to.
|
|
6
|
+
* @param {AnalogStateCallback} [callback] - An optional callback function that will be called whenever the
|
|
7
|
+
* state changes.
|
|
8
|
+
* @returns An array of IAnalogState objects.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useCrestronSubscribeAnalogCollection(signalNames: string[], callback?: AnalogStateCallback): IAnalogState[];
|
|
11
|
+
export default useCrestronSubscribeAnalogCollection;
|
|
12
|
+
export declare const useCrestronSubscribeNumberCollection: typeof useCrestronSubscribeAnalogCollection;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { DigitalStateCallback, IDigitalState } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* `useCrestronSubscribeDigital` is a hook that returns an object with a value property.
|
|
4
|
+
* @param {string} signalName - The name of the signal you want to subscribe to.
|
|
5
|
+
* @param {DigitalStateCallback} [callback] - An optional callback function that will be called whenever the state
|
|
6
|
+
* changes.
|
|
7
|
+
* @returns An array with a single IDigitalState object.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useCrestronSubscribeDigital(signalName: string, callback?: DigitalStateCallback): [IDigitalState];
|
|
10
|
+
export default useCrestronSubscribeDigital;
|
|
11
|
+
export declare const useCrestronSubscribeBoolean: typeof useCrestronSubscribeDigital;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DigitalStateCallback, IDigitalState } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* `useCrestronSubscribeDigitalCollection` is a hook that returns an array of objects each with a value property.
|
|
4
|
+
* @param {string[]} signalNames - An array of strings that represent the names of the signals you want
|
|
5
|
+
* to subscribe to.
|
|
6
|
+
* @param {DigitalStateCallback} [callback] - An optional callback function that will be called whenever the
|
|
7
|
+
* state changes.
|
|
8
|
+
* @returns An array of IDigitalState objects.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useCrestronSubscribeDigitalCollection(signalNames: string[], callback?: DigitalStateCallback): IDigitalState[];
|
|
11
|
+
export default useCrestronSubscribeDigitalCollection;
|
|
12
|
+
export declare const useCrestronSubscribeBooleanCollection: typeof useCrestronSubscribeDigitalCollection;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ISerialState, SerialStateCallback } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* `useCrestronSubscribeSerial` is a hook that returns an object with a value property.
|
|
4
|
+
* @param {string} signalName - The name of the signal you want to subscribe to.
|
|
5
|
+
* @param {SerialStateCallback} [callback] - An optional callback function that will be called whenever the state
|
|
6
|
+
* changes.
|
|
7
|
+
* @returns An array with a single ISerialState object.
|
|
8
|
+
*/
|
|
9
|
+
export declare function useCrestronSubscribeSerial(signalName: string, callback?: SerialStateCallback): [ISerialState];
|
|
10
|
+
export default useCrestronSubscribeSerial;
|
|
11
|
+
export declare const useCrestronSubscribeString: typeof useCrestronSubscribeSerial;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SerialStateCallback, ISerialState } from "../../types";
|
|
2
|
+
/**
|
|
3
|
+
* `useCrestronSubscribeSerialCollection` is a hook that returns an array of objects each with a value property.
|
|
4
|
+
* @param {string[]} signalNames - An array of strings that represent the names of the signals you want
|
|
5
|
+
* to subscribe to.
|
|
6
|
+
* @param {SerialStateCallback} [callback] - An optional callback function that will be called whenever the
|
|
7
|
+
* state changes.
|
|
8
|
+
* @returns An array of ISerialState objects.
|
|
9
|
+
*/
|
|
10
|
+
export declare function useCrestronSubscribeSerialCollection(signalNames: string[], callback?: SerialStateCallback): ISerialState[];
|
|
11
|
+
export default useCrestronSubscribeSerialCollection;
|
|
12
|
+
export declare const useCrestronSubscribeStringCollection: typeof useCrestronSubscribeSerialCollection;
|
package/dist/index.d.ts
ADDED