Files

154 lines
6.6 KiB
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DEVICE_MODELS = exports.DEVICE_MODELS2 = exports.DeviceModelType = exports.CORSAIR_VENDOR_ID = exports.VENDOR_ID = exports.parseAllFirmwareVersionsHelper = exports.uint8ArrayToDataView = exports.StreamDeckProxy = void 0;
exports.getStreamDeckModelName = getStreamDeckModelName;
const tslib_1 = require("tslib");
const id_js_1 = require("./id.js");
const original_js_1 = require("./models/original.js");
const _6_key_js_1 = require("./models/6-key.js");
const _32_key_js_1 = require("./models/32-key.js");
const _15_key_js_1 = require("./models/15-key.js");
const plus_js_1 = require("./models/plus.js");
const pedal_js_1 = require("./models/pedal.js");
const neo_js_1 = require("./models/neo.js");
const studio_js_1 = require("./models/studio.js");
const network_dock_js_1 = require("./models/network-dock.js");
const galleon_k100_js_1 = require("./models/galleon-k100.js");
tslib_1.__exportStar(require("./types.js"), exports);
tslib_1.__exportStar(require("./id.js"), exports);
tslib_1.__exportStar(require("./controlDefinition.js"), exports);
var proxy_js_1 = require("./proxy.js");
Object.defineProperty(exports, "StreamDeckProxy", { enumerable: true, get: function () { return proxy_js_1.StreamDeckProxy; } });
var util_js_1 = require("./util.js");
Object.defineProperty(exports, "uint8ArrayToDataView", { enumerable: true, get: function () { return util_js_1.uint8ArrayToDataView; } });
var all_firmware_js_1 = require("./services/properties/all-firmware.js");
Object.defineProperty(exports, "parseAllFirmwareVersionsHelper", { enumerable: true, get: function () { return all_firmware_js_1.parseAllFirmwareVersionsHelper; } });
/** Elgato vendor id */
exports.VENDOR_ID = 0x0fd9;
/** Corsair vendor id */
exports.CORSAIR_VENDOR_ID = 0x1b1c;
var DeviceModelType;
(function (DeviceModelType) {
DeviceModelType["STREAMDECK"] = "streamdeck";
DeviceModelType["PEDAL"] = "pedal";
DeviceModelType["NETWORK_DOCK"] = "network-dock";
})(DeviceModelType || (exports.DeviceModelType = DeviceModelType = {}));
/** List of all the known models, and the classes to use them */
exports.DEVICE_MODELS2 = {
[id_js_1.DeviceModelId.ORIGINAL]: {
type: DeviceModelType.STREAMDECK,
productIds: [0x0060],
vendorId: exports.VENDOR_ID,
factory: original_js_1.StreamDeckOriginalFactory,
hasNativeTcp: false,
},
[id_js_1.DeviceModelId.MINI]: {
type: DeviceModelType.STREAMDECK,
productIds: [0x0063, 0x0090, 0x00b3],
vendorId: exports.VENDOR_ID,
factory: (...args) => (0, _6_key_js_1.StreamDeck6KeyFactory)(id_js_1.DeviceModelId.MINI, ...args),
hasNativeTcp: false,
},
[id_js_1.DeviceModelId.XL]: {
type: DeviceModelType.STREAMDECK,
productIds: [0x006c, 0x008f],
vendorId: exports.VENDOR_ID,
factory: (...args) => (0, _32_key_js_1.StreamDeck32KeyFactory)(id_js_1.DeviceModelId.XL, ...args),
hasNativeTcp: false,
},
[id_js_1.DeviceModelId.ORIGINALV2]: {
type: DeviceModelType.STREAMDECK,
productIds: [0x006d],
vendorId: exports.VENDOR_ID,
factory: (...args) => (0, _15_key_js_1.StreamDeck15KeyFactory)(id_js_1.DeviceModelId.ORIGINALV2, ...args),
hasNativeTcp: false,
},
[id_js_1.DeviceModelId.ORIGINALMK2]: {
type: DeviceModelType.STREAMDECK,
productIds: [0x0080],
vendorId: exports.VENDOR_ID,
factory: (...args) => (0, _15_key_js_1.StreamDeck15KeyFactory)(id_js_1.DeviceModelId.ORIGINALMK2, ...args),
hasNativeTcp: false,
},
[id_js_1.DeviceModelId.ORIGINALMK2SCISSOR]: {
type: DeviceModelType.STREAMDECK,
productIds: [0x00a5],
vendorId: exports.VENDOR_ID,
factory: (...args) => (0, _15_key_js_1.StreamDeck15KeyFactory)(id_js_1.DeviceModelId.ORIGINALMK2SCISSOR, ...args),
hasNativeTcp: false,
},
[id_js_1.DeviceModelId.PLUS]: {
type: DeviceModelType.STREAMDECK,
productIds: [0x0084],
vendorId: exports.VENDOR_ID,
factory: plus_js_1.StreamDeckPlusFactory,
hasNativeTcp: false,
},
[id_js_1.DeviceModelId.PEDAL]: {
type: DeviceModelType.PEDAL,
productIds: [0x0086],
vendorId: exports.VENDOR_ID,
factory: pedal_js_1.StreamDeckPedalFactory,
hasNativeTcp: false,
},
[id_js_1.DeviceModelId.NEO]: {
type: DeviceModelType.STREAMDECK,
productIds: [0x009a],
vendorId: exports.VENDOR_ID,
factory: neo_js_1.StreamDeckNeoFactory,
hasNativeTcp: false,
},
[id_js_1.DeviceModelId.STUDIO]: {
type: DeviceModelType.STREAMDECK,
productIds: [0x00aa],
vendorId: exports.VENDOR_ID,
factory: studio_js_1.StreamDeckStudioFactory,
hasNativeTcp: true,
},
[id_js_1.DeviceModelId.MODULE6]: {
type: DeviceModelType.STREAMDECK,
productIds: [0x00b8],
vendorId: exports.VENDOR_ID,
factory: (...args) => (0, _6_key_js_1.StreamDeck6KeyFactory)(id_js_1.DeviceModelId.MODULE6, ...args),
hasNativeTcp: false,
},
[id_js_1.DeviceModelId.MODULE15]: {
type: DeviceModelType.STREAMDECK,
productIds: [0x00b9],
vendorId: exports.VENDOR_ID,
factory: (...args) => (0, _15_key_js_1.StreamDeck15KeyFactory)(id_js_1.DeviceModelId.MODULE15, ...args),
hasNativeTcp: false,
},
[id_js_1.DeviceModelId.MODULE32]: {
type: DeviceModelType.STREAMDECK,
productIds: [0x00ba],
vendorId: exports.VENDOR_ID,
factory: (...args) => (0, _32_key_js_1.StreamDeck32KeyFactory)(id_js_1.DeviceModelId.MODULE32, ...args),
hasNativeTcp: false,
},
[id_js_1.DeviceModelId.NETWORK_DOCK]: {
type: DeviceModelType.NETWORK_DOCK,
productIds: [0xffff], // Note: This isn't a real product id, but matches what is reported when querying the device
vendorId: exports.VENDOR_ID,
factory: network_dock_js_1.NetworkDockFactory,
hasNativeTcp: true,
},
[id_js_1.DeviceModelId.GALLEON_K100]: {
type: DeviceModelType.STREAMDECK,
productIds: [0x2b18],
vendorId: exports.CORSAIR_VENDOR_ID,
factory: galleon_k100_js_1.GalleonK100Factory,
hidUsage: 0x01,
hidInterface: 0,
hasNativeTcp: false,
},
};
/** @deprecated maybe? */
exports.DEVICE_MODELS = Object.entries(exports.DEVICE_MODELS2).map(([id, spec]) => {
const modelId = id;
return { id: modelId, productName: id_js_1.MODEL_NAMES[modelId], ...spec };
});
function getStreamDeckModelName(modelId) {
return id_js_1.MODEL_NAMES[modelId] || 'Unknown Stream Deck';
}
//# sourceMappingURL=index.js.map