From ec0ba70c21046a3e99c7452c06d5e7ca8a10c585 Mon Sep 17 00:00:00 2001 From: Vladimir Sumarov Date: Tue, 5 May 2026 18:04:20 -0700 Subject: [PATCH 1/8] update d.ts and .js files --- .github/workflows/check-js-generated.yml | 33 ++++++++++++++++++++++ README.md | 4 +++ ci/check-js-generated.sh | 18 ++++++++++++ js/module.d.ts | 11 ++------ js/module.js | 35 ++++++++++++------------ js/tsconfig.json | 3 +- js/type_check.js | 23 ++++++++-------- package.json | 2 +- 8 files changed, 89 insertions(+), 40 deletions(-) create mode 100644 .github/workflows/check-js-generated.yml create mode 100644 ci/check-js-generated.sh diff --git a/.github/workflows/check-js-generated.yml b/.github/workflows/check-js-generated.yml new file mode 100644 index 000000000..96cdf1839 --- /dev/null +++ b/.github/workflows/check-js-generated.yml @@ -0,0 +1,33 @@ +name: Check Generated JS + +on: + push: + paths-ignore: ['**.md'] + branches-ignore: [staging] + pull_request: + paths-ignore: ['**.md'] + branches-ignore: [staging] + +jobs: + check-js-generated: + runs-on: ubuntu-22.04 + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: '20.x' + + - name: Install dependencies + run: | + corepack enable + corepack prepare yarn@4.14.1 --activate + yarn install --immutable + + - name: Regenerate js/ outputs + run: yarn run build:javascript + + - name: Fail if generated files are stale + run: ./ci/check-js-generated.sh diff --git a/README.md b/README.md index 7569ae22a..13b08dd9b 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,10 @@ scan-build --keep-empty -internal-stats -stats -v -v -v -o check ninja.exe ``` Step with `"fixing"` errors is important as code base and especially third-party code are not ready to be build with clang. And files which failed to compile will not be scanned for errors. +#### Generated JS surface (`js/module.{js,d.ts}`) + +`js/module.ts` is the source of truth. `js/module.js` and `js/module.d.ts` (and the `index.*` / `type_check.*` siblings) are tsc outputs of `js/tsconfig.json` — the npm package ships them as-is, so they're committed. Regenerate with `yarn build:javascript`. `yarn local:build` already chains it. CI rejects stale outputs via `.github/workflows/check-js-generated.yml` (`ci/check-js-generated.sh`). + ### Tests The tests for obs studio node are written in Typescript and use Mocha as test framework, with electron-mocha pacakage to make Mocha run in Electron, and Chai as assertion framework. diff --git a/ci/check-js-generated.sh b/ci/check-js-generated.sh new file mode 100644 index 000000000..a3361d55e --- /dev/null +++ b/ci/check-js-generated.sh @@ -0,0 +1,18 @@ +#!/bin/bash +# Verify that the committed tsc outputs under js/ match what regenerating +# from js/module.ts would produce. CI runs `yarn build:javascript` first, +# so any modified file at this point is a stale generated file. +dirty=$(git ls-files --modified js/) + +set +x +if [[ $dirty ]]; then + echo "=================================================" + echo "Generated JS files are stale. Run locally:" + echo " yarn build:javascript" + echo "and commit the regenerated files." + echo "" + echo "Stale files:" + echo "$dirty" + echo "=================================================" + exit 1 +fi diff --git a/js/module.d.ts b/js/module.d.ts index 0c6db4fb4..e1415dd75 100644 --- a/js/module.d.ts +++ b/js/module.d.ts @@ -795,7 +795,6 @@ export interface IVideoEncoderFactory { create(id: string, name: string, settings?: ISettings): IVideoEncoder; } export interface IStreaming { - // Video encoder value is only ignored in the Enhanced Broadcasting mode, otherwise it should be set videoEncoder?: IVideoEncoder; service: IService; enforceServiceBitrate: boolean; @@ -806,7 +805,7 @@ export interface IStreaming { video: IVideo; signalHandler: (signal: EOutputSignal) => void; getAvailableEncoders(): IEncoderOption[]; - start(): void; // throws + start(): void; stop(force?: boolean): void; droppedFrames: number; totalFrames: number; @@ -847,9 +846,7 @@ export interface IAdvancedStreamingFactory { legacySettings: IAdvancedStreaming; } export interface IEnhancedBroadcastingAdvancedStreaming extends IAdvancedStreaming { - // If set, the Enhanced Broadcasting stream will be in the Dual Output mode. - // This value should be initialized before the stream start. - additionalVideo?: IVideo, + additionalVideo?: IVideo; } export interface IEnhancedBroadcastingAdvancedStreamingFactory { create(): IEnhancedBroadcastingAdvancedStreaming; @@ -857,9 +854,7 @@ export interface IEnhancedBroadcastingAdvancedStreamingFactory { legacySettings: IEnhancedBroadcastingAdvancedStreaming; } export interface IEnhancedBroadcastingSimpleStreaming extends ISimpleStreaming { - // If set, the Enhanced Broadcasting stream will be in the Dual Output mode. - // This value should be initialized before the stream start. - additionalVideo?: IVideo, + additionalVideo?: IVideo; } export interface IEnhancedBroadcastingSimpleStreamingFactory { create(): IEnhancedBroadcastingSimpleStreaming; diff --git a/js/module.js b/js/module.js index 61471a348..b67bdadc6 100644 --- a/js/module.js +++ b/js/module.js @@ -1,13 +1,15 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.NodeObs = exports.getSourcesSize = exports.createSources = exports.addItems = exports.AdvancedReplayBufferFactory = exports.SimpleReplayBufferFactory = exports.AudioEncoderFactory = exports.AdvancedRecordingFactory = exports.SimpleRecordingFactory = exports.AudioTrackFactory = exports.NetworkFactory = exports.ReconnectFactory = exports.DelayFactory = exports.AdvancedStreamingFactory = exports.EnhancedBroadcastingSimpleStreamingFactory = exports.EnhancedBroadcastingAdvancedStreamingFactory = exports.SimpleStreamingFactory = exports.ServiceFactory = exports.VideoEncoderFactory = exports.IPC = exports.ModuleFactory = exports.AudioFactory = exports.Audio = exports.FaderFactory = exports.VolmeterFactory = exports.DisplayFactory = exports.TransitionFactory = exports.FilterFactory = exports.SceneFactory = exports.InputFactory = exports.VideoFactory = exports.Video = exports.Global = exports.DefaultPluginPathMac = exports.DefaultPluginDataPath = exports.DefaultPluginPath = exports.DefaultDataPath = exports.DefaultBinPath = exports.DefaultDrawPluginPath = exports.DefaultOpenGLPath = exports.DefaultD3D11Path = void 0; +exports.NodeObs = exports.AdvancedReplayBufferFactory = exports.SimpleReplayBufferFactory = exports.AudioEncoderFactory = exports.AdvancedRecordingFactory = exports.SimpleRecordingFactory = exports.AudioTrackFactory = exports.NetworkFactory = exports.ReconnectFactory = exports.DelayFactory = exports.EnhancedBroadcastingSimpleStreamingFactory = exports.EnhancedBroadcastingAdvancedStreamingFactory = exports.AdvancedStreamingFactory = exports.SimpleStreamingFactory = exports.ServiceFactory = exports.VideoEncoderFactory = exports.IPC = exports.ModuleFactory = exports.AudioFactory = exports.Audio = exports.FaderFactory = exports.VolmeterFactory = exports.DisplayFactory = exports.TransitionFactory = exports.FilterFactory = exports.SceneFactory = exports.InputFactory = exports.VideoFactory = exports.Video = exports.Global = exports.DefaultPluginPathMac = exports.DefaultPluginDataPath = exports.DefaultPluginPath = exports.DefaultDataPath = exports.DefaultBinPath = exports.DefaultDrawPluginPath = exports.DefaultOpenGLPath = exports.DefaultD3D11Path = void 0; +exports.addItems = addItems; +exports.createSources = createSources; +exports.getSourcesSize = getSourcesSize; const path = require("path"); const fs = require("fs"); -// Mac- search for optional OSN.app bundle (Chromium requires an app bundle to find obs64 helper apps) const hasDeveloperApp = process.platform === 'darwin' && fs.existsSync(path.join(__dirname, 'OSN.app')); const obs = hasDeveloperApp - ? require('./OSN.app/distribute/obs-studio-node/obs_studio_client.node') - : require('./obs_studio_client.node'); + ? require('./OSN.app/distribute/obs-studio-node/obs_studio_client.node') + : require('./obs_studio_client.node'); exports.DefaultD3D11Path = path.resolve(__dirname, `libobs-d3d11.dll`); exports.DefaultOpenGLPath = path.resolve(__dirname, `libobs-opengl.dll`); exports.DefaultDrawPluginPath = path.resolve(__dirname, `simple_draw.dll`); @@ -60,7 +62,6 @@ function addItems(scene, sceneItems) { } return items; } -exports.addItems = addItems; function createSources(sources) { const items = []; if (Array.isArray(sources)) { @@ -68,11 +69,11 @@ function createSources(sources) { let newSource = null; try { newSource = obs.Input.create(source.type, source.name, source.settings); - } catch (error) { + } + catch (error) { console.error(`[OSN] Failed to create input for source "${source.name}":`, error instanceof Error ? error.message : error); - return; // Skip the rest of this iteration if input creation fails + return; } - if (newSource) { if (newSource.audioMixers) { newSource.muted = source.muted ?? false; @@ -82,17 +83,16 @@ function createSources(sources) { newSource.deinterlaceMode = source.deinterlaceMode; newSource.deinterlaceFieldOrder = source.deinterlaceFieldOrder; items.push(newSource); - const filters = source.filters; if (Array.isArray(filters)) { filters.forEach(function (filter) { let ObsFilter = null; try { ObsFilter = obs.Filter.create(filter.type, filter.name, filter.settings); - } catch (filterError) { + } + catch (filterError) { console.error(`[OSN] Failed to create filter "${filter.name}" for source "${source.name}":`, filterError instanceof Error ? filterError.message : filterError); } - if (ObsFilter) { ObsFilter.enabled = filter.enabled ?? true; newSource.addFilter(ObsFilter); @@ -100,16 +100,17 @@ function createSources(sources) { } }); } - } else { + } + else { console.warn(`[OSN] Input creation failed for source: ${source.name}`); } }); - } else { + } + else { console.error(`[OSN] Invalid sources array provided:`, sources); } return items; } -exports.createSources = createSources; function getSourcesSize(sourcesNames) { const sourcesSize = []; if (Array.isArray(sourcesNames)) { @@ -122,10 +123,10 @@ function getSourcesSize(sourcesNames) { } return sourcesSize; } -exports.getSourcesSize = getSourcesSize; +; const appleBinaryFolder = hasDeveloperApp - ? path.join(__dirname, 'OSN.app', 'distribute', 'obs-studio-node', 'bin') - : path.join(__dirname, 'bin'); + ? path.join(__dirname, 'OSN.app', 'distribute', 'obs-studio-node', 'bin') + : path.join(__dirname, 'bin'); if (fs.existsSync(path.resolve(appleBinaryFolder, 'obs64').replace('app.asar', 'app.asar.unpacked'))) { obs.IPC.setServerPath(path.resolve(appleBinaryFolder, `obs64`).replace('app.asar', 'app.asar.unpacked'), path.resolve(appleBinaryFolder).replace('app.asar', 'app.asar.unpacked')); } diff --git a/js/tsconfig.json b/js/tsconfig.json index 1d879be1e..508dcbadb 100644 --- a/js/tsconfig.json +++ b/js/tsconfig.json @@ -2,7 +2,7 @@ "compileOnSave": true, "compilerOptions": { "declaration": true, - "target": "es6", + "target": "es2020", "module": "commonjs", "moduleResolution": "node", "isolatedModules": false, @@ -10,7 +10,6 @@ "noImplicitAny": true, "noImplicitThis": true, "removeComments": true, - "suppressImplicitAnyIndexErrors": true, "allowSyntheticDefaultImports": true, "strictNullChecks": false, "emitDecoratorMetadata": true diff --git a/js/type_check.js b/js/type_check.js index e77704d1c..b38ce4473 100644 --- a/js/type_check.js +++ b/js/type_check.js @@ -1,47 +1,47 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.isEmptyProperty = exports.isFontProperty = exports.isCaptureProperty = exports.isColorProperty = exports.isButtonProperty = exports.isBooleanProperty = exports.isEditableListProperty = exports.isListProperty = exports.isPathProperty = exports.isTextProperty = exports.isNumberProperty = void 0; +exports.isNumberProperty = isNumberProperty; +exports.isTextProperty = isTextProperty; +exports.isPathProperty = isPathProperty; +exports.isListProperty = isListProperty; +exports.isEditableListProperty = isEditableListProperty; +exports.isBooleanProperty = isBooleanProperty; +exports.isButtonProperty = isButtonProperty; +exports.isColorProperty = isColorProperty; +exports.isCaptureProperty = isCaptureProperty; +exports.isFontProperty = isFontProperty; +exports.isEmptyProperty = isEmptyProperty; function isNumberProperty(property) { return property.type === 2 || property.type === 3; } -exports.isNumberProperty = isNumberProperty; function isTextProperty(property) { return property.type === 4; } -exports.isTextProperty = isTextProperty; function isPathProperty(property) { return property.type === 5; } -exports.isPathProperty = isPathProperty; function isListProperty(property) { return property.type === 6; } -exports.isListProperty = isListProperty; function isEditableListProperty(property) { return property.type === 10; } -exports.isEditableListProperty = isEditableListProperty; function isBooleanProperty(property) { return property.type === 1; } -exports.isBooleanProperty = isBooleanProperty; function isButtonProperty(property) { return property.type === 8; } -exports.isButtonProperty = isButtonProperty; function isColorProperty(property) { return property.type === 7; } -exports.isColorProperty = isColorProperty; function isCaptureProperty(property) { return property.type === 14; } -exports.isCaptureProperty = isCaptureProperty; function isFontProperty(property) { return property.type === 9; } -exports.isFontProperty = isFontProperty; function isEmptyProperty(property) { switch (property.type) { case 1: @@ -53,4 +53,3 @@ function isEmptyProperty(property) { } return false; } -exports.isEmptyProperty = isEmptyProperty; diff --git a/package.json b/package.json index 41f65ca12..45956d251 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "build:javascript": "tsc -p js", "build:docs": "typedoc --out docs", "local:config": "yarn install && git submodule update --init --recursive --force && cmake -Bbuild -H. -G\"Visual Studio 16 2019\" -A\"x64\" -DCMAKE_INSTALL_PREFIX=\"./obs-studio-node\" -DLIBOBS_BUILD_TYPE=\"debug\" -DCMAKE_PREFIX_PATH=%CD%/build/libobs-src/cmake/", - "local:build": "cmake --build build --target install --config Debug", + "local:build": "yarn run build:javascript && cmake --build build --target install --config Debug", "local:clean": "rm -rf build/*", "test:unit": "node ci/run-unit-tests.js", "test:integration": "electron-mocha -t 80000 --js-flags=\"--expose-gc\" --color -r ts-node/register tests/osn-tests/src/**/*.ts --reporter tests/osn-tests/util/list-reporter.js", From b0e915d51fdcd75a4af8bdcefb0c3d636050e045 Mon Sep 17 00:00:00 2001 From: Vladimir Sumarov Date: Wed, 6 May 2026 15:46:23 -0700 Subject: [PATCH 2/8] restore module.ts --- ci/check-js-generated.sh | 0 js/module.d.ts | 69 ++++---- js/module.js | 3 +- js/module.ts | 152 +++++++++--------- ...enhanced-broadcasting-simple-streaming.cpp | 2 - 5 files changed, 106 insertions(+), 120 deletions(-) mode change 100644 => 100755 ci/check-js-generated.sh diff --git a/ci/check-js-generated.sh b/ci/check-js-generated.sh old mode 100644 new mode 100755 diff --git a/js/module.d.ts b/js/module.d.ts index e1415dd75..bc84c41a1 100644 --- a/js/module.d.ts +++ b/js/module.d.ts @@ -296,7 +296,6 @@ export declare const InputFactory: IInputFactory; export declare const SceneFactory: ISceneFactory; export declare const FilterFactory: IFilterFactory; export declare const TransitionFactory: ITransitionFactory; -export declare const DisplayFactory: IDisplayFactory; export declare const VolmeterFactory: IVolmeterFactory; export declare const FaderFactory: IFaderFactory; export declare const Audio: IAudio; @@ -351,8 +350,6 @@ export interface IIPC { disconnect(): void; } export interface IGlobal { - startup(locale: string, path?: string): void; - shutdown(): void; getOutputFlagsFromId(id: string): number; setOutputSource(channel: number, input: ISource): void; getOutputSource(channel: number): ISource; @@ -360,10 +357,8 @@ export interface IGlobal { removeSceneFromBackstage(input: ISource): void; readonly totalFrames: number; readonly laggedFrames: number; - readonly initialized: boolean; locale: string; multipleRendering: boolean; - readonly version: number; readonly cpuPercentage: number; readonly currentFrameRate: number; readonly averageFrameRenderTime: number; @@ -424,7 +419,6 @@ export interface INumberDetails { readonly step: number; } export interface IProperty { - readonly status: number; readonly name: string; readonly description: string; readonly longDescription: string; @@ -433,11 +427,14 @@ export interface IProperty { readonly type: EPropertyType; readonly value: any; next(): IProperty; + previous(): IProperty; + is_first(): boolean; + is_last(): boolean; modified(): boolean; } export interface IProperties { - readonly status: number; first(): IProperty; + last(): IProperty; count(): number; get(name: string): IProperty; } @@ -521,9 +518,11 @@ export interface IInput extends ISource { sendMouseWheel(eventData: IMouseEvent, x_delta: number, y_delta: number): void; sendFocus(focus: boolean): void; sendKeyClick(eventData: IKeyEvent, keyUp: boolean): void; + sendMessage(message: ISettings): void; setFilterOrder(filter: IFilter, movement: EOrderMovement): void; - setFilterOrder(filter: IFilter, movement: EOrderMovement): void; + copyFilters(other: IInput): boolean; readonly filters: IFilter[]; + readonly active: boolean; readonly width: number; readonly height: number; getDuration(): number; @@ -532,6 +531,8 @@ export interface IInput extends ISource { pause(): void; restart(): void; stop(): void; + getMediaState(): number; + load(): void; } export interface ISceneFactory { create(name: string): IScene; @@ -547,6 +548,13 @@ export interface IScene extends ISource { findItem(id: string | number): ISceneItem; getItemAtIdx(idx: number): ISceneItem; getItems(): ISceneItem[]; + getItemsInRange(fromIndex: number, toIndex: number): ISceneItem[]; + load(): void; + sendMouseClick(eventData: IMouseEvent, type: EMouseButtonType, mouseUp: boolean, clickCount: number): void; + sendMouseMove(eventData: IMouseEvent, mouseLeave: boolean): void; + sendMouseWheel(eventData: IMouseEvent, x_delta: number, y_delta: number): void; + sendFocus(focus: boolean): void; + sendKeyClick(eventData: IKeyEvent, keyUp: boolean): void; } export interface ISceneItem { readonly source: IInput; @@ -588,6 +596,12 @@ export interface ITransition extends ISource { clear(): void; set(input: ISource): void; start(ms: number, input: ISource): void; + load(): void; + sendMouseClick(eventData: IMouseEvent, type: EMouseButtonType, mouseUp: boolean, clickCount: number): void; + sendMouseMove(eventData: IMouseEvent, mouseLeave: boolean): void; + sendMouseWheel(eventData: IMouseEvent, x_delta: number, y_delta: number): void; + sendFocus(focus: boolean): void; + sendKeyClick(eventData: IKeyEvent, keyUp: boolean): void; } export interface IConfigurable { update(settings: ISettings): void; @@ -598,7 +612,6 @@ export interface IConfigurable { export interface ISource extends IConfigurable, IReleasable { remove(): void; save(): void; - sendMessage(message: ISettings): void; readonly status: number; readonly type: ESourceType; readonly id: string; @@ -631,26 +644,6 @@ export interface IVolmeter { } export interface ICallbackData { } -export interface IDisplayFactory { - create(source?: IInput): IDisplay; -} -export interface IDisplay { - destroy(): void; - setPosition(x: number, y: number): void; - getPosition(): IVec2; - setSize(x: number, y: number): void; - getSize(): IVec2; - getPreviewOffset(): IVec2; - getPreviewSize(x: number, y: number): void; - shouldDrawUI: boolean; - paddingSize: number; - setPaddingColor(r: number, g: number, b: number, a: number): void; - setBackgroundColor(r: number, g: number, b: number, a: number): void; - setOutlineColor(r: number, g: number, b: number, a: number): void; - setGuidelineColor(r: number, g: number, b: number, a: number): void; - setResizeBoxOuterColor(r: number, g: number, b: number, a: number): void; - setResizeBoxInnerColor(r: number, g: number, b: number, a: number): void; -} export interface IVideoInfo { fpsNum: number; fpsDen: number; @@ -691,22 +684,18 @@ export interface IAudioFactory { disableAudioDucking: boolean; disableAudioDuckingLegacy: boolean; } -export interface IModuleFactory extends IFactoryTypes { +export interface IModuleFactory { open(binPath: string, dataPath: string): IModule; - loadAll(): void; - addPath(path: string, dataPath: string): void; - logLoaded(): void; modules(): String[]; } export interface IModule { initialize(): void; - filename(): string; - name(): string; - author(): string; - description(): string; - binPath(): string; - dataPath(): string; - status(): number; + readonly fileName: string; + readonly name: string; + readonly author: string; + readonly description: string; + readonly binaryPath: string; + readonly dataPath: string; } export declare function addItems(scene: IScene, sceneItems: ISceneItemInfo[]): ISceneItem[]; export interface FilterInfo { diff --git a/js/module.js b/js/module.js index b67bdadc6..e4acf6ceb 100644 --- a/js/module.js +++ b/js/module.js @@ -1,6 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.NodeObs = exports.AdvancedReplayBufferFactory = exports.SimpleReplayBufferFactory = exports.AudioEncoderFactory = exports.AdvancedRecordingFactory = exports.SimpleRecordingFactory = exports.AudioTrackFactory = exports.NetworkFactory = exports.ReconnectFactory = exports.DelayFactory = exports.EnhancedBroadcastingSimpleStreamingFactory = exports.EnhancedBroadcastingAdvancedStreamingFactory = exports.AdvancedStreamingFactory = exports.SimpleStreamingFactory = exports.ServiceFactory = exports.VideoEncoderFactory = exports.IPC = exports.ModuleFactory = exports.AudioFactory = exports.Audio = exports.FaderFactory = exports.VolmeterFactory = exports.DisplayFactory = exports.TransitionFactory = exports.FilterFactory = exports.SceneFactory = exports.InputFactory = exports.VideoFactory = exports.Video = exports.Global = exports.DefaultPluginPathMac = exports.DefaultPluginDataPath = exports.DefaultPluginPath = exports.DefaultDataPath = exports.DefaultBinPath = exports.DefaultDrawPluginPath = exports.DefaultOpenGLPath = exports.DefaultD3D11Path = void 0; +exports.NodeObs = exports.AdvancedReplayBufferFactory = exports.SimpleReplayBufferFactory = exports.AudioEncoderFactory = exports.AdvancedRecordingFactory = exports.SimpleRecordingFactory = exports.AudioTrackFactory = exports.NetworkFactory = exports.ReconnectFactory = exports.DelayFactory = exports.EnhancedBroadcastingSimpleStreamingFactory = exports.EnhancedBroadcastingAdvancedStreamingFactory = exports.AdvancedStreamingFactory = exports.SimpleStreamingFactory = exports.ServiceFactory = exports.VideoEncoderFactory = exports.IPC = exports.ModuleFactory = exports.AudioFactory = exports.Audio = exports.FaderFactory = exports.VolmeterFactory = exports.TransitionFactory = exports.FilterFactory = exports.SceneFactory = exports.InputFactory = exports.VideoFactory = exports.Video = exports.Global = exports.DefaultPluginPathMac = exports.DefaultPluginDataPath = exports.DefaultPluginPath = exports.DefaultDataPath = exports.DefaultBinPath = exports.DefaultDrawPluginPath = exports.DefaultOpenGLPath = exports.DefaultD3D11Path = void 0; exports.addItems = addItems; exports.createSources = createSources; exports.getSourcesSize = getSourcesSize; @@ -25,7 +25,6 @@ exports.InputFactory = obs.Input; exports.SceneFactory = obs.Scene; exports.FilterFactory = obs.Filter; exports.TransitionFactory = obs.Transition; -exports.DisplayFactory = obs.Display; exports.VolmeterFactory = obs.Volmeter; exports.FaderFactory = obs.Fader; exports.Audio = obs.Audio; diff --git a/js/module.ts b/js/module.ts index 03b4885f8..96511a2a6 100644 --- a/js/module.ts +++ b/js/module.ts @@ -381,7 +381,6 @@ export const InputFactory: IInputFactory = obs.Input; export const SceneFactory: ISceneFactory = obs.Scene; export const FilterFactory: IFilterFactory = obs.Filter; export const TransitionFactory: ITransitionFactory = obs.Transition; -export const DisplayFactory: IDisplayFactory = obs.Display; export const VolmeterFactory: IVolmeterFactory = obs.Volmeter; export const FaderFactory: IFaderFactory = obs.Fader; export const Audio: IAudio = obs.Audio; @@ -491,18 +490,6 @@ export interface IIPC { } export interface IGlobal { - /** - * Initializes libobs global context - * @param locale - Locale to be used within libobs - * @param path - Data path of libobs - */ - startup(locale: string, path?: string): void; - - /** - * Uninitializes libobs global context - */ - shutdown(): void; - /** * @param id - String ID of the source * @returns - The output flags (capabilities) of the source type @@ -558,11 +545,6 @@ export interface IGlobal { */ readonly laggedFrames: number; - /** - * Current status of the global libobs context - */ - readonly initialized: boolean; - /** * Current locale of current libobs context */ @@ -573,15 +555,6 @@ export interface IGlobal { */ multipleRendering: boolean; - /** - * Version of current libobs context. - * Represented as a 32-bit unsigned integer. - * First 2 bytes are major. - * Second 2 bytes are minor. - * Last 4 bytes are patch. - */ - readonly version: number; - /** * Percentage of CPU being used */ @@ -697,9 +670,6 @@ export interface INumberDetails { * Class representing an entry in a properties list (Properties). */ export interface IProperty { - /** The validity of the current property instance */ - readonly status: number; - /** * The name associated with the property * You can use this name to fetch from the source @@ -734,6 +704,19 @@ export interface IProperty { * Otherwise or if end of the list, returns false. */ next(): IProperty; + + /** + * Uses the current object to obtain the previous property in the list. + * Returns undefined when the current property is the first. + */ + previous(): IProperty; + + /** True when this property is the first in the list. */ + is_first(): boolean; + + /** True when this property is the last in the list. */ + is_last(): boolean; + modified(): boolean; } @@ -745,12 +728,12 @@ export interface IProperty { */ export interface IProperties { - /** Obtains the status of the list */ - readonly status: number; - /** Obtains the first property in the list. */ first(): IProperty; + /** Obtains the last property in the list. */ + last(): IProperty; + count(): number; /** @@ -924,11 +907,10 @@ export interface IInput extends ISource { sendKeyClick(eventData: IKeyEvent, keyUp: boolean): void; /** - * Move a filter up, down, top, or bottom in the filter list. - * @param filter - The filter to move within the input source. - * @param movement - The movement to make within the list. + * Forward a serializable message to the underlying source plugin. + * Currently only registered on input sources on the native side. */ - setFilterOrder(filter: IFilter, movement: EOrderMovement): void; + sendMessage(message: ISettings): void; /** * Move a filter up, down, top, or bottom in the filter list. @@ -937,12 +919,23 @@ export interface IInput extends ISource { */ setFilterOrder(filter: IFilter, movement: EOrderMovement): void; + /** + * Copy all filters from this input source onto another. + * @param other - Destination input that will receive copies of this source's filters. + * @returns - True on success, false if the IPC call failed. + */ + copyFilters(other: IInput): boolean; /** * Obtain a list of all filters associated with the input source */ readonly filters: IFilter[]; + /** + * Whether the input is currently active (rendering / producing data). + */ + readonly active: boolean; + /** * Width of the underlying source */ @@ -982,6 +975,16 @@ export interface IInput extends ISource { * stop media source */ stop(): void; + + /** + * Get the current media playback state of the source. + */ + getMediaState(): number; + + /** + * Re-trigger the source's load step (re-reads serialized state on the server). + */ + load(): void; } export interface ISceneFactory { @@ -1069,6 +1072,24 @@ export interface IScene extends ISource { * @returns - The array of item instances */ getItems(): ISceneItem[]; + + /** + * Fetch a contiguous range of items within the scene. + * @param fromIndex - Inclusive start index. + * @param toIndex - Inclusive end index. + */ + getItemsInRange(fromIndex: number, toIndex: number): ISceneItem[]; + + /** + * Re-trigger the scene's load step on the server. + */ + load(): void; + + sendMouseClick(eventData: IMouseEvent, type: EMouseButtonType, mouseUp: boolean, clickCount: number): void; + sendMouseMove(eventData: IMouseEvent, mouseLeave: boolean): void; + sendMouseWheel(eventData: IMouseEvent, x_delta: number, y_delta: number): void; + sendFocus(focus: boolean): void; + sendKeyClick(eventData: IKeyEvent, keyUp: boolean): void; } /** @@ -1225,6 +1246,17 @@ export interface ITransition extends ISource { * @param input - Source to transition to */ start(ms: number, input: ISource): void; + + /** + * Re-trigger the transition's load step on the server. + */ + load(): void; + + sendMouseClick(eventData: IMouseEvent, type: EMouseButtonType, mouseUp: boolean, clickCount: number): void; + sendMouseMove(eventData: IMouseEvent, mouseLeave: boolean): void; + sendMouseWheel(eventData: IMouseEvent, x_delta: number, y_delta: number): void; + sendFocus(focus: boolean): void; + sendKeyClick(eventData: IKeyEvent, keyUp: boolean): void; } export interface IConfigurable { @@ -1268,7 +1300,6 @@ export interface ISource extends IConfigurable, IReleasable { */ save(): void; - sendMessage(message: ISettings): void; /** * The validity of the source */ @@ -1408,33 +1439,6 @@ export interface IVolmeter { export interface ICallbackData { } -export interface IDisplayFactory { - create(source?: IInput): IDisplay; -} - -export interface IDisplay { - destroy(): void; - - setPosition(x: number, y: number): void; - getPosition(): IVec2; - - setSize(x: number, y: number): void; - getSize(): IVec2; - - getPreviewOffset(): IVec2; - getPreviewSize(x: number, y: number): void; - - shouldDrawUI: boolean; - paddingSize: number; - - setPaddingColor(r: number, g: number, b: number, a: number): void; - setBackgroundColor(r: number, g: number, b: number, a: number): void; - setOutlineColor(r: number, g: number, b: number, a: number): void; - setGuidelineColor(r: number, g: number, b: number, a: number): void; - setResizeBoxOuterColor(r: number, g: number, b: number, a: number): void; - setResizeBoxInnerColor(r: number, g: number, b: number, a: number): void; -} - /** * This represents a obs_video_info structure from within libobs */ @@ -1491,23 +1495,19 @@ export interface IAudioFactory { disableAudioDuckingLegacy: boolean; // Windows only } -export interface IModuleFactory extends IFactoryTypes { +export interface IModuleFactory { open(binPath: string, dataPath: string): IModule; - loadAll(): void; - addPath(path: string, dataPath: string): void; - logLoaded(): void; modules(): String[]; } export interface IModule { initialize(): void; - filename(): string; - name(): string; - author(): string; - description(): string; - binPath(): string; - dataPath(): string; - status(): number; + readonly fileName: string; + readonly name: string; + readonly author: string; + readonly description: string; + readonly binaryPath: string; + readonly dataPath: string; } export function addItems(scene: IScene, sceneItems: ISceneItemInfo[]): ISceneItem[] { diff --git a/obs-studio-client/source/enhanced-broadcasting-simple-streaming.cpp b/obs-studio-client/source/enhanced-broadcasting-simple-streaming.cpp index 80bb976aa..2a8c2253f 100644 --- a/obs-studio-client/source/enhanced-broadcasting-simple-streaming.cpp +++ b/obs-studio-client/source/enhanced-broadcasting-simple-streaming.cpp @@ -43,8 +43,6 @@ Napi::Object osn::EnhancedBroadcastingSimpleStreaming::Init(Napi::Env env, Napi: &osn::EnhancedBroadcastingSimpleStreaming::SetEnforceServiceBirate), InstanceAccessor("enableTwitchVOD", &osn::EnhancedBroadcastingSimpleStreaming::GetEnableTwitchVOD, &osn::EnhancedBroadcastingSimpleStreaming::SetEnableTwitchVOD), - InstanceAccessor("audioEncoder", &osn::EnhancedBroadcastingSimpleStreaming::GetAudioEncoder, - &osn::EnhancedBroadcastingSimpleStreaming::SetAudioEncoder), InstanceAccessor("useAdvanced", &osn::EnhancedBroadcastingSimpleStreaming::GetUseAdvanced, &osn::EnhancedBroadcastingSimpleStreaming::SetUseAdvanced), InstanceAccessor("customEncSettings", &osn::EnhancedBroadcastingSimpleStreaming::GetCustomEncSettings, From b2787ee6660728213b42d63e9272b8c1dd4b7a1b Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 5 May 2026 18:41:49 -0700 Subject: [PATCH 3/8] Potential fix for pull request finding 'CodeQL / Workflow does not contain permissions' Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- .github/workflows/check-js-generated.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/check-js-generated.yml b/.github/workflows/check-js-generated.yml index 96cdf1839..c0111b264 100644 --- a/.github/workflows/check-js-generated.yml +++ b/.github/workflows/check-js-generated.yml @@ -8,6 +8,9 @@ on: paths-ignore: ['**.md'] branches-ignore: [staging] +permissions: + contents: read + jobs: check-js-generated: runs-on: ubuntu-22.04 From 98001b957cdc5388afb235949f277af06dbde736 Mon Sep 17 00:00:00 2001 From: Vladimir Date: Tue, 5 May 2026 18:45:13 -0700 Subject: [PATCH 4/8] Potential fix for pull request finding Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --- ci/check-js-generated.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/check-js-generated.sh b/ci/check-js-generated.sh index a3361d55e..74a386c00 100755 --- a/ci/check-js-generated.sh +++ b/ci/check-js-generated.sh @@ -1,8 +1,8 @@ #!/bin/bash # Verify that the committed tsc outputs under js/ match what regenerating # from js/module.ts would produce. CI runs `yarn build:javascript` first, -# so any modified file at this point is a stale generated file. -dirty=$(git ls-files --modified js/) +# so any change under js/ at this point is a stale generated file. +dirty=$(git status --porcelain -- js/) set +x if [[ $dirty ]]; then From 94f86aa8ec08772375f3f18caa0671e7ddf6c3e0 Mon Sep 17 00:00:00 2001 From: Vladimir Sumarov Date: Wed, 6 May 2026 17:09:57 -0700 Subject: [PATCH 5/8] restore module.ts --- js/module.d.ts | 2 +- js/module.ts | 13 +++++++------ 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/js/module.d.ts b/js/module.d.ts index bc84c41a1..cdcb50121 100644 --- a/js/module.d.ts +++ b/js/module.d.ts @@ -518,7 +518,6 @@ export interface IInput extends ISource { sendMouseWheel(eventData: IMouseEvent, x_delta: number, y_delta: number): void; sendFocus(focus: boolean): void; sendKeyClick(eventData: IKeyEvent, keyUp: boolean): void; - sendMessage(message: ISettings): void; setFilterOrder(filter: IFilter, movement: EOrderMovement): void; copyFilters(other: IInput): boolean; readonly filters: IFilter[]; @@ -612,6 +611,7 @@ export interface IConfigurable { export interface ISource extends IConfigurable, IReleasable { remove(): void; save(): void; + sendMessage(message: ISettings): void; readonly status: number; readonly type: ESourceType; readonly id: string; diff --git a/js/module.ts b/js/module.ts index 96511a2a6..a1ec21878 100644 --- a/js/module.ts +++ b/js/module.ts @@ -906,12 +906,6 @@ export interface IInput extends ISource { sendFocus(focus: boolean): void; sendKeyClick(eventData: IKeyEvent, keyUp: boolean): void; - /** - * Forward a serializable message to the underlying source plugin. - * Currently only registered on input sources on the native side. - */ - sendMessage(message: ISettings): void; - /** * Move a filter up, down, top, or bottom in the filter list. * @param filter - The filter to move within the input source. @@ -1300,6 +1294,13 @@ export interface ISource extends IConfigurable, IReleasable { */ save(): void; + /** + * Forward a serializable message to the underlying source plugin. + * Note: only registered on input sources on the native side; calling on + * a filter, scene, or transition will throw at runtime. + */ + sendMessage(message: ISettings): void; + /** * The validity of the source */ From 65c916328fe47dafc0880f528f97fcb11746149c Mon Sep 17 00:00:00 2001 From: Vladimir Sumarov Date: Mon, 1 Jun 2026 16:26:58 -0700 Subject: [PATCH 6/8] convert const enums to regular enums const enum members are inlined at compile time and produce no runtime object. Downstream consumers that bundle with isolatedModules: true cannot inline across module boundaries, so osn.E*.* reads resolve to undefined at runtime. Dropping const makes tsc emit real runtime enum objects into module.js. Source change folded in from #1430 (Ava Creeth); the js/ outputs were regenerated via the build:javascript pipeline. type_check.js now resolves EPropertyType through the runtime object instead of inlined numeric literals, demonstrating the same inlining fix in this repo's own code. Co-authored-by: Ava Creeth Co-Authored-By: Claude Opus 4.8 (1M context) --- js/module.d.ts | 88 +++++------ js/module.js | 382 ++++++++++++++++++++++++++++++++++++++++++++++- js/module.ts | 88 +++++------ js/type_check.js | 33 ++-- 4 files changed, 486 insertions(+), 105 deletions(-) diff --git a/js/module.d.ts b/js/module.d.ts index cdcb50121..63fe8b2f5 100644 --- a/js/module.d.ts +++ b/js/module.d.ts @@ -6,26 +6,26 @@ export declare const DefaultDataPath: string; export declare const DefaultPluginPath: string; export declare const DefaultPluginDataPath: string; export declare const DefaultPluginPathMac: string; -export declare const enum ESourceFlags { +export declare enum ESourceFlags { Unbuffered = 1, ForceMono = 2 } -export declare const enum EMonitoringType { +export declare enum EMonitoringType { None = 0, MonitoringOnly = 1, MonitoringAndOutput = 2 } -export declare const enum EOrderMovement { +export declare enum EOrderMovement { Up = 0, Down = 1, Top = 2, Bottom = 3 } -export declare const enum EDeinterlaceFieldOrder { +export declare enum EDeinterlaceFieldOrder { Top = 0, Bottom = 1 } -export declare const enum EVideoCodes { +export declare enum EVideoCodes { Success = 0, Fail = -1, NotSupported = -2, @@ -33,14 +33,14 @@ export declare const enum EVideoCodes { CurrentlyActive = -4, ModuleNotFound = -5 } -export declare const enum EHotkeyObjectType { +export declare enum EHotkeyObjectType { Frontend = 0, Source = 1, Output = 2, Encoder = 3, Service = 4 } -export declare const enum EDeinterlaceMode { +export declare enum EDeinterlaceMode { Disable = 0, Discard = 1, Retro = 2, @@ -51,11 +51,11 @@ export declare const enum EDeinterlaceMode { Yadif = 7, Yadif2X = 8 } -export declare const enum EBlendingMethod { +export declare enum EBlendingMethod { Default = 0, SrgbOff = 1 } -export declare const enum EBlendingMode { +export declare enum EBlendingMode { Normal = 0, Additive = 1, Substract = 2, @@ -64,13 +64,13 @@ export declare const enum EBlendingMode { Lighten = 5, Darken = 6 } -export declare const enum EFontStyle { +export declare enum EFontStyle { Bold = 1, Italic = 2, Underline = 4, Strikeout = 8 } -export declare const enum EPropertyType { +export declare enum EPropertyType { Invalid = 0, Boolean = 1, Int = 2, @@ -87,38 +87,38 @@ export declare const enum EPropertyType { ColorAlpha = 13, Capture = 14 } -export declare const enum EListFormat { +export declare enum EListFormat { Invalid = 0, Int = 1, Float = 2, String = 3 } -export declare const enum EEditableListType { +export declare enum EEditableListType { Strings = 0, Files = 1, FilesAndUrls = 2 } -export declare const enum EPathType { +export declare enum EPathType { File = 0, FileSave = 1, Directory = 2 } -export declare const enum ETextType { +export declare enum ETextType { Default = 0, Password = 1, Multiline = 2, TextInfo = 3 } -export declare const enum ETextInfoType { +export declare enum ETextInfoType { Normal = 0, Warning = 1, Error = 2 } -export declare const enum ENumberType { +export declare enum ENumberType { Scroller = 0, Slider = 1 } -export declare const enum EAlignment { +export declare enum EAlignment { Center = 0, Left = 1, Right = 2, @@ -129,7 +129,7 @@ export declare const enum EAlignment { BottomLeft = 9, BottomRight = 10 } -export declare const enum EOutputFlags { +export declare enum EOutputFlags { Video = 1, Audio = 2, AV = 3, @@ -137,7 +137,7 @@ export declare const enum EOutputFlags { Service = 8, MultiTrack = 16 } -export declare const enum ESourceOutputFlags { +export declare enum ESourceOutputFlags { Video = 1, Audio = 2, Async = 4, @@ -150,24 +150,24 @@ export declare const enum ESourceOutputFlags { DoNotSelfMonitor = 512, ForceUiRefresh = 1073741824 } -export declare const enum ESceneDupType { +export declare enum ESceneDupType { Refs = 0, Copy = 1, PrivateRefs = 2, PrivateCopy = 3 } -export declare const enum ESourceType { +export declare enum ESourceType { Input = 0, Filter = 1, Transition = 2, Scene = 3 } -export declare const enum EFaderType { +export declare enum EFaderType { Cubic = 0, IEC = 1, Log = 2 } -export declare const enum EColorFormat { +export declare enum EColorFormat { Unknown = 0, A8 = 1, R8 = 2, @@ -187,7 +187,7 @@ export declare const enum EColorFormat { DXT3 = 16, DXT5 = 17 } -export declare const enum EScaleType { +export declare enum EScaleType { Disable = 0, Point = 1, Bicubic = 2, @@ -195,17 +195,17 @@ export declare const enum EScaleType { Lanczos = 4, Area = 5 } -export declare const enum EFPSType { +export declare enum EFPSType { Common = 0, Integer = 1, Fractional = 2 } -export declare const enum ERangeType { +export declare enum ERangeType { Default = 0, Partial = 1, Full = 2 } -export declare const enum EVideoFormat { +export declare enum EVideoFormat { None = 0, I420 = 1, NV12 = 2, @@ -224,7 +224,7 @@ export declare const enum EVideoFormat { YUVA = 15, AYUV = 16 } -export declare const enum EBoundsType { +export declare enum EBoundsType { None = 0, Stretch = 1, ScaleInner = 2, @@ -233,7 +233,7 @@ export declare const enum EBoundsType { ScaleToHeight = 5, MaxOnly = 6 } -export declare const enum EColorSpace { +export declare enum EColorSpace { Default = 0, CS601 = 1, CS709 = 2, @@ -241,7 +241,7 @@ export declare const enum EColorSpace { CS2100PQ = 4, CS2100HLG = 5 } -export declare const enum ESpeakerLayout { +export declare enum ESpeakerLayout { Unknown = 0, Mono = 1, Stereo = 2, @@ -251,7 +251,7 @@ export declare const enum ESpeakerLayout { FiveOne = 6, SevenOne = 8 } -export declare const enum EOutputCode { +export declare enum EOutputCode { Success = 0, BadPath = -1, ConnectFailed = -2, @@ -263,28 +263,28 @@ export declare const enum EOutputCode { EncoderError = -8, OutdatedDriver = -65 } -export declare const enum ECategoryTypes { +export declare enum ECategoryTypes { NODEOBS_CATEGORY_LIST = 0, NODEOBS_CATEGORY_TAB = 1 } -export declare const enum ERenderingMode { +export declare enum ERenderingMode { OBS_MAIN_RENDERING = 0, OBS_STREAMING_RENDERING = 1, OBS_RECORDING_RENDERING = 2 } -export declare const enum EIPCError { +export declare enum EIPCError { STILL_RUNNING = 259, VERSION_MISMATCH = 252, OTHER_ERROR = 253, MISSING_DEPENDENCY = 254, NORMAL_EXIT = 0 } -export declare const enum EVcamInstalledStatus { +export declare enum EVcamInstalledStatus { NotInstalled = 0, LegacyInstalled = 1, Installed = 2 } -export declare const enum ERecSplitType { +export declare enum ERecSplitType { Time = 0, Size = 1, Manual = 2 @@ -455,7 +455,7 @@ export interface IInputFactory extends IFactoryTypes { fromName(name: string): IInput; getPublicSources(): IInput[]; } -export declare const enum EInteractionFlags { +export declare enum EInteractionFlags { None = 0, CapsKey = 1, ShiftKey = 2, @@ -470,7 +470,7 @@ export declare const enum EInteractionFlags { IsLeft = 1024, IsRight = 2048 } -export declare const enum EMouseButtonType { +export declare enum EMouseButtonType { Left = 0, Middle = 1, Right = 2 @@ -739,7 +739,7 @@ export interface IService { readonly settings: ISettings; update(settings: ISettings): void; } -export declare const enum ERecordingFormat { +export declare enum ERecordingFormat { MP4 = "mp4", FLV = "flv", MOV = "mov", @@ -747,17 +747,17 @@ export declare const enum ERecordingFormat { MPEGTS = "ts", HLS = "m3u8" } -export declare const enum ERecordingQuality { +export declare enum ERecordingQuality { Stream = 0, HighQuality = 1, HigherQuality = 2, Lossless = 3 } -export declare const enum EVideoEncoderType { +export declare enum EVideoEncoderType { Audio = 0, Video = 1 } -export declare const enum EProcessPriority { +export declare enum EProcessPriority { High = "High", AboveNormal = "AboveNormal", Normal = "Normal", @@ -965,7 +965,7 @@ export interface IAudioTrackFactory { importLegacySettings(): void; saveLegacySettings(): void; } -export declare const enum VCamOutputType { +export declare enum VCamOutputType { Invalid = 0, SceneOutput = 1, SourceOutput = 2, diff --git a/js/module.js b/js/module.js index e4acf6ceb..3b7dc5122 100644 --- a/js/module.js +++ b/js/module.js @@ -1,6 +1,7 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.NodeObs = exports.AdvancedReplayBufferFactory = exports.SimpleReplayBufferFactory = exports.AudioEncoderFactory = exports.AdvancedRecordingFactory = exports.SimpleRecordingFactory = exports.AudioTrackFactory = exports.NetworkFactory = exports.ReconnectFactory = exports.DelayFactory = exports.EnhancedBroadcastingSimpleStreamingFactory = exports.EnhancedBroadcastingAdvancedStreamingFactory = exports.AdvancedStreamingFactory = exports.SimpleStreamingFactory = exports.ServiceFactory = exports.VideoEncoderFactory = exports.IPC = exports.ModuleFactory = exports.AudioFactory = exports.Audio = exports.FaderFactory = exports.VolmeterFactory = exports.TransitionFactory = exports.FilterFactory = exports.SceneFactory = exports.InputFactory = exports.VideoFactory = exports.Video = exports.Global = exports.DefaultPluginPathMac = exports.DefaultPluginDataPath = exports.DefaultPluginPath = exports.DefaultDataPath = exports.DefaultBinPath = exports.DefaultDrawPluginPath = exports.DefaultOpenGLPath = exports.DefaultD3D11Path = void 0; +exports.SceneFactory = exports.InputFactory = exports.VideoFactory = exports.Video = exports.Global = exports.ERecSplitType = exports.EVcamInstalledStatus = exports.EIPCError = exports.ERenderingMode = exports.ECategoryTypes = exports.EOutputCode = exports.ESpeakerLayout = exports.EColorSpace = exports.EBoundsType = exports.EVideoFormat = exports.ERangeType = exports.EFPSType = exports.EScaleType = exports.EColorFormat = exports.EFaderType = exports.ESourceType = exports.ESceneDupType = exports.ESourceOutputFlags = exports.EOutputFlags = exports.EAlignment = exports.ENumberType = exports.ETextInfoType = exports.ETextType = exports.EPathType = exports.EEditableListType = exports.EListFormat = exports.EPropertyType = exports.EFontStyle = exports.EBlendingMode = exports.EBlendingMethod = exports.EDeinterlaceMode = exports.EHotkeyObjectType = exports.EVideoCodes = exports.EDeinterlaceFieldOrder = exports.EOrderMovement = exports.EMonitoringType = exports.ESourceFlags = exports.DefaultPluginPathMac = exports.DefaultPluginDataPath = exports.DefaultPluginPath = exports.DefaultDataPath = exports.DefaultBinPath = exports.DefaultDrawPluginPath = exports.DefaultOpenGLPath = exports.DefaultD3D11Path = void 0; +exports.NodeObs = exports.VCamOutputType = exports.EProcessPriority = exports.EVideoEncoderType = exports.ERecordingQuality = exports.ERecordingFormat = exports.EMouseButtonType = exports.EInteractionFlags = exports.AdvancedReplayBufferFactory = exports.SimpleReplayBufferFactory = exports.AudioEncoderFactory = exports.AdvancedRecordingFactory = exports.SimpleRecordingFactory = exports.AudioTrackFactory = exports.NetworkFactory = exports.ReconnectFactory = exports.DelayFactory = exports.EnhancedBroadcastingSimpleStreamingFactory = exports.EnhancedBroadcastingAdvancedStreamingFactory = exports.AdvancedStreamingFactory = exports.SimpleStreamingFactory = exports.ServiceFactory = exports.VideoEncoderFactory = exports.IPC = exports.ModuleFactory = exports.AudioFactory = exports.Audio = exports.FaderFactory = exports.VolmeterFactory = exports.TransitionFactory = exports.FilterFactory = void 0; exports.addItems = addItems; exports.createSources = createSources; exports.getSourcesSize = getSourcesSize; @@ -18,6 +19,326 @@ exports.DefaultDataPath = path.resolve(__dirname, `data`); exports.DefaultPluginPath = path.resolve(__dirname, `obs-plugins`); exports.DefaultPluginDataPath = path.resolve(__dirname, `data/obs-plugins/%module%`); exports.DefaultPluginPathMac = path.resolve(__dirname, `PlugIns`); +var ESourceFlags; +(function (ESourceFlags) { + ESourceFlags[ESourceFlags["Unbuffered"] = 1] = "Unbuffered"; + ESourceFlags[ESourceFlags["ForceMono"] = 2] = "ForceMono"; +})(ESourceFlags || (exports.ESourceFlags = ESourceFlags = {})); +var EMonitoringType; +(function (EMonitoringType) { + EMonitoringType[EMonitoringType["None"] = 0] = "None"; + EMonitoringType[EMonitoringType["MonitoringOnly"] = 1] = "MonitoringOnly"; + EMonitoringType[EMonitoringType["MonitoringAndOutput"] = 2] = "MonitoringAndOutput"; +})(EMonitoringType || (exports.EMonitoringType = EMonitoringType = {})); +var EOrderMovement; +(function (EOrderMovement) { + EOrderMovement[EOrderMovement["Up"] = 0] = "Up"; + EOrderMovement[EOrderMovement["Down"] = 1] = "Down"; + EOrderMovement[EOrderMovement["Top"] = 2] = "Top"; + EOrderMovement[EOrderMovement["Bottom"] = 3] = "Bottom"; +})(EOrderMovement || (exports.EOrderMovement = EOrderMovement = {})); +var EDeinterlaceFieldOrder; +(function (EDeinterlaceFieldOrder) { + EDeinterlaceFieldOrder[EDeinterlaceFieldOrder["Top"] = 0] = "Top"; + EDeinterlaceFieldOrder[EDeinterlaceFieldOrder["Bottom"] = 1] = "Bottom"; +})(EDeinterlaceFieldOrder || (exports.EDeinterlaceFieldOrder = EDeinterlaceFieldOrder = {})); +var EVideoCodes; +(function (EVideoCodes) { + EVideoCodes[EVideoCodes["Success"] = 0] = "Success"; + EVideoCodes[EVideoCodes["Fail"] = -1] = "Fail"; + EVideoCodes[EVideoCodes["NotSupported"] = -2] = "NotSupported"; + EVideoCodes[EVideoCodes["InvalidParam"] = -3] = "InvalidParam"; + EVideoCodes[EVideoCodes["CurrentlyActive"] = -4] = "CurrentlyActive"; + EVideoCodes[EVideoCodes["ModuleNotFound"] = -5] = "ModuleNotFound"; +})(EVideoCodes || (exports.EVideoCodes = EVideoCodes = {})); +var EHotkeyObjectType; +(function (EHotkeyObjectType) { + EHotkeyObjectType[EHotkeyObjectType["Frontend"] = 0] = "Frontend"; + EHotkeyObjectType[EHotkeyObjectType["Source"] = 1] = "Source"; + EHotkeyObjectType[EHotkeyObjectType["Output"] = 2] = "Output"; + EHotkeyObjectType[EHotkeyObjectType["Encoder"] = 3] = "Encoder"; + EHotkeyObjectType[EHotkeyObjectType["Service"] = 4] = "Service"; +})(EHotkeyObjectType || (exports.EHotkeyObjectType = EHotkeyObjectType = {})); +var EDeinterlaceMode; +(function (EDeinterlaceMode) { + EDeinterlaceMode[EDeinterlaceMode["Disable"] = 0] = "Disable"; + EDeinterlaceMode[EDeinterlaceMode["Discard"] = 1] = "Discard"; + EDeinterlaceMode[EDeinterlaceMode["Retro"] = 2] = "Retro"; + EDeinterlaceMode[EDeinterlaceMode["Blend"] = 3] = "Blend"; + EDeinterlaceMode[EDeinterlaceMode["Blend2X"] = 4] = "Blend2X"; + EDeinterlaceMode[EDeinterlaceMode["Linear"] = 5] = "Linear"; + EDeinterlaceMode[EDeinterlaceMode["Linear2X"] = 6] = "Linear2X"; + EDeinterlaceMode[EDeinterlaceMode["Yadif"] = 7] = "Yadif"; + EDeinterlaceMode[EDeinterlaceMode["Yadif2X"] = 8] = "Yadif2X"; +})(EDeinterlaceMode || (exports.EDeinterlaceMode = EDeinterlaceMode = {})); +var EBlendingMethod; +(function (EBlendingMethod) { + EBlendingMethod[EBlendingMethod["Default"] = 0] = "Default"; + EBlendingMethod[EBlendingMethod["SrgbOff"] = 1] = "SrgbOff"; +})(EBlendingMethod || (exports.EBlendingMethod = EBlendingMethod = {})); +var EBlendingMode; +(function (EBlendingMode) { + EBlendingMode[EBlendingMode["Normal"] = 0] = "Normal"; + EBlendingMode[EBlendingMode["Additive"] = 1] = "Additive"; + EBlendingMode[EBlendingMode["Substract"] = 2] = "Substract"; + EBlendingMode[EBlendingMode["Screen"] = 3] = "Screen"; + EBlendingMode[EBlendingMode["Multiply"] = 4] = "Multiply"; + EBlendingMode[EBlendingMode["Lighten"] = 5] = "Lighten"; + EBlendingMode[EBlendingMode["Darken"] = 6] = "Darken"; +})(EBlendingMode || (exports.EBlendingMode = EBlendingMode = {})); +var EFontStyle; +(function (EFontStyle) { + EFontStyle[EFontStyle["Bold"] = 1] = "Bold"; + EFontStyle[EFontStyle["Italic"] = 2] = "Italic"; + EFontStyle[EFontStyle["Underline"] = 4] = "Underline"; + EFontStyle[EFontStyle["Strikeout"] = 8] = "Strikeout"; +})(EFontStyle || (exports.EFontStyle = EFontStyle = {})); +var EPropertyType; +(function (EPropertyType) { + EPropertyType[EPropertyType["Invalid"] = 0] = "Invalid"; + EPropertyType[EPropertyType["Boolean"] = 1] = "Boolean"; + EPropertyType[EPropertyType["Int"] = 2] = "Int"; + EPropertyType[EPropertyType["Float"] = 3] = "Float"; + EPropertyType[EPropertyType["Text"] = 4] = "Text"; + EPropertyType[EPropertyType["Path"] = 5] = "Path"; + EPropertyType[EPropertyType["List"] = 6] = "List"; + EPropertyType[EPropertyType["Color"] = 7] = "Color"; + EPropertyType[EPropertyType["Button"] = 8] = "Button"; + EPropertyType[EPropertyType["Font"] = 9] = "Font"; + EPropertyType[EPropertyType["EditableList"] = 10] = "EditableList"; + EPropertyType[EPropertyType["FrameRate"] = 11] = "FrameRate"; + EPropertyType[EPropertyType["Group"] = 12] = "Group"; + EPropertyType[EPropertyType["ColorAlpha"] = 13] = "ColorAlpha"; + EPropertyType[EPropertyType["Capture"] = 14] = "Capture"; +})(EPropertyType || (exports.EPropertyType = EPropertyType = {})); +var EListFormat; +(function (EListFormat) { + EListFormat[EListFormat["Invalid"] = 0] = "Invalid"; + EListFormat[EListFormat["Int"] = 1] = "Int"; + EListFormat[EListFormat["Float"] = 2] = "Float"; + EListFormat[EListFormat["String"] = 3] = "String"; +})(EListFormat || (exports.EListFormat = EListFormat = {})); +var EEditableListType; +(function (EEditableListType) { + EEditableListType[EEditableListType["Strings"] = 0] = "Strings"; + EEditableListType[EEditableListType["Files"] = 1] = "Files"; + EEditableListType[EEditableListType["FilesAndUrls"] = 2] = "FilesAndUrls"; +})(EEditableListType || (exports.EEditableListType = EEditableListType = {})); +var EPathType; +(function (EPathType) { + EPathType[EPathType["File"] = 0] = "File"; + EPathType[EPathType["FileSave"] = 1] = "FileSave"; + EPathType[EPathType["Directory"] = 2] = "Directory"; +})(EPathType || (exports.EPathType = EPathType = {})); +var ETextType; +(function (ETextType) { + ETextType[ETextType["Default"] = 0] = "Default"; + ETextType[ETextType["Password"] = 1] = "Password"; + ETextType[ETextType["Multiline"] = 2] = "Multiline"; + ETextType[ETextType["TextInfo"] = 3] = "TextInfo"; +})(ETextType || (exports.ETextType = ETextType = {})); +var ETextInfoType; +(function (ETextInfoType) { + ETextInfoType[ETextInfoType["Normal"] = 0] = "Normal"; + ETextInfoType[ETextInfoType["Warning"] = 1] = "Warning"; + ETextInfoType[ETextInfoType["Error"] = 2] = "Error"; +})(ETextInfoType || (exports.ETextInfoType = ETextInfoType = {})); +var ENumberType; +(function (ENumberType) { + ENumberType[ENumberType["Scroller"] = 0] = "Scroller"; + ENumberType[ENumberType["Slider"] = 1] = "Slider"; +})(ENumberType || (exports.ENumberType = ENumberType = {})); +var EAlignment; +(function (EAlignment) { + EAlignment[EAlignment["Center"] = 0] = "Center"; + EAlignment[EAlignment["Left"] = 1] = "Left"; + EAlignment[EAlignment["Right"] = 2] = "Right"; + EAlignment[EAlignment["Top"] = 4] = "Top"; + EAlignment[EAlignment["Bottom"] = 8] = "Bottom"; + EAlignment[EAlignment["TopLeft"] = 5] = "TopLeft"; + EAlignment[EAlignment["TopRight"] = 6] = "TopRight"; + EAlignment[EAlignment["BottomLeft"] = 9] = "BottomLeft"; + EAlignment[EAlignment["BottomRight"] = 10] = "BottomRight"; +})(EAlignment || (exports.EAlignment = EAlignment = {})); +var EOutputFlags; +(function (EOutputFlags) { + EOutputFlags[EOutputFlags["Video"] = 1] = "Video"; + EOutputFlags[EOutputFlags["Audio"] = 2] = "Audio"; + EOutputFlags[EOutputFlags["AV"] = 3] = "AV"; + EOutputFlags[EOutputFlags["Encoded"] = 4] = "Encoded"; + EOutputFlags[EOutputFlags["Service"] = 8] = "Service"; + EOutputFlags[EOutputFlags["MultiTrack"] = 16] = "MultiTrack"; +})(EOutputFlags || (exports.EOutputFlags = EOutputFlags = {})); +var ESourceOutputFlags; +(function (ESourceOutputFlags) { + ESourceOutputFlags[ESourceOutputFlags["Video"] = 1] = "Video"; + ESourceOutputFlags[ESourceOutputFlags["Audio"] = 2] = "Audio"; + ESourceOutputFlags[ESourceOutputFlags["Async"] = 4] = "Async"; + ESourceOutputFlags[ESourceOutputFlags["AsyncVideo"] = 5] = "AsyncVideo"; + ESourceOutputFlags[ESourceOutputFlags["CustomDraw"] = 8] = "CustomDraw"; + ESourceOutputFlags[ESourceOutputFlags["Interaction"] = 32] = "Interaction"; + ESourceOutputFlags[ESourceOutputFlags["Composite"] = 64] = "Composite"; + ESourceOutputFlags[ESourceOutputFlags["DoNotDuplicate"] = 128] = "DoNotDuplicate"; + ESourceOutputFlags[ESourceOutputFlags["Deprecated"] = 256] = "Deprecated"; + ESourceOutputFlags[ESourceOutputFlags["DoNotSelfMonitor"] = 512] = "DoNotSelfMonitor"; + ESourceOutputFlags[ESourceOutputFlags["ForceUiRefresh"] = 1073741824] = "ForceUiRefresh"; +})(ESourceOutputFlags || (exports.ESourceOutputFlags = ESourceOutputFlags = {})); +var ESceneDupType; +(function (ESceneDupType) { + ESceneDupType[ESceneDupType["Refs"] = 0] = "Refs"; + ESceneDupType[ESceneDupType["Copy"] = 1] = "Copy"; + ESceneDupType[ESceneDupType["PrivateRefs"] = 2] = "PrivateRefs"; + ESceneDupType[ESceneDupType["PrivateCopy"] = 3] = "PrivateCopy"; +})(ESceneDupType || (exports.ESceneDupType = ESceneDupType = {})); +var ESourceType; +(function (ESourceType) { + ESourceType[ESourceType["Input"] = 0] = "Input"; + ESourceType[ESourceType["Filter"] = 1] = "Filter"; + ESourceType[ESourceType["Transition"] = 2] = "Transition"; + ESourceType[ESourceType["Scene"] = 3] = "Scene"; +})(ESourceType || (exports.ESourceType = ESourceType = {})); +var EFaderType; +(function (EFaderType) { + EFaderType[EFaderType["Cubic"] = 0] = "Cubic"; + EFaderType[EFaderType["IEC"] = 1] = "IEC"; + EFaderType[EFaderType["Log"] = 2] = "Log"; +})(EFaderType || (exports.EFaderType = EFaderType = {})); +var EColorFormat; +(function (EColorFormat) { + EColorFormat[EColorFormat["Unknown"] = 0] = "Unknown"; + EColorFormat[EColorFormat["A8"] = 1] = "A8"; + EColorFormat[EColorFormat["R8"] = 2] = "R8"; + EColorFormat[EColorFormat["RGBA"] = 3] = "RGBA"; + EColorFormat[EColorFormat["BGRX"] = 4] = "BGRX"; + EColorFormat[EColorFormat["BGRA"] = 5] = "BGRA"; + EColorFormat[EColorFormat["R10G10B10A2"] = 6] = "R10G10B10A2"; + EColorFormat[EColorFormat["RGBA16"] = 7] = "RGBA16"; + EColorFormat[EColorFormat["R16"] = 8] = "R16"; + EColorFormat[EColorFormat["RGBA16F"] = 9] = "RGBA16F"; + EColorFormat[EColorFormat["RGBA32F"] = 10] = "RGBA32F"; + EColorFormat[EColorFormat["RG16F"] = 11] = "RG16F"; + EColorFormat[EColorFormat["RG32F"] = 12] = "RG32F"; + EColorFormat[EColorFormat["R16F"] = 13] = "R16F"; + EColorFormat[EColorFormat["R32F"] = 14] = "R32F"; + EColorFormat[EColorFormat["DXT1"] = 15] = "DXT1"; + EColorFormat[EColorFormat["DXT3"] = 16] = "DXT3"; + EColorFormat[EColorFormat["DXT5"] = 17] = "DXT5"; +})(EColorFormat || (exports.EColorFormat = EColorFormat = {})); +var EScaleType; +(function (EScaleType) { + EScaleType[EScaleType["Disable"] = 0] = "Disable"; + EScaleType[EScaleType["Point"] = 1] = "Point"; + EScaleType[EScaleType["Bicubic"] = 2] = "Bicubic"; + EScaleType[EScaleType["Bilinear"] = 3] = "Bilinear"; + EScaleType[EScaleType["Lanczos"] = 4] = "Lanczos"; + EScaleType[EScaleType["Area"] = 5] = "Area"; +})(EScaleType || (exports.EScaleType = EScaleType = {})); +var EFPSType; +(function (EFPSType) { + EFPSType[EFPSType["Common"] = 0] = "Common"; + EFPSType[EFPSType["Integer"] = 1] = "Integer"; + EFPSType[EFPSType["Fractional"] = 2] = "Fractional"; +})(EFPSType || (exports.EFPSType = EFPSType = {})); +var ERangeType; +(function (ERangeType) { + ERangeType[ERangeType["Default"] = 0] = "Default"; + ERangeType[ERangeType["Partial"] = 1] = "Partial"; + ERangeType[ERangeType["Full"] = 2] = "Full"; +})(ERangeType || (exports.ERangeType = ERangeType = {})); +var EVideoFormat; +(function (EVideoFormat) { + EVideoFormat[EVideoFormat["None"] = 0] = "None"; + EVideoFormat[EVideoFormat["I420"] = 1] = "I420"; + EVideoFormat[EVideoFormat["NV12"] = 2] = "NV12"; + EVideoFormat[EVideoFormat["YVYU"] = 3] = "YVYU"; + EVideoFormat[EVideoFormat["YUY2"] = 4] = "YUY2"; + EVideoFormat[EVideoFormat["UYVY"] = 5] = "UYVY"; + EVideoFormat[EVideoFormat["RGBA"] = 6] = "RGBA"; + EVideoFormat[EVideoFormat["BGRA"] = 7] = "BGRA"; + EVideoFormat[EVideoFormat["BGRX"] = 8] = "BGRX"; + EVideoFormat[EVideoFormat["Y800"] = 9] = "Y800"; + EVideoFormat[EVideoFormat["I444"] = 10] = "I444"; + EVideoFormat[EVideoFormat["BGR3"] = 11] = "BGR3"; + EVideoFormat[EVideoFormat["I422"] = 12] = "I422"; + EVideoFormat[EVideoFormat["I40A"] = 13] = "I40A"; + EVideoFormat[EVideoFormat["I42A"] = 14] = "I42A"; + EVideoFormat[EVideoFormat["YUVA"] = 15] = "YUVA"; + EVideoFormat[EVideoFormat["AYUV"] = 16] = "AYUV"; +})(EVideoFormat || (exports.EVideoFormat = EVideoFormat = {})); +var EBoundsType; +(function (EBoundsType) { + EBoundsType[EBoundsType["None"] = 0] = "None"; + EBoundsType[EBoundsType["Stretch"] = 1] = "Stretch"; + EBoundsType[EBoundsType["ScaleInner"] = 2] = "ScaleInner"; + EBoundsType[EBoundsType["ScaleOuter"] = 3] = "ScaleOuter"; + EBoundsType[EBoundsType["ScaleToWidth"] = 4] = "ScaleToWidth"; + EBoundsType[EBoundsType["ScaleToHeight"] = 5] = "ScaleToHeight"; + EBoundsType[EBoundsType["MaxOnly"] = 6] = "MaxOnly"; +})(EBoundsType || (exports.EBoundsType = EBoundsType = {})); +var EColorSpace; +(function (EColorSpace) { + EColorSpace[EColorSpace["Default"] = 0] = "Default"; + EColorSpace[EColorSpace["CS601"] = 1] = "CS601"; + EColorSpace[EColorSpace["CS709"] = 2] = "CS709"; + EColorSpace[EColorSpace["CSSRGB"] = 3] = "CSSRGB"; + EColorSpace[EColorSpace["CS2100PQ"] = 4] = "CS2100PQ"; + EColorSpace[EColorSpace["CS2100HLG"] = 5] = "CS2100HLG"; +})(EColorSpace || (exports.EColorSpace = EColorSpace = {})); +var ESpeakerLayout; +(function (ESpeakerLayout) { + ESpeakerLayout[ESpeakerLayout["Unknown"] = 0] = "Unknown"; + ESpeakerLayout[ESpeakerLayout["Mono"] = 1] = "Mono"; + ESpeakerLayout[ESpeakerLayout["Stereo"] = 2] = "Stereo"; + ESpeakerLayout[ESpeakerLayout["TwoOne"] = 3] = "TwoOne"; + ESpeakerLayout[ESpeakerLayout["Four"] = 4] = "Four"; + ESpeakerLayout[ESpeakerLayout["FourOne"] = 5] = "FourOne"; + ESpeakerLayout[ESpeakerLayout["FiveOne"] = 6] = "FiveOne"; + ESpeakerLayout[ESpeakerLayout["SevenOne"] = 8] = "SevenOne"; +})(ESpeakerLayout || (exports.ESpeakerLayout = ESpeakerLayout = {})); +var EOutputCode; +(function (EOutputCode) { + EOutputCode[EOutputCode["Success"] = 0] = "Success"; + EOutputCode[EOutputCode["BadPath"] = -1] = "BadPath"; + EOutputCode[EOutputCode["ConnectFailed"] = -2] = "ConnectFailed"; + EOutputCode[EOutputCode["InvalidStream"] = -3] = "InvalidStream"; + EOutputCode[EOutputCode["Error"] = -4] = "Error"; + EOutputCode[EOutputCode["Disconnected"] = -5] = "Disconnected"; + EOutputCode[EOutputCode["Unsupported"] = -6] = "Unsupported"; + EOutputCode[EOutputCode["NoSpace"] = -7] = "NoSpace"; + EOutputCode[EOutputCode["EncoderError"] = -8] = "EncoderError"; + EOutputCode[EOutputCode["OutdatedDriver"] = -65] = "OutdatedDriver"; +})(EOutputCode || (exports.EOutputCode = EOutputCode = {})); +var ECategoryTypes; +(function (ECategoryTypes) { + ECategoryTypes[ECategoryTypes["NODEOBS_CATEGORY_LIST"] = 0] = "NODEOBS_CATEGORY_LIST"; + ECategoryTypes[ECategoryTypes["NODEOBS_CATEGORY_TAB"] = 1] = "NODEOBS_CATEGORY_TAB"; +})(ECategoryTypes || (exports.ECategoryTypes = ECategoryTypes = {})); +var ERenderingMode; +(function (ERenderingMode) { + ERenderingMode[ERenderingMode["OBS_MAIN_RENDERING"] = 0] = "OBS_MAIN_RENDERING"; + ERenderingMode[ERenderingMode["OBS_STREAMING_RENDERING"] = 1] = "OBS_STREAMING_RENDERING"; + ERenderingMode[ERenderingMode["OBS_RECORDING_RENDERING"] = 2] = "OBS_RECORDING_RENDERING"; +})(ERenderingMode || (exports.ERenderingMode = ERenderingMode = {})); +var EIPCError; +(function (EIPCError) { + EIPCError[EIPCError["STILL_RUNNING"] = 259] = "STILL_RUNNING"; + EIPCError[EIPCError["VERSION_MISMATCH"] = 252] = "VERSION_MISMATCH"; + EIPCError[EIPCError["OTHER_ERROR"] = 253] = "OTHER_ERROR"; + EIPCError[EIPCError["MISSING_DEPENDENCY"] = 254] = "MISSING_DEPENDENCY"; + EIPCError[EIPCError["NORMAL_EXIT"] = 0] = "NORMAL_EXIT"; +})(EIPCError || (exports.EIPCError = EIPCError = {})); +var EVcamInstalledStatus; +(function (EVcamInstalledStatus) { + EVcamInstalledStatus[EVcamInstalledStatus["NotInstalled"] = 0] = "NotInstalled"; + EVcamInstalledStatus[EVcamInstalledStatus["LegacyInstalled"] = 1] = "LegacyInstalled"; + EVcamInstalledStatus[EVcamInstalledStatus["Installed"] = 2] = "Installed"; +})(EVcamInstalledStatus || (exports.EVcamInstalledStatus = EVcamInstalledStatus = {})); +var ERecSplitType; +(function (ERecSplitType) { + ERecSplitType[ERecSplitType["Time"] = 0] = "Time"; + ERecSplitType[ERecSplitType["Size"] = 1] = "Size"; + ERecSplitType[ERecSplitType["Manual"] = 2] = "Manual"; +})(ERecSplitType || (exports.ERecSplitType = ERecSplitType = {})); exports.Global = obs.Global; exports.Video = obs.Video; exports.VideoFactory = obs.Video; @@ -46,7 +367,29 @@ exports.AdvancedRecordingFactory = obs.AdvancedRecording; exports.AudioEncoderFactory = obs.AudioEncoder; exports.SimpleReplayBufferFactory = obs.SimpleReplayBuffer; exports.AdvancedReplayBufferFactory = obs.AdvancedReplayBuffer; +var EInteractionFlags; +(function (EInteractionFlags) { + EInteractionFlags[EInteractionFlags["None"] = 0] = "None"; + EInteractionFlags[EInteractionFlags["CapsKey"] = 1] = "CapsKey"; + EInteractionFlags[EInteractionFlags["ShiftKey"] = 2] = "ShiftKey"; + EInteractionFlags[EInteractionFlags["ControlKey"] = 4] = "ControlKey"; + EInteractionFlags[EInteractionFlags["AltKey"] = 8] = "AltKey"; + EInteractionFlags[EInteractionFlags["MouseLeft"] = 16] = "MouseLeft"; + EInteractionFlags[EInteractionFlags["MouseMiddle"] = 32] = "MouseMiddle"; + EInteractionFlags[EInteractionFlags["MouseRight"] = 64] = "MouseRight"; + EInteractionFlags[EInteractionFlags["CommandKey"] = 128] = "CommandKey"; + EInteractionFlags[EInteractionFlags["Numlock_Key"] = 256] = "Numlock_Key"; + EInteractionFlags[EInteractionFlags["IsKeyPad"] = 512] = "IsKeyPad"; + EInteractionFlags[EInteractionFlags["IsLeft"] = 1024] = "IsLeft"; + EInteractionFlags[EInteractionFlags["IsRight"] = 2048] = "IsRight"; +})(EInteractionFlags || (exports.EInteractionFlags = EInteractionFlags = {})); ; +var EMouseButtonType; +(function (EMouseButtonType) { + EMouseButtonType[EMouseButtonType["Left"] = 0] = "Left"; + EMouseButtonType[EMouseButtonType["Middle"] = 1] = "Middle"; + EMouseButtonType[EMouseButtonType["Right"] = 2] = "Right"; +})(EMouseButtonType || (exports.EMouseButtonType = EMouseButtonType = {})); ; ; ; @@ -122,6 +465,43 @@ function getSourcesSize(sourcesNames) { } return sourcesSize; } +var ERecordingFormat; +(function (ERecordingFormat) { + ERecordingFormat["MP4"] = "mp4"; + ERecordingFormat["FLV"] = "flv"; + ERecordingFormat["MOV"] = "mov"; + ERecordingFormat["MKV"] = "mkv"; + ERecordingFormat["MPEGTS"] = "ts"; + ERecordingFormat["HLS"] = "m3u8"; +})(ERecordingFormat || (exports.ERecordingFormat = ERecordingFormat = {})); +var ERecordingQuality; +(function (ERecordingQuality) { + ERecordingQuality[ERecordingQuality["Stream"] = 0] = "Stream"; + ERecordingQuality[ERecordingQuality["HighQuality"] = 1] = "HighQuality"; + ERecordingQuality[ERecordingQuality["HigherQuality"] = 2] = "HigherQuality"; + ERecordingQuality[ERecordingQuality["Lossless"] = 3] = "Lossless"; +})(ERecordingQuality || (exports.ERecordingQuality = ERecordingQuality = {})); +var EVideoEncoderType; +(function (EVideoEncoderType) { + EVideoEncoderType[EVideoEncoderType["Audio"] = 0] = "Audio"; + EVideoEncoderType[EVideoEncoderType["Video"] = 1] = "Video"; +})(EVideoEncoderType || (exports.EVideoEncoderType = EVideoEncoderType = {})); +var EProcessPriority; +(function (EProcessPriority) { + EProcessPriority["High"] = "High"; + EProcessPriority["AboveNormal"] = "AboveNormal"; + EProcessPriority["Normal"] = "Normal"; + EProcessPriority["BelowNormal"] = "BelowNormal"; + EProcessPriority["Idle"] = "Idle"; +})(EProcessPriority || (exports.EProcessPriority = EProcessPriority = {})); +var VCamOutputType; +(function (VCamOutputType) { + VCamOutputType[VCamOutputType["Invalid"] = 0] = "Invalid"; + VCamOutputType[VCamOutputType["SceneOutput"] = 1] = "SceneOutput"; + VCamOutputType[VCamOutputType["SourceOutput"] = 2] = "SourceOutput"; + VCamOutputType[VCamOutputType["ProgramView"] = 3] = "ProgramView"; + VCamOutputType[VCamOutputType["PreviewOutput"] = 4] = "PreviewOutput"; +})(VCamOutputType || (exports.VCamOutputType = VCamOutputType = {})); ; const appleBinaryFolder = hasDeveloperApp ? path.join(__dirname, 'OSN.app', 'distribute', 'obs-studio-node', 'bin') diff --git a/js/module.ts b/js/module.ts index a1ec21878..6f681c963 100644 --- a/js/module.ts +++ b/js/module.ts @@ -34,30 +34,30 @@ export const DefaultPluginPathMac: string = /** * To be passed to Input.flags */ -export const enum ESourceFlags { +export enum ESourceFlags { Unbuffered = (1 << 0), ForceMono = (1 << 1) } -export const enum EMonitoringType { +export enum EMonitoringType { None, MonitoringOnly, MonitoringAndOutput } -export const enum EOrderMovement { +export enum EOrderMovement { Up, Down, Top, Bottom } -export const enum EDeinterlaceFieldOrder { +export enum EDeinterlaceFieldOrder { Top, Bottom } -export const enum EVideoCodes { +export enum EVideoCodes { Success = 0, Fail = -1, NotSupported = -2, @@ -66,7 +66,7 @@ export const enum EVideoCodes { ModuleNotFound = -5 } -export const enum EHotkeyObjectType { +export enum EHotkeyObjectType { Frontend = 0, Source = 1, Output = 2, @@ -74,7 +74,7 @@ export const enum EHotkeyObjectType { Service = 4 } -export const enum EDeinterlaceMode { +export enum EDeinterlaceMode { Disable, Discard, Retro, @@ -86,12 +86,12 @@ export const enum EDeinterlaceMode { Yadif2X } -export const enum EBlendingMethod { +export enum EBlendingMethod { Default, SrgbOff } -export const enum EBlendingMode { +export enum EBlendingMode { Normal, Additive, Substract, @@ -101,7 +101,7 @@ export const enum EBlendingMode { Darken } -export const enum EFontStyle { +export enum EFontStyle { Bold = (1<<0), Italic = (1<<1), Underline = (1<<2), @@ -111,7 +111,7 @@ export const enum EFontStyle { /** * Enumeration describing the type of a property */ -export const enum EPropertyType { +export enum EPropertyType { Invalid, Boolean, Int, @@ -129,39 +129,39 @@ export const enum EPropertyType { Capture, } -export const enum EListFormat { +export enum EListFormat { Invalid, Int, Float, String } -export const enum EEditableListType { +export enum EEditableListType { Strings, Files, FilesAndUrls } -export const enum EPathType { +export enum EPathType { File, FileSave, Directory } -export const enum ETextType { +export enum ETextType { Default, Password, Multiline, TextInfo } -export const enum ETextInfoType { +export enum ETextInfoType { Normal, Warning, Error, } -export const enum ENumberType { +export enum ENumberType { Scroller, Slider } @@ -169,7 +169,7 @@ export const enum ENumberType { /** * A binary flag representing alignment */ -export const enum EAlignment { +export enum EAlignment { Center = 0, Left = (1 << 0), Right = (1 << 1), @@ -185,7 +185,7 @@ export const enum EAlignment { * A binary flag representing output capabilities * Apparently you can't fetch these for now (???) */ -export const enum EOutputFlags { +export enum EOutputFlags { Video = (1<<0), Audio = (1<<1), AV = (Video | Audio), @@ -197,7 +197,7 @@ export const enum EOutputFlags { /** * A binary flag representing source output capabilities */ -export const enum ESourceOutputFlags { +export enum ESourceOutputFlags { Video = (1 << 0), Audio = (1 << 1), Async = (1 << 2), @@ -212,7 +212,7 @@ export const enum ESourceOutputFlags { ForceUiRefresh = (1 << 30), } -export const enum ESceneDupType { +export enum ESceneDupType { Refs, Copy, PrivateRefs, @@ -222,7 +222,7 @@ export const enum ESceneDupType { /** * Describes the type of source */ -export const enum ESourceType { +export enum ESourceType { Input, Filter, Transition, @@ -232,13 +232,13 @@ export const enum ESourceType { /** * Describes algorithm type to use for volume representation. */ -export const enum EFaderType { +export enum EFaderType { Cubic, IEC /* IEC 60-268-18 */, Log /* Logarithmic */ } -export const enum EColorFormat { +export enum EColorFormat { Unknown, A8, R8, @@ -259,7 +259,7 @@ export const enum EColorFormat { DXT5 } -export const enum EScaleType { +export enum EScaleType { Disable, Point, Bicubic, @@ -268,19 +268,19 @@ export const enum EScaleType { Area } -export const enum EFPSType { +export enum EFPSType { Common, Integer, Fractional } -export const enum ERangeType { +export enum ERangeType { Default, Partial, Full } -export const enum EVideoFormat { +export enum EVideoFormat { None, I420, NV12, @@ -300,7 +300,7 @@ export const enum EVideoFormat { AYUV } -export const enum EBoundsType { +export enum EBoundsType { None, Stretch, ScaleInner, @@ -310,7 +310,7 @@ export const enum EBoundsType { MaxOnly } -export const enum EColorSpace { +export enum EColorSpace { Default, CS601, CS709, @@ -319,7 +319,7 @@ export const enum EColorSpace { CS2100HLG } -export const enum ESpeakerLayout { +export enum ESpeakerLayout { Unknown, Mono, Stereo, @@ -330,7 +330,7 @@ export const enum ESpeakerLayout { SevenOne = 8 } -export const enum EOutputCode { +export enum EOutputCode { Success = 0, BadPath = -1, ConnectFailed = -2, @@ -343,18 +343,18 @@ export const enum EOutputCode { OutdatedDriver = -65, } -export const enum ECategoryTypes { +export enum ECategoryTypes { NODEOBS_CATEGORY_LIST = 0, NODEOBS_CATEGORY_TAB = 1 } -export const enum ERenderingMode { +export enum ERenderingMode { OBS_MAIN_RENDERING = 0, OBS_STREAMING_RENDERING = 1, OBS_RECORDING_RENDERING = 2 } -export const enum EIPCError { +export enum EIPCError { STILL_RUNNING = 259, VERSION_MISMATCH = 252, OTHER_ERROR = 253, @@ -362,13 +362,13 @@ export const enum EIPCError { NORMAL_EXIT = 0, } -export const enum EVcamInstalledStatus { +export enum EVcamInstalledStatus { NotInstalled = 0, LegacyInstalled = 1, Installed = 2 } -export const enum ERecSplitType { +export enum ERecSplitType { Time = 0, Size = 1, Manual = 2 @@ -805,7 +805,7 @@ export interface IInputFactory extends IFactoryTypes { } -export const enum EInteractionFlags { +export enum EInteractionFlags { None = 0, CapsKey = 1, ShiftKey = 1 << 1, @@ -821,7 +821,7 @@ export const enum EInteractionFlags { IsRight = 1 << 11 }; -export const enum EMouseButtonType { +export enum EMouseButtonType { Left, Middle, Right @@ -1650,7 +1650,7 @@ export interface IService { update(settings: ISettings): void; } -export const enum ERecordingFormat { +export enum ERecordingFormat { MP4 = 'mp4', FLV = 'flv', MOV = 'mov', @@ -1659,19 +1659,19 @@ export const enum ERecordingFormat { HLS = 'm3u8' } -export const enum ERecordingQuality { +export enum ERecordingQuality { Stream, HighQuality, HigherQuality, Lossless } -export const enum EVideoEncoderType { +export enum EVideoEncoderType { Audio, Video } -export const enum EProcessPriority { +export enum EProcessPriority { High = 'High', AboveNormal = 'AboveNormal', Normal = 'Normal', @@ -1921,7 +1921,7 @@ export interface IAudioTrackFactory { saveLegacySettings(): void; } -export const enum VCamOutputType { +export enum VCamOutputType { Invalid, SceneOutput, SourceOutput, diff --git a/js/type_check.js b/js/type_check.js index b38ce4473..2c6de9ab7 100644 --- a/js/type_check.js +++ b/js/type_check.js @@ -11,44 +11,45 @@ exports.isColorProperty = isColorProperty; exports.isCaptureProperty = isCaptureProperty; exports.isFontProperty = isFontProperty; exports.isEmptyProperty = isEmptyProperty; +const obs = require("./module"); function isNumberProperty(property) { - return property.type === 2 || - property.type === 3; + return property.type === obs.EPropertyType.Int || + property.type === obs.EPropertyType.Float; } function isTextProperty(property) { - return property.type === 4; + return property.type === obs.EPropertyType.Text; } function isPathProperty(property) { - return property.type === 5; + return property.type === obs.EPropertyType.Path; } function isListProperty(property) { - return property.type === 6; + return property.type === obs.EPropertyType.List; } function isEditableListProperty(property) { - return property.type === 10; + return property.type === obs.EPropertyType.EditableList; } function isBooleanProperty(property) { - return property.type === 1; + return property.type === obs.EPropertyType.Boolean; } function isButtonProperty(property) { - return property.type === 8; + return property.type === obs.EPropertyType.Button; } function isColorProperty(property) { - return property.type === 7; + return property.type === obs.EPropertyType.Color; } function isCaptureProperty(property) { - return property.type === 14; + return property.type === obs.EPropertyType.Capture; } function isFontProperty(property) { - return property.type === 9; + return property.type === obs.EPropertyType.Font; } function isEmptyProperty(property) { switch (property.type) { - case 1: - case 8: - case 7: - case 9: - case 0: + case obs.EPropertyType.Boolean: + case obs.EPropertyType.Button: + case obs.EPropertyType.Color: + case obs.EPropertyType.Font: + case obs.EPropertyType.Invalid: return true; } return false; From bcbd8b6541db5b87bc6c9245e589128a4f240636 Mon Sep 17 00:00:00 2001 From: Vladimir Sumarov Date: Mon, 1 Jun 2026 16:50:05 -0700 Subject: [PATCH 7/8] address PR review feedback on generated JS surface MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI: make ci/check-js-generated.sh fail-fast (set -euo pipefail) so a failing git invocation can no longer leave `dirty` empty and pass silently; drop the no-op `set +x`. module.ts typing accuracy (verified against obs-studio-client/source): - IProperty.next()/previous() and IProperties.first()/last()/get() return undefined at end-of-list / empty / not-found, so type them `IProperty | undefined`; fix the stale next() JSDoc and get() "null". - Move sendMessage() from ISource to IInput — only Input registers it natively (input.cpp); Filter/Scene/Transition do not. - Hoist load() to the ISource base (registered on Input/Filter/Scene/ Transition) and drop the per-interface duplicates; IFilter now gets it. - IModuleFactory.modules() returns primitive strings -> string[]. - IModule.initialize() returns a boolean natively, not void. Remove stray trailing `;` after enum/interface blocks so the generated module.js no longer emits empty statements. Co-Authored-By: Claude Opus 4.8 (1M context) --- ci/check-js-generated.sh | 3 +- js/module.d.ts | 20 ++++++-------- js/module.js | 5 ---- js/module.ts | 59 +++++++++++++++------------------------- 4 files changed, 33 insertions(+), 54 deletions(-) diff --git a/ci/check-js-generated.sh b/ci/check-js-generated.sh index 74a386c00..ef5732724 100755 --- a/ci/check-js-generated.sh +++ b/ci/check-js-generated.sh @@ -2,9 +2,10 @@ # Verify that the committed tsc outputs under js/ match what regenerating # from js/module.ts would produce. CI runs `yarn build:javascript` first, # so any change under js/ at this point is a stale generated file. +set -euo pipefail + dirty=$(git status --porcelain -- js/) -set +x if [[ $dirty ]]; then echo "=================================================" echo "Generated JS files are stale. Run locally:" diff --git a/js/module.d.ts b/js/module.d.ts index 63fe8b2f5..b5218a784 100644 --- a/js/module.d.ts +++ b/js/module.d.ts @@ -426,17 +426,17 @@ export interface IProperty { readonly visible: boolean; readonly type: EPropertyType; readonly value: any; - next(): IProperty; - previous(): IProperty; + next(): IProperty | undefined; + previous(): IProperty | undefined; is_first(): boolean; is_last(): boolean; modified(): boolean; } export interface IProperties { - first(): IProperty; - last(): IProperty; + first(): IProperty | undefined; + last(): IProperty | undefined; count(): number; - get(name: string): IProperty; + get(name: string): IProperty | undefined; } export interface IFactoryTypes { types(): string[]; @@ -531,7 +531,7 @@ export interface IInput extends ISource { restart(): void; stop(): void; getMediaState(): number; - load(): void; + sendMessage(message: ISettings): void; } export interface ISceneFactory { create(name: string): IScene; @@ -548,7 +548,6 @@ export interface IScene extends ISource { getItemAtIdx(idx: number): ISceneItem; getItems(): ISceneItem[]; getItemsInRange(fromIndex: number, toIndex: number): ISceneItem[]; - load(): void; sendMouseClick(eventData: IMouseEvent, type: EMouseButtonType, mouseUp: boolean, clickCount: number): void; sendMouseMove(eventData: IMouseEvent, mouseLeave: boolean): void; sendMouseWheel(eventData: IMouseEvent, x_delta: number, y_delta: number): void; @@ -595,7 +594,6 @@ export interface ITransition extends ISource { clear(): void; set(input: ISource): void; start(ms: number, input: ISource): void; - load(): void; sendMouseClick(eventData: IMouseEvent, type: EMouseButtonType, mouseUp: boolean, clickCount: number): void; sendMouseMove(eventData: IMouseEvent, mouseLeave: boolean): void; sendMouseWheel(eventData: IMouseEvent, x_delta: number, y_delta: number): void; @@ -611,7 +609,7 @@ export interface IConfigurable { export interface ISource extends IConfigurable, IReleasable { remove(): void; save(): void; - sendMessage(message: ISettings): void; + load(): void; readonly status: number; readonly type: ESourceType; readonly id: string; @@ -686,10 +684,10 @@ export interface IAudioFactory { } export interface IModuleFactory { open(binPath: string, dataPath: string): IModule; - modules(): String[]; + modules(): string[]; } export interface IModule { - initialize(): void; + initialize(): boolean; readonly fileName: string; readonly name: string; readonly author: string; diff --git a/js/module.js b/js/module.js index 3b7dc5122..b8f9112c9 100644 --- a/js/module.js +++ b/js/module.js @@ -383,16 +383,12 @@ var EInteractionFlags; EInteractionFlags[EInteractionFlags["IsLeft"] = 1024] = "IsLeft"; EInteractionFlags[EInteractionFlags["IsRight"] = 2048] = "IsRight"; })(EInteractionFlags || (exports.EInteractionFlags = EInteractionFlags = {})); -; var EMouseButtonType; (function (EMouseButtonType) { EMouseButtonType[EMouseButtonType["Left"] = 0] = "Left"; EMouseButtonType[EMouseButtonType["Middle"] = 1] = "Middle"; EMouseButtonType[EMouseButtonType["Right"] = 2] = "Right"; })(EMouseButtonType || (exports.EMouseButtonType = EMouseButtonType = {})); -; -; -; function addItems(scene, sceneItems) { const items = []; if (Array.isArray(sceneItems)) { @@ -502,7 +498,6 @@ var VCamOutputType; VCamOutputType[VCamOutputType["ProgramView"] = 3] = "ProgramView"; VCamOutputType[VCamOutputType["PreviewOutput"] = 4] = "PreviewOutput"; })(VCamOutputType || (exports.VCamOutputType = VCamOutputType = {})); -; const appleBinaryFolder = hasDeveloperApp ? path.join(__dirname, 'OSN.app', 'distribute', 'obs-studio-node', 'bin') : path.join(__dirname, 'bin'); diff --git a/js/module.ts b/js/module.ts index 6f681c963..33dc15dfd 100644 --- a/js/module.ts +++ b/js/module.ts @@ -697,19 +697,16 @@ export interface IProperty { readonly value: any; /** - * Uses the current object to obtain the next - * property in the properties list. - * - * @returns If it's successful, returns true. - * Otherwise or if end of the list, returns false. + * Uses the current object to obtain the next property in the list. + * @returns The next property, or undefined at the end of the list. */ - next(): IProperty; + next(): IProperty | undefined; /** * Uses the current object to obtain the previous property in the list. - * Returns undefined when the current property is the first. + * @returns The previous property, or undefined when the current property is the first. */ - previous(): IProperty; + previous(): IProperty | undefined; /** True when this property is the first in the list. */ is_first(): boolean; @@ -728,20 +725,20 @@ export interface IProperty { */ export interface IProperties { - /** Obtains the first property in the list. */ - first(): IProperty; + /** Obtains the first property in the list, or undefined when the list is empty. */ + first(): IProperty | undefined; - /** Obtains the last property in the list. */ - last(): IProperty; + /** Obtains the last property in the list, or undefined when the list is empty. */ + last(): IProperty | undefined; count(): number; /** * Obtains property matching name. * @param name The name of the property to fetch. - * @returns - The property instance or null if not found + * @returns - The property instance, or undefined if not found */ - get(name: string): IProperty; + get(name: string): IProperty | undefined; } export interface IFactoryTypes { @@ -819,19 +816,19 @@ export enum EInteractionFlags { IsKeyPad = 1 << 9, IsLeft = 1 << 10, IsRight = 1 << 11 -}; +} export enum EMouseButtonType { Left, Middle, Right -}; +} export interface IMouseEvent { modifiers: EInteractionFlags; x: number; y: number; -}; +} export interface IKeyEvent { modifiers: EInteractionFlags; @@ -839,7 +836,7 @@ export interface IKeyEvent { nativeModifiers: number; nativeScancode: number; nativeVkey: number; -}; +} export interface ISceneItemInfo { name: string, @@ -976,9 +973,9 @@ export interface IInput extends ISource { getMediaState(): number; /** - * Re-trigger the source's load step (re-reads serialized state on the server). + * Forward a serializable message to the underlying source plugin. */ - load(): void; + sendMessage(message: ISettings): void; } export interface ISceneFactory { @@ -1074,11 +1071,6 @@ export interface IScene extends ISource { */ getItemsInRange(fromIndex: number, toIndex: number): ISceneItem[]; - /** - * Re-trigger the scene's load step on the server. - */ - load(): void; - sendMouseClick(eventData: IMouseEvent, type: EMouseButtonType, mouseUp: boolean, clickCount: number): void; sendMouseMove(eventData: IMouseEvent, mouseLeave: boolean): void; sendMouseWheel(eventData: IMouseEvent, x_delta: number, y_delta: number): void; @@ -1241,11 +1233,6 @@ export interface ITransition extends ISource { */ start(ms: number, input: ISource): void; - /** - * Re-trigger the transition's load step on the server. - */ - load(): void; - sendMouseClick(eventData: IMouseEvent, type: EMouseButtonType, mouseUp: boolean, clickCount: number): void; sendMouseMove(eventData: IMouseEvent, mouseLeave: boolean): void; sendMouseWheel(eventData: IMouseEvent, x_delta: number, y_delta: number): void; @@ -1295,11 +1282,9 @@ export interface ISource extends IConfigurable, IReleasable { save(): void; /** - * Forward a serializable message to the underlying source plugin. - * Note: only registered on input sources on the native side; calling on - * a filter, scene, or transition will throw at runtime. + * Re-trigger the source's load step on the server. */ - sendMessage(message: ISettings): void; + load(): void; /** * The validity of the source @@ -1498,11 +1483,11 @@ export interface IAudioFactory { export interface IModuleFactory { open(binPath: string, dataPath: string): IModule; - modules(): String[]; + modules(): string[]; } export interface IModule { - initialize(): void; + initialize(): boolean; readonly fileName: string; readonly name: string; readonly author: string; @@ -1927,7 +1912,7 @@ export enum VCamOutputType { SourceOutput, ProgramView, PreviewOutput, -}; +} // Initialization and other stuff which needs local data. const appleBinaryFolder = hasDeveloperApp From d09f50908be036632995106de9d4d73bd2e74833 Mon Sep 17 00:00:00 2001 From: Vladimir Sumarov Date: Mon, 1 Jun 2026 17:23:15 -0700 Subject: [PATCH 8/8] revert const enum -> regular enum conversion Restores `const enum` for all exported enums. The regular-enum conversion (folded in from #1430) made the enum runtime objects live in module.js, which broke the desktop webpack build: ~11 desktop files import enum values directly from 'obs-studio-node' and relied on const-enum inlining to keep them type-only. As regular enums those imports became runtime value imports, pulling obs-studio-node/module.js (and its native obs_studio_client.node require) into the renderer bundle, which has no node-loader and does not externalize osn. desktop never bundles osn (it loads it at runtime via window.require), so #1430's "bundlers can't inline const enums" rationale does not apply to the primary consumer. Keeping const enums. The js/ build pipeline, generated-file CI check, API-drift fixes, and the typing-accuracy fixes from PR review are unaffected and retained. Co-Authored-By: Claude Opus 4.8 (1M context) --- js/module.d.ts | 88 +++++------ js/module.js | 382 +---------------------------------------------- js/module.ts | 88 +++++------ js/type_check.js | 33 ++-- 4 files changed, 105 insertions(+), 486 deletions(-) diff --git a/js/module.d.ts b/js/module.d.ts index b5218a784..1942b9fc8 100644 --- a/js/module.d.ts +++ b/js/module.d.ts @@ -6,26 +6,26 @@ export declare const DefaultDataPath: string; export declare const DefaultPluginPath: string; export declare const DefaultPluginDataPath: string; export declare const DefaultPluginPathMac: string; -export declare enum ESourceFlags { +export declare const enum ESourceFlags { Unbuffered = 1, ForceMono = 2 } -export declare enum EMonitoringType { +export declare const enum EMonitoringType { None = 0, MonitoringOnly = 1, MonitoringAndOutput = 2 } -export declare enum EOrderMovement { +export declare const enum EOrderMovement { Up = 0, Down = 1, Top = 2, Bottom = 3 } -export declare enum EDeinterlaceFieldOrder { +export declare const enum EDeinterlaceFieldOrder { Top = 0, Bottom = 1 } -export declare enum EVideoCodes { +export declare const enum EVideoCodes { Success = 0, Fail = -1, NotSupported = -2, @@ -33,14 +33,14 @@ export declare enum EVideoCodes { CurrentlyActive = -4, ModuleNotFound = -5 } -export declare enum EHotkeyObjectType { +export declare const enum EHotkeyObjectType { Frontend = 0, Source = 1, Output = 2, Encoder = 3, Service = 4 } -export declare enum EDeinterlaceMode { +export declare const enum EDeinterlaceMode { Disable = 0, Discard = 1, Retro = 2, @@ -51,11 +51,11 @@ export declare enum EDeinterlaceMode { Yadif = 7, Yadif2X = 8 } -export declare enum EBlendingMethod { +export declare const enum EBlendingMethod { Default = 0, SrgbOff = 1 } -export declare enum EBlendingMode { +export declare const enum EBlendingMode { Normal = 0, Additive = 1, Substract = 2, @@ -64,13 +64,13 @@ export declare enum EBlendingMode { Lighten = 5, Darken = 6 } -export declare enum EFontStyle { +export declare const enum EFontStyle { Bold = 1, Italic = 2, Underline = 4, Strikeout = 8 } -export declare enum EPropertyType { +export declare const enum EPropertyType { Invalid = 0, Boolean = 1, Int = 2, @@ -87,38 +87,38 @@ export declare enum EPropertyType { ColorAlpha = 13, Capture = 14 } -export declare enum EListFormat { +export declare const enum EListFormat { Invalid = 0, Int = 1, Float = 2, String = 3 } -export declare enum EEditableListType { +export declare const enum EEditableListType { Strings = 0, Files = 1, FilesAndUrls = 2 } -export declare enum EPathType { +export declare const enum EPathType { File = 0, FileSave = 1, Directory = 2 } -export declare enum ETextType { +export declare const enum ETextType { Default = 0, Password = 1, Multiline = 2, TextInfo = 3 } -export declare enum ETextInfoType { +export declare const enum ETextInfoType { Normal = 0, Warning = 1, Error = 2 } -export declare enum ENumberType { +export declare const enum ENumberType { Scroller = 0, Slider = 1 } -export declare enum EAlignment { +export declare const enum EAlignment { Center = 0, Left = 1, Right = 2, @@ -129,7 +129,7 @@ export declare enum EAlignment { BottomLeft = 9, BottomRight = 10 } -export declare enum EOutputFlags { +export declare const enum EOutputFlags { Video = 1, Audio = 2, AV = 3, @@ -137,7 +137,7 @@ export declare enum EOutputFlags { Service = 8, MultiTrack = 16 } -export declare enum ESourceOutputFlags { +export declare const enum ESourceOutputFlags { Video = 1, Audio = 2, Async = 4, @@ -150,24 +150,24 @@ export declare enum ESourceOutputFlags { DoNotSelfMonitor = 512, ForceUiRefresh = 1073741824 } -export declare enum ESceneDupType { +export declare const enum ESceneDupType { Refs = 0, Copy = 1, PrivateRefs = 2, PrivateCopy = 3 } -export declare enum ESourceType { +export declare const enum ESourceType { Input = 0, Filter = 1, Transition = 2, Scene = 3 } -export declare enum EFaderType { +export declare const enum EFaderType { Cubic = 0, IEC = 1, Log = 2 } -export declare enum EColorFormat { +export declare const enum EColorFormat { Unknown = 0, A8 = 1, R8 = 2, @@ -187,7 +187,7 @@ export declare enum EColorFormat { DXT3 = 16, DXT5 = 17 } -export declare enum EScaleType { +export declare const enum EScaleType { Disable = 0, Point = 1, Bicubic = 2, @@ -195,17 +195,17 @@ export declare enum EScaleType { Lanczos = 4, Area = 5 } -export declare enum EFPSType { +export declare const enum EFPSType { Common = 0, Integer = 1, Fractional = 2 } -export declare enum ERangeType { +export declare const enum ERangeType { Default = 0, Partial = 1, Full = 2 } -export declare enum EVideoFormat { +export declare const enum EVideoFormat { None = 0, I420 = 1, NV12 = 2, @@ -224,7 +224,7 @@ export declare enum EVideoFormat { YUVA = 15, AYUV = 16 } -export declare enum EBoundsType { +export declare const enum EBoundsType { None = 0, Stretch = 1, ScaleInner = 2, @@ -233,7 +233,7 @@ export declare enum EBoundsType { ScaleToHeight = 5, MaxOnly = 6 } -export declare enum EColorSpace { +export declare const enum EColorSpace { Default = 0, CS601 = 1, CS709 = 2, @@ -241,7 +241,7 @@ export declare enum EColorSpace { CS2100PQ = 4, CS2100HLG = 5 } -export declare enum ESpeakerLayout { +export declare const enum ESpeakerLayout { Unknown = 0, Mono = 1, Stereo = 2, @@ -251,7 +251,7 @@ export declare enum ESpeakerLayout { FiveOne = 6, SevenOne = 8 } -export declare enum EOutputCode { +export declare const enum EOutputCode { Success = 0, BadPath = -1, ConnectFailed = -2, @@ -263,28 +263,28 @@ export declare enum EOutputCode { EncoderError = -8, OutdatedDriver = -65 } -export declare enum ECategoryTypes { +export declare const enum ECategoryTypes { NODEOBS_CATEGORY_LIST = 0, NODEOBS_CATEGORY_TAB = 1 } -export declare enum ERenderingMode { +export declare const enum ERenderingMode { OBS_MAIN_RENDERING = 0, OBS_STREAMING_RENDERING = 1, OBS_RECORDING_RENDERING = 2 } -export declare enum EIPCError { +export declare const enum EIPCError { STILL_RUNNING = 259, VERSION_MISMATCH = 252, OTHER_ERROR = 253, MISSING_DEPENDENCY = 254, NORMAL_EXIT = 0 } -export declare enum EVcamInstalledStatus { +export declare const enum EVcamInstalledStatus { NotInstalled = 0, LegacyInstalled = 1, Installed = 2 } -export declare enum ERecSplitType { +export declare const enum ERecSplitType { Time = 0, Size = 1, Manual = 2 @@ -455,7 +455,7 @@ export interface IInputFactory extends IFactoryTypes { fromName(name: string): IInput; getPublicSources(): IInput[]; } -export declare enum EInteractionFlags { +export declare const enum EInteractionFlags { None = 0, CapsKey = 1, ShiftKey = 2, @@ -470,7 +470,7 @@ export declare enum EInteractionFlags { IsLeft = 1024, IsRight = 2048 } -export declare enum EMouseButtonType { +export declare const enum EMouseButtonType { Left = 0, Middle = 1, Right = 2 @@ -737,7 +737,7 @@ export interface IService { readonly settings: ISettings; update(settings: ISettings): void; } -export declare enum ERecordingFormat { +export declare const enum ERecordingFormat { MP4 = "mp4", FLV = "flv", MOV = "mov", @@ -745,17 +745,17 @@ export declare enum ERecordingFormat { MPEGTS = "ts", HLS = "m3u8" } -export declare enum ERecordingQuality { +export declare const enum ERecordingQuality { Stream = 0, HighQuality = 1, HigherQuality = 2, Lossless = 3 } -export declare enum EVideoEncoderType { +export declare const enum EVideoEncoderType { Audio = 0, Video = 1 } -export declare enum EProcessPriority { +export declare const enum EProcessPriority { High = "High", AboveNormal = "AboveNormal", Normal = "Normal", @@ -963,7 +963,7 @@ export interface IAudioTrackFactory { importLegacySettings(): void; saveLegacySettings(): void; } -export declare enum VCamOutputType { +export declare const enum VCamOutputType { Invalid = 0, SceneOutput = 1, SourceOutput = 2, diff --git a/js/module.js b/js/module.js index b8f9112c9..7e29569d6 100644 --- a/js/module.js +++ b/js/module.js @@ -1,7 +1,6 @@ "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); -exports.SceneFactory = exports.InputFactory = exports.VideoFactory = exports.Video = exports.Global = exports.ERecSplitType = exports.EVcamInstalledStatus = exports.EIPCError = exports.ERenderingMode = exports.ECategoryTypes = exports.EOutputCode = exports.ESpeakerLayout = exports.EColorSpace = exports.EBoundsType = exports.EVideoFormat = exports.ERangeType = exports.EFPSType = exports.EScaleType = exports.EColorFormat = exports.EFaderType = exports.ESourceType = exports.ESceneDupType = exports.ESourceOutputFlags = exports.EOutputFlags = exports.EAlignment = exports.ENumberType = exports.ETextInfoType = exports.ETextType = exports.EPathType = exports.EEditableListType = exports.EListFormat = exports.EPropertyType = exports.EFontStyle = exports.EBlendingMode = exports.EBlendingMethod = exports.EDeinterlaceMode = exports.EHotkeyObjectType = exports.EVideoCodes = exports.EDeinterlaceFieldOrder = exports.EOrderMovement = exports.EMonitoringType = exports.ESourceFlags = exports.DefaultPluginPathMac = exports.DefaultPluginDataPath = exports.DefaultPluginPath = exports.DefaultDataPath = exports.DefaultBinPath = exports.DefaultDrawPluginPath = exports.DefaultOpenGLPath = exports.DefaultD3D11Path = void 0; -exports.NodeObs = exports.VCamOutputType = exports.EProcessPriority = exports.EVideoEncoderType = exports.ERecordingQuality = exports.ERecordingFormat = exports.EMouseButtonType = exports.EInteractionFlags = exports.AdvancedReplayBufferFactory = exports.SimpleReplayBufferFactory = exports.AudioEncoderFactory = exports.AdvancedRecordingFactory = exports.SimpleRecordingFactory = exports.AudioTrackFactory = exports.NetworkFactory = exports.ReconnectFactory = exports.DelayFactory = exports.EnhancedBroadcastingSimpleStreamingFactory = exports.EnhancedBroadcastingAdvancedStreamingFactory = exports.AdvancedStreamingFactory = exports.SimpleStreamingFactory = exports.ServiceFactory = exports.VideoEncoderFactory = exports.IPC = exports.ModuleFactory = exports.AudioFactory = exports.Audio = exports.FaderFactory = exports.VolmeterFactory = exports.TransitionFactory = exports.FilterFactory = void 0; +exports.NodeObs = exports.AdvancedReplayBufferFactory = exports.SimpleReplayBufferFactory = exports.AudioEncoderFactory = exports.AdvancedRecordingFactory = exports.SimpleRecordingFactory = exports.AudioTrackFactory = exports.NetworkFactory = exports.ReconnectFactory = exports.DelayFactory = exports.EnhancedBroadcastingSimpleStreamingFactory = exports.EnhancedBroadcastingAdvancedStreamingFactory = exports.AdvancedStreamingFactory = exports.SimpleStreamingFactory = exports.ServiceFactory = exports.VideoEncoderFactory = exports.IPC = exports.ModuleFactory = exports.AudioFactory = exports.Audio = exports.FaderFactory = exports.VolmeterFactory = exports.TransitionFactory = exports.FilterFactory = exports.SceneFactory = exports.InputFactory = exports.VideoFactory = exports.Video = exports.Global = exports.DefaultPluginPathMac = exports.DefaultPluginDataPath = exports.DefaultPluginPath = exports.DefaultDataPath = exports.DefaultBinPath = exports.DefaultDrawPluginPath = exports.DefaultOpenGLPath = exports.DefaultD3D11Path = void 0; exports.addItems = addItems; exports.createSources = createSources; exports.getSourcesSize = getSourcesSize; @@ -19,326 +18,6 @@ exports.DefaultDataPath = path.resolve(__dirname, `data`); exports.DefaultPluginPath = path.resolve(__dirname, `obs-plugins`); exports.DefaultPluginDataPath = path.resolve(__dirname, `data/obs-plugins/%module%`); exports.DefaultPluginPathMac = path.resolve(__dirname, `PlugIns`); -var ESourceFlags; -(function (ESourceFlags) { - ESourceFlags[ESourceFlags["Unbuffered"] = 1] = "Unbuffered"; - ESourceFlags[ESourceFlags["ForceMono"] = 2] = "ForceMono"; -})(ESourceFlags || (exports.ESourceFlags = ESourceFlags = {})); -var EMonitoringType; -(function (EMonitoringType) { - EMonitoringType[EMonitoringType["None"] = 0] = "None"; - EMonitoringType[EMonitoringType["MonitoringOnly"] = 1] = "MonitoringOnly"; - EMonitoringType[EMonitoringType["MonitoringAndOutput"] = 2] = "MonitoringAndOutput"; -})(EMonitoringType || (exports.EMonitoringType = EMonitoringType = {})); -var EOrderMovement; -(function (EOrderMovement) { - EOrderMovement[EOrderMovement["Up"] = 0] = "Up"; - EOrderMovement[EOrderMovement["Down"] = 1] = "Down"; - EOrderMovement[EOrderMovement["Top"] = 2] = "Top"; - EOrderMovement[EOrderMovement["Bottom"] = 3] = "Bottom"; -})(EOrderMovement || (exports.EOrderMovement = EOrderMovement = {})); -var EDeinterlaceFieldOrder; -(function (EDeinterlaceFieldOrder) { - EDeinterlaceFieldOrder[EDeinterlaceFieldOrder["Top"] = 0] = "Top"; - EDeinterlaceFieldOrder[EDeinterlaceFieldOrder["Bottom"] = 1] = "Bottom"; -})(EDeinterlaceFieldOrder || (exports.EDeinterlaceFieldOrder = EDeinterlaceFieldOrder = {})); -var EVideoCodes; -(function (EVideoCodes) { - EVideoCodes[EVideoCodes["Success"] = 0] = "Success"; - EVideoCodes[EVideoCodes["Fail"] = -1] = "Fail"; - EVideoCodes[EVideoCodes["NotSupported"] = -2] = "NotSupported"; - EVideoCodes[EVideoCodes["InvalidParam"] = -3] = "InvalidParam"; - EVideoCodes[EVideoCodes["CurrentlyActive"] = -4] = "CurrentlyActive"; - EVideoCodes[EVideoCodes["ModuleNotFound"] = -5] = "ModuleNotFound"; -})(EVideoCodes || (exports.EVideoCodes = EVideoCodes = {})); -var EHotkeyObjectType; -(function (EHotkeyObjectType) { - EHotkeyObjectType[EHotkeyObjectType["Frontend"] = 0] = "Frontend"; - EHotkeyObjectType[EHotkeyObjectType["Source"] = 1] = "Source"; - EHotkeyObjectType[EHotkeyObjectType["Output"] = 2] = "Output"; - EHotkeyObjectType[EHotkeyObjectType["Encoder"] = 3] = "Encoder"; - EHotkeyObjectType[EHotkeyObjectType["Service"] = 4] = "Service"; -})(EHotkeyObjectType || (exports.EHotkeyObjectType = EHotkeyObjectType = {})); -var EDeinterlaceMode; -(function (EDeinterlaceMode) { - EDeinterlaceMode[EDeinterlaceMode["Disable"] = 0] = "Disable"; - EDeinterlaceMode[EDeinterlaceMode["Discard"] = 1] = "Discard"; - EDeinterlaceMode[EDeinterlaceMode["Retro"] = 2] = "Retro"; - EDeinterlaceMode[EDeinterlaceMode["Blend"] = 3] = "Blend"; - EDeinterlaceMode[EDeinterlaceMode["Blend2X"] = 4] = "Blend2X"; - EDeinterlaceMode[EDeinterlaceMode["Linear"] = 5] = "Linear"; - EDeinterlaceMode[EDeinterlaceMode["Linear2X"] = 6] = "Linear2X"; - EDeinterlaceMode[EDeinterlaceMode["Yadif"] = 7] = "Yadif"; - EDeinterlaceMode[EDeinterlaceMode["Yadif2X"] = 8] = "Yadif2X"; -})(EDeinterlaceMode || (exports.EDeinterlaceMode = EDeinterlaceMode = {})); -var EBlendingMethod; -(function (EBlendingMethod) { - EBlendingMethod[EBlendingMethod["Default"] = 0] = "Default"; - EBlendingMethod[EBlendingMethod["SrgbOff"] = 1] = "SrgbOff"; -})(EBlendingMethod || (exports.EBlendingMethod = EBlendingMethod = {})); -var EBlendingMode; -(function (EBlendingMode) { - EBlendingMode[EBlendingMode["Normal"] = 0] = "Normal"; - EBlendingMode[EBlendingMode["Additive"] = 1] = "Additive"; - EBlendingMode[EBlendingMode["Substract"] = 2] = "Substract"; - EBlendingMode[EBlendingMode["Screen"] = 3] = "Screen"; - EBlendingMode[EBlendingMode["Multiply"] = 4] = "Multiply"; - EBlendingMode[EBlendingMode["Lighten"] = 5] = "Lighten"; - EBlendingMode[EBlendingMode["Darken"] = 6] = "Darken"; -})(EBlendingMode || (exports.EBlendingMode = EBlendingMode = {})); -var EFontStyle; -(function (EFontStyle) { - EFontStyle[EFontStyle["Bold"] = 1] = "Bold"; - EFontStyle[EFontStyle["Italic"] = 2] = "Italic"; - EFontStyle[EFontStyle["Underline"] = 4] = "Underline"; - EFontStyle[EFontStyle["Strikeout"] = 8] = "Strikeout"; -})(EFontStyle || (exports.EFontStyle = EFontStyle = {})); -var EPropertyType; -(function (EPropertyType) { - EPropertyType[EPropertyType["Invalid"] = 0] = "Invalid"; - EPropertyType[EPropertyType["Boolean"] = 1] = "Boolean"; - EPropertyType[EPropertyType["Int"] = 2] = "Int"; - EPropertyType[EPropertyType["Float"] = 3] = "Float"; - EPropertyType[EPropertyType["Text"] = 4] = "Text"; - EPropertyType[EPropertyType["Path"] = 5] = "Path"; - EPropertyType[EPropertyType["List"] = 6] = "List"; - EPropertyType[EPropertyType["Color"] = 7] = "Color"; - EPropertyType[EPropertyType["Button"] = 8] = "Button"; - EPropertyType[EPropertyType["Font"] = 9] = "Font"; - EPropertyType[EPropertyType["EditableList"] = 10] = "EditableList"; - EPropertyType[EPropertyType["FrameRate"] = 11] = "FrameRate"; - EPropertyType[EPropertyType["Group"] = 12] = "Group"; - EPropertyType[EPropertyType["ColorAlpha"] = 13] = "ColorAlpha"; - EPropertyType[EPropertyType["Capture"] = 14] = "Capture"; -})(EPropertyType || (exports.EPropertyType = EPropertyType = {})); -var EListFormat; -(function (EListFormat) { - EListFormat[EListFormat["Invalid"] = 0] = "Invalid"; - EListFormat[EListFormat["Int"] = 1] = "Int"; - EListFormat[EListFormat["Float"] = 2] = "Float"; - EListFormat[EListFormat["String"] = 3] = "String"; -})(EListFormat || (exports.EListFormat = EListFormat = {})); -var EEditableListType; -(function (EEditableListType) { - EEditableListType[EEditableListType["Strings"] = 0] = "Strings"; - EEditableListType[EEditableListType["Files"] = 1] = "Files"; - EEditableListType[EEditableListType["FilesAndUrls"] = 2] = "FilesAndUrls"; -})(EEditableListType || (exports.EEditableListType = EEditableListType = {})); -var EPathType; -(function (EPathType) { - EPathType[EPathType["File"] = 0] = "File"; - EPathType[EPathType["FileSave"] = 1] = "FileSave"; - EPathType[EPathType["Directory"] = 2] = "Directory"; -})(EPathType || (exports.EPathType = EPathType = {})); -var ETextType; -(function (ETextType) { - ETextType[ETextType["Default"] = 0] = "Default"; - ETextType[ETextType["Password"] = 1] = "Password"; - ETextType[ETextType["Multiline"] = 2] = "Multiline"; - ETextType[ETextType["TextInfo"] = 3] = "TextInfo"; -})(ETextType || (exports.ETextType = ETextType = {})); -var ETextInfoType; -(function (ETextInfoType) { - ETextInfoType[ETextInfoType["Normal"] = 0] = "Normal"; - ETextInfoType[ETextInfoType["Warning"] = 1] = "Warning"; - ETextInfoType[ETextInfoType["Error"] = 2] = "Error"; -})(ETextInfoType || (exports.ETextInfoType = ETextInfoType = {})); -var ENumberType; -(function (ENumberType) { - ENumberType[ENumberType["Scroller"] = 0] = "Scroller"; - ENumberType[ENumberType["Slider"] = 1] = "Slider"; -})(ENumberType || (exports.ENumberType = ENumberType = {})); -var EAlignment; -(function (EAlignment) { - EAlignment[EAlignment["Center"] = 0] = "Center"; - EAlignment[EAlignment["Left"] = 1] = "Left"; - EAlignment[EAlignment["Right"] = 2] = "Right"; - EAlignment[EAlignment["Top"] = 4] = "Top"; - EAlignment[EAlignment["Bottom"] = 8] = "Bottom"; - EAlignment[EAlignment["TopLeft"] = 5] = "TopLeft"; - EAlignment[EAlignment["TopRight"] = 6] = "TopRight"; - EAlignment[EAlignment["BottomLeft"] = 9] = "BottomLeft"; - EAlignment[EAlignment["BottomRight"] = 10] = "BottomRight"; -})(EAlignment || (exports.EAlignment = EAlignment = {})); -var EOutputFlags; -(function (EOutputFlags) { - EOutputFlags[EOutputFlags["Video"] = 1] = "Video"; - EOutputFlags[EOutputFlags["Audio"] = 2] = "Audio"; - EOutputFlags[EOutputFlags["AV"] = 3] = "AV"; - EOutputFlags[EOutputFlags["Encoded"] = 4] = "Encoded"; - EOutputFlags[EOutputFlags["Service"] = 8] = "Service"; - EOutputFlags[EOutputFlags["MultiTrack"] = 16] = "MultiTrack"; -})(EOutputFlags || (exports.EOutputFlags = EOutputFlags = {})); -var ESourceOutputFlags; -(function (ESourceOutputFlags) { - ESourceOutputFlags[ESourceOutputFlags["Video"] = 1] = "Video"; - ESourceOutputFlags[ESourceOutputFlags["Audio"] = 2] = "Audio"; - ESourceOutputFlags[ESourceOutputFlags["Async"] = 4] = "Async"; - ESourceOutputFlags[ESourceOutputFlags["AsyncVideo"] = 5] = "AsyncVideo"; - ESourceOutputFlags[ESourceOutputFlags["CustomDraw"] = 8] = "CustomDraw"; - ESourceOutputFlags[ESourceOutputFlags["Interaction"] = 32] = "Interaction"; - ESourceOutputFlags[ESourceOutputFlags["Composite"] = 64] = "Composite"; - ESourceOutputFlags[ESourceOutputFlags["DoNotDuplicate"] = 128] = "DoNotDuplicate"; - ESourceOutputFlags[ESourceOutputFlags["Deprecated"] = 256] = "Deprecated"; - ESourceOutputFlags[ESourceOutputFlags["DoNotSelfMonitor"] = 512] = "DoNotSelfMonitor"; - ESourceOutputFlags[ESourceOutputFlags["ForceUiRefresh"] = 1073741824] = "ForceUiRefresh"; -})(ESourceOutputFlags || (exports.ESourceOutputFlags = ESourceOutputFlags = {})); -var ESceneDupType; -(function (ESceneDupType) { - ESceneDupType[ESceneDupType["Refs"] = 0] = "Refs"; - ESceneDupType[ESceneDupType["Copy"] = 1] = "Copy"; - ESceneDupType[ESceneDupType["PrivateRefs"] = 2] = "PrivateRefs"; - ESceneDupType[ESceneDupType["PrivateCopy"] = 3] = "PrivateCopy"; -})(ESceneDupType || (exports.ESceneDupType = ESceneDupType = {})); -var ESourceType; -(function (ESourceType) { - ESourceType[ESourceType["Input"] = 0] = "Input"; - ESourceType[ESourceType["Filter"] = 1] = "Filter"; - ESourceType[ESourceType["Transition"] = 2] = "Transition"; - ESourceType[ESourceType["Scene"] = 3] = "Scene"; -})(ESourceType || (exports.ESourceType = ESourceType = {})); -var EFaderType; -(function (EFaderType) { - EFaderType[EFaderType["Cubic"] = 0] = "Cubic"; - EFaderType[EFaderType["IEC"] = 1] = "IEC"; - EFaderType[EFaderType["Log"] = 2] = "Log"; -})(EFaderType || (exports.EFaderType = EFaderType = {})); -var EColorFormat; -(function (EColorFormat) { - EColorFormat[EColorFormat["Unknown"] = 0] = "Unknown"; - EColorFormat[EColorFormat["A8"] = 1] = "A8"; - EColorFormat[EColorFormat["R8"] = 2] = "R8"; - EColorFormat[EColorFormat["RGBA"] = 3] = "RGBA"; - EColorFormat[EColorFormat["BGRX"] = 4] = "BGRX"; - EColorFormat[EColorFormat["BGRA"] = 5] = "BGRA"; - EColorFormat[EColorFormat["R10G10B10A2"] = 6] = "R10G10B10A2"; - EColorFormat[EColorFormat["RGBA16"] = 7] = "RGBA16"; - EColorFormat[EColorFormat["R16"] = 8] = "R16"; - EColorFormat[EColorFormat["RGBA16F"] = 9] = "RGBA16F"; - EColorFormat[EColorFormat["RGBA32F"] = 10] = "RGBA32F"; - EColorFormat[EColorFormat["RG16F"] = 11] = "RG16F"; - EColorFormat[EColorFormat["RG32F"] = 12] = "RG32F"; - EColorFormat[EColorFormat["R16F"] = 13] = "R16F"; - EColorFormat[EColorFormat["R32F"] = 14] = "R32F"; - EColorFormat[EColorFormat["DXT1"] = 15] = "DXT1"; - EColorFormat[EColorFormat["DXT3"] = 16] = "DXT3"; - EColorFormat[EColorFormat["DXT5"] = 17] = "DXT5"; -})(EColorFormat || (exports.EColorFormat = EColorFormat = {})); -var EScaleType; -(function (EScaleType) { - EScaleType[EScaleType["Disable"] = 0] = "Disable"; - EScaleType[EScaleType["Point"] = 1] = "Point"; - EScaleType[EScaleType["Bicubic"] = 2] = "Bicubic"; - EScaleType[EScaleType["Bilinear"] = 3] = "Bilinear"; - EScaleType[EScaleType["Lanczos"] = 4] = "Lanczos"; - EScaleType[EScaleType["Area"] = 5] = "Area"; -})(EScaleType || (exports.EScaleType = EScaleType = {})); -var EFPSType; -(function (EFPSType) { - EFPSType[EFPSType["Common"] = 0] = "Common"; - EFPSType[EFPSType["Integer"] = 1] = "Integer"; - EFPSType[EFPSType["Fractional"] = 2] = "Fractional"; -})(EFPSType || (exports.EFPSType = EFPSType = {})); -var ERangeType; -(function (ERangeType) { - ERangeType[ERangeType["Default"] = 0] = "Default"; - ERangeType[ERangeType["Partial"] = 1] = "Partial"; - ERangeType[ERangeType["Full"] = 2] = "Full"; -})(ERangeType || (exports.ERangeType = ERangeType = {})); -var EVideoFormat; -(function (EVideoFormat) { - EVideoFormat[EVideoFormat["None"] = 0] = "None"; - EVideoFormat[EVideoFormat["I420"] = 1] = "I420"; - EVideoFormat[EVideoFormat["NV12"] = 2] = "NV12"; - EVideoFormat[EVideoFormat["YVYU"] = 3] = "YVYU"; - EVideoFormat[EVideoFormat["YUY2"] = 4] = "YUY2"; - EVideoFormat[EVideoFormat["UYVY"] = 5] = "UYVY"; - EVideoFormat[EVideoFormat["RGBA"] = 6] = "RGBA"; - EVideoFormat[EVideoFormat["BGRA"] = 7] = "BGRA"; - EVideoFormat[EVideoFormat["BGRX"] = 8] = "BGRX"; - EVideoFormat[EVideoFormat["Y800"] = 9] = "Y800"; - EVideoFormat[EVideoFormat["I444"] = 10] = "I444"; - EVideoFormat[EVideoFormat["BGR3"] = 11] = "BGR3"; - EVideoFormat[EVideoFormat["I422"] = 12] = "I422"; - EVideoFormat[EVideoFormat["I40A"] = 13] = "I40A"; - EVideoFormat[EVideoFormat["I42A"] = 14] = "I42A"; - EVideoFormat[EVideoFormat["YUVA"] = 15] = "YUVA"; - EVideoFormat[EVideoFormat["AYUV"] = 16] = "AYUV"; -})(EVideoFormat || (exports.EVideoFormat = EVideoFormat = {})); -var EBoundsType; -(function (EBoundsType) { - EBoundsType[EBoundsType["None"] = 0] = "None"; - EBoundsType[EBoundsType["Stretch"] = 1] = "Stretch"; - EBoundsType[EBoundsType["ScaleInner"] = 2] = "ScaleInner"; - EBoundsType[EBoundsType["ScaleOuter"] = 3] = "ScaleOuter"; - EBoundsType[EBoundsType["ScaleToWidth"] = 4] = "ScaleToWidth"; - EBoundsType[EBoundsType["ScaleToHeight"] = 5] = "ScaleToHeight"; - EBoundsType[EBoundsType["MaxOnly"] = 6] = "MaxOnly"; -})(EBoundsType || (exports.EBoundsType = EBoundsType = {})); -var EColorSpace; -(function (EColorSpace) { - EColorSpace[EColorSpace["Default"] = 0] = "Default"; - EColorSpace[EColorSpace["CS601"] = 1] = "CS601"; - EColorSpace[EColorSpace["CS709"] = 2] = "CS709"; - EColorSpace[EColorSpace["CSSRGB"] = 3] = "CSSRGB"; - EColorSpace[EColorSpace["CS2100PQ"] = 4] = "CS2100PQ"; - EColorSpace[EColorSpace["CS2100HLG"] = 5] = "CS2100HLG"; -})(EColorSpace || (exports.EColorSpace = EColorSpace = {})); -var ESpeakerLayout; -(function (ESpeakerLayout) { - ESpeakerLayout[ESpeakerLayout["Unknown"] = 0] = "Unknown"; - ESpeakerLayout[ESpeakerLayout["Mono"] = 1] = "Mono"; - ESpeakerLayout[ESpeakerLayout["Stereo"] = 2] = "Stereo"; - ESpeakerLayout[ESpeakerLayout["TwoOne"] = 3] = "TwoOne"; - ESpeakerLayout[ESpeakerLayout["Four"] = 4] = "Four"; - ESpeakerLayout[ESpeakerLayout["FourOne"] = 5] = "FourOne"; - ESpeakerLayout[ESpeakerLayout["FiveOne"] = 6] = "FiveOne"; - ESpeakerLayout[ESpeakerLayout["SevenOne"] = 8] = "SevenOne"; -})(ESpeakerLayout || (exports.ESpeakerLayout = ESpeakerLayout = {})); -var EOutputCode; -(function (EOutputCode) { - EOutputCode[EOutputCode["Success"] = 0] = "Success"; - EOutputCode[EOutputCode["BadPath"] = -1] = "BadPath"; - EOutputCode[EOutputCode["ConnectFailed"] = -2] = "ConnectFailed"; - EOutputCode[EOutputCode["InvalidStream"] = -3] = "InvalidStream"; - EOutputCode[EOutputCode["Error"] = -4] = "Error"; - EOutputCode[EOutputCode["Disconnected"] = -5] = "Disconnected"; - EOutputCode[EOutputCode["Unsupported"] = -6] = "Unsupported"; - EOutputCode[EOutputCode["NoSpace"] = -7] = "NoSpace"; - EOutputCode[EOutputCode["EncoderError"] = -8] = "EncoderError"; - EOutputCode[EOutputCode["OutdatedDriver"] = -65] = "OutdatedDriver"; -})(EOutputCode || (exports.EOutputCode = EOutputCode = {})); -var ECategoryTypes; -(function (ECategoryTypes) { - ECategoryTypes[ECategoryTypes["NODEOBS_CATEGORY_LIST"] = 0] = "NODEOBS_CATEGORY_LIST"; - ECategoryTypes[ECategoryTypes["NODEOBS_CATEGORY_TAB"] = 1] = "NODEOBS_CATEGORY_TAB"; -})(ECategoryTypes || (exports.ECategoryTypes = ECategoryTypes = {})); -var ERenderingMode; -(function (ERenderingMode) { - ERenderingMode[ERenderingMode["OBS_MAIN_RENDERING"] = 0] = "OBS_MAIN_RENDERING"; - ERenderingMode[ERenderingMode["OBS_STREAMING_RENDERING"] = 1] = "OBS_STREAMING_RENDERING"; - ERenderingMode[ERenderingMode["OBS_RECORDING_RENDERING"] = 2] = "OBS_RECORDING_RENDERING"; -})(ERenderingMode || (exports.ERenderingMode = ERenderingMode = {})); -var EIPCError; -(function (EIPCError) { - EIPCError[EIPCError["STILL_RUNNING"] = 259] = "STILL_RUNNING"; - EIPCError[EIPCError["VERSION_MISMATCH"] = 252] = "VERSION_MISMATCH"; - EIPCError[EIPCError["OTHER_ERROR"] = 253] = "OTHER_ERROR"; - EIPCError[EIPCError["MISSING_DEPENDENCY"] = 254] = "MISSING_DEPENDENCY"; - EIPCError[EIPCError["NORMAL_EXIT"] = 0] = "NORMAL_EXIT"; -})(EIPCError || (exports.EIPCError = EIPCError = {})); -var EVcamInstalledStatus; -(function (EVcamInstalledStatus) { - EVcamInstalledStatus[EVcamInstalledStatus["NotInstalled"] = 0] = "NotInstalled"; - EVcamInstalledStatus[EVcamInstalledStatus["LegacyInstalled"] = 1] = "LegacyInstalled"; - EVcamInstalledStatus[EVcamInstalledStatus["Installed"] = 2] = "Installed"; -})(EVcamInstalledStatus || (exports.EVcamInstalledStatus = EVcamInstalledStatus = {})); -var ERecSplitType; -(function (ERecSplitType) { - ERecSplitType[ERecSplitType["Time"] = 0] = "Time"; - ERecSplitType[ERecSplitType["Size"] = 1] = "Size"; - ERecSplitType[ERecSplitType["Manual"] = 2] = "Manual"; -})(ERecSplitType || (exports.ERecSplitType = ERecSplitType = {})); exports.Global = obs.Global; exports.Video = obs.Video; exports.VideoFactory = obs.Video; @@ -367,28 +46,6 @@ exports.AdvancedRecordingFactory = obs.AdvancedRecording; exports.AudioEncoderFactory = obs.AudioEncoder; exports.SimpleReplayBufferFactory = obs.SimpleReplayBuffer; exports.AdvancedReplayBufferFactory = obs.AdvancedReplayBuffer; -var EInteractionFlags; -(function (EInteractionFlags) { - EInteractionFlags[EInteractionFlags["None"] = 0] = "None"; - EInteractionFlags[EInteractionFlags["CapsKey"] = 1] = "CapsKey"; - EInteractionFlags[EInteractionFlags["ShiftKey"] = 2] = "ShiftKey"; - EInteractionFlags[EInteractionFlags["ControlKey"] = 4] = "ControlKey"; - EInteractionFlags[EInteractionFlags["AltKey"] = 8] = "AltKey"; - EInteractionFlags[EInteractionFlags["MouseLeft"] = 16] = "MouseLeft"; - EInteractionFlags[EInteractionFlags["MouseMiddle"] = 32] = "MouseMiddle"; - EInteractionFlags[EInteractionFlags["MouseRight"] = 64] = "MouseRight"; - EInteractionFlags[EInteractionFlags["CommandKey"] = 128] = "CommandKey"; - EInteractionFlags[EInteractionFlags["Numlock_Key"] = 256] = "Numlock_Key"; - EInteractionFlags[EInteractionFlags["IsKeyPad"] = 512] = "IsKeyPad"; - EInteractionFlags[EInteractionFlags["IsLeft"] = 1024] = "IsLeft"; - EInteractionFlags[EInteractionFlags["IsRight"] = 2048] = "IsRight"; -})(EInteractionFlags || (exports.EInteractionFlags = EInteractionFlags = {})); -var EMouseButtonType; -(function (EMouseButtonType) { - EMouseButtonType[EMouseButtonType["Left"] = 0] = "Left"; - EMouseButtonType[EMouseButtonType["Middle"] = 1] = "Middle"; - EMouseButtonType[EMouseButtonType["Right"] = 2] = "Right"; -})(EMouseButtonType || (exports.EMouseButtonType = EMouseButtonType = {})); function addItems(scene, sceneItems) { const items = []; if (Array.isArray(sceneItems)) { @@ -461,43 +118,6 @@ function getSourcesSize(sourcesNames) { } return sourcesSize; } -var ERecordingFormat; -(function (ERecordingFormat) { - ERecordingFormat["MP4"] = "mp4"; - ERecordingFormat["FLV"] = "flv"; - ERecordingFormat["MOV"] = "mov"; - ERecordingFormat["MKV"] = "mkv"; - ERecordingFormat["MPEGTS"] = "ts"; - ERecordingFormat["HLS"] = "m3u8"; -})(ERecordingFormat || (exports.ERecordingFormat = ERecordingFormat = {})); -var ERecordingQuality; -(function (ERecordingQuality) { - ERecordingQuality[ERecordingQuality["Stream"] = 0] = "Stream"; - ERecordingQuality[ERecordingQuality["HighQuality"] = 1] = "HighQuality"; - ERecordingQuality[ERecordingQuality["HigherQuality"] = 2] = "HigherQuality"; - ERecordingQuality[ERecordingQuality["Lossless"] = 3] = "Lossless"; -})(ERecordingQuality || (exports.ERecordingQuality = ERecordingQuality = {})); -var EVideoEncoderType; -(function (EVideoEncoderType) { - EVideoEncoderType[EVideoEncoderType["Audio"] = 0] = "Audio"; - EVideoEncoderType[EVideoEncoderType["Video"] = 1] = "Video"; -})(EVideoEncoderType || (exports.EVideoEncoderType = EVideoEncoderType = {})); -var EProcessPriority; -(function (EProcessPriority) { - EProcessPriority["High"] = "High"; - EProcessPriority["AboveNormal"] = "AboveNormal"; - EProcessPriority["Normal"] = "Normal"; - EProcessPriority["BelowNormal"] = "BelowNormal"; - EProcessPriority["Idle"] = "Idle"; -})(EProcessPriority || (exports.EProcessPriority = EProcessPriority = {})); -var VCamOutputType; -(function (VCamOutputType) { - VCamOutputType[VCamOutputType["Invalid"] = 0] = "Invalid"; - VCamOutputType[VCamOutputType["SceneOutput"] = 1] = "SceneOutput"; - VCamOutputType[VCamOutputType["SourceOutput"] = 2] = "SourceOutput"; - VCamOutputType[VCamOutputType["ProgramView"] = 3] = "ProgramView"; - VCamOutputType[VCamOutputType["PreviewOutput"] = 4] = "PreviewOutput"; -})(VCamOutputType || (exports.VCamOutputType = VCamOutputType = {})); const appleBinaryFolder = hasDeveloperApp ? path.join(__dirname, 'OSN.app', 'distribute', 'obs-studio-node', 'bin') : path.join(__dirname, 'bin'); diff --git a/js/module.ts b/js/module.ts index 33dc15dfd..8e9428635 100644 --- a/js/module.ts +++ b/js/module.ts @@ -34,30 +34,30 @@ export const DefaultPluginPathMac: string = /** * To be passed to Input.flags */ -export enum ESourceFlags { +export const enum ESourceFlags { Unbuffered = (1 << 0), ForceMono = (1 << 1) } -export enum EMonitoringType { +export const enum EMonitoringType { None, MonitoringOnly, MonitoringAndOutput } -export enum EOrderMovement { +export const enum EOrderMovement { Up, Down, Top, Bottom } -export enum EDeinterlaceFieldOrder { +export const enum EDeinterlaceFieldOrder { Top, Bottom } -export enum EVideoCodes { +export const enum EVideoCodes { Success = 0, Fail = -1, NotSupported = -2, @@ -66,7 +66,7 @@ export enum EVideoCodes { ModuleNotFound = -5 } -export enum EHotkeyObjectType { +export const enum EHotkeyObjectType { Frontend = 0, Source = 1, Output = 2, @@ -74,7 +74,7 @@ export enum EHotkeyObjectType { Service = 4 } -export enum EDeinterlaceMode { +export const enum EDeinterlaceMode { Disable, Discard, Retro, @@ -86,12 +86,12 @@ export enum EDeinterlaceMode { Yadif2X } -export enum EBlendingMethod { +export const enum EBlendingMethod { Default, SrgbOff } -export enum EBlendingMode { +export const enum EBlendingMode { Normal, Additive, Substract, @@ -101,7 +101,7 @@ export enum EBlendingMode { Darken } -export enum EFontStyle { +export const enum EFontStyle { Bold = (1<<0), Italic = (1<<1), Underline = (1<<2), @@ -111,7 +111,7 @@ export enum EFontStyle { /** * Enumeration describing the type of a property */ -export enum EPropertyType { +export const enum EPropertyType { Invalid, Boolean, Int, @@ -129,39 +129,39 @@ export enum EPropertyType { Capture, } -export enum EListFormat { +export const enum EListFormat { Invalid, Int, Float, String } -export enum EEditableListType { +export const enum EEditableListType { Strings, Files, FilesAndUrls } -export enum EPathType { +export const enum EPathType { File, FileSave, Directory } -export enum ETextType { +export const enum ETextType { Default, Password, Multiline, TextInfo } -export enum ETextInfoType { +export const enum ETextInfoType { Normal, Warning, Error, } -export enum ENumberType { +export const enum ENumberType { Scroller, Slider } @@ -169,7 +169,7 @@ export enum ENumberType { /** * A binary flag representing alignment */ -export enum EAlignment { +export const enum EAlignment { Center = 0, Left = (1 << 0), Right = (1 << 1), @@ -185,7 +185,7 @@ export enum EAlignment { * A binary flag representing output capabilities * Apparently you can't fetch these for now (???) */ -export enum EOutputFlags { +export const enum EOutputFlags { Video = (1<<0), Audio = (1<<1), AV = (Video | Audio), @@ -197,7 +197,7 @@ export enum EOutputFlags { /** * A binary flag representing source output capabilities */ -export enum ESourceOutputFlags { +export const enum ESourceOutputFlags { Video = (1 << 0), Audio = (1 << 1), Async = (1 << 2), @@ -212,7 +212,7 @@ export enum ESourceOutputFlags { ForceUiRefresh = (1 << 30), } -export enum ESceneDupType { +export const enum ESceneDupType { Refs, Copy, PrivateRefs, @@ -222,7 +222,7 @@ export enum ESceneDupType { /** * Describes the type of source */ -export enum ESourceType { +export const enum ESourceType { Input, Filter, Transition, @@ -232,13 +232,13 @@ export enum ESourceType { /** * Describes algorithm type to use for volume representation. */ -export enum EFaderType { +export const enum EFaderType { Cubic, IEC /* IEC 60-268-18 */, Log /* Logarithmic */ } -export enum EColorFormat { +export const enum EColorFormat { Unknown, A8, R8, @@ -259,7 +259,7 @@ export enum EColorFormat { DXT5 } -export enum EScaleType { +export const enum EScaleType { Disable, Point, Bicubic, @@ -268,19 +268,19 @@ export enum EScaleType { Area } -export enum EFPSType { +export const enum EFPSType { Common, Integer, Fractional } -export enum ERangeType { +export const enum ERangeType { Default, Partial, Full } -export enum EVideoFormat { +export const enum EVideoFormat { None, I420, NV12, @@ -300,7 +300,7 @@ export enum EVideoFormat { AYUV } -export enum EBoundsType { +export const enum EBoundsType { None, Stretch, ScaleInner, @@ -310,7 +310,7 @@ export enum EBoundsType { MaxOnly } -export enum EColorSpace { +export const enum EColorSpace { Default, CS601, CS709, @@ -319,7 +319,7 @@ export enum EColorSpace { CS2100HLG } -export enum ESpeakerLayout { +export const enum ESpeakerLayout { Unknown, Mono, Stereo, @@ -330,7 +330,7 @@ export enum ESpeakerLayout { SevenOne = 8 } -export enum EOutputCode { +export const enum EOutputCode { Success = 0, BadPath = -1, ConnectFailed = -2, @@ -343,18 +343,18 @@ export enum EOutputCode { OutdatedDriver = -65, } -export enum ECategoryTypes { +export const enum ECategoryTypes { NODEOBS_CATEGORY_LIST = 0, NODEOBS_CATEGORY_TAB = 1 } -export enum ERenderingMode { +export const enum ERenderingMode { OBS_MAIN_RENDERING = 0, OBS_STREAMING_RENDERING = 1, OBS_RECORDING_RENDERING = 2 } -export enum EIPCError { +export const enum EIPCError { STILL_RUNNING = 259, VERSION_MISMATCH = 252, OTHER_ERROR = 253, @@ -362,13 +362,13 @@ export enum EIPCError { NORMAL_EXIT = 0, } -export enum EVcamInstalledStatus { +export const enum EVcamInstalledStatus { NotInstalled = 0, LegacyInstalled = 1, Installed = 2 } -export enum ERecSplitType { +export const enum ERecSplitType { Time = 0, Size = 1, Manual = 2 @@ -802,7 +802,7 @@ export interface IInputFactory extends IFactoryTypes { } -export enum EInteractionFlags { +export const enum EInteractionFlags { None = 0, CapsKey = 1, ShiftKey = 1 << 1, @@ -818,7 +818,7 @@ export enum EInteractionFlags { IsRight = 1 << 11 } -export enum EMouseButtonType { +export const enum EMouseButtonType { Left, Middle, Right @@ -1635,7 +1635,7 @@ export interface IService { update(settings: ISettings): void; } -export enum ERecordingFormat { +export const enum ERecordingFormat { MP4 = 'mp4', FLV = 'flv', MOV = 'mov', @@ -1644,19 +1644,19 @@ export enum ERecordingFormat { HLS = 'm3u8' } -export enum ERecordingQuality { +export const enum ERecordingQuality { Stream, HighQuality, HigherQuality, Lossless } -export enum EVideoEncoderType { +export const enum EVideoEncoderType { Audio, Video } -export enum EProcessPriority { +export const enum EProcessPriority { High = 'High', AboveNormal = 'AboveNormal', Normal = 'Normal', @@ -1906,7 +1906,7 @@ export interface IAudioTrackFactory { saveLegacySettings(): void; } -export enum VCamOutputType { +export const enum VCamOutputType { Invalid, SceneOutput, SourceOutput, diff --git a/js/type_check.js b/js/type_check.js index 2c6de9ab7..b38ce4473 100644 --- a/js/type_check.js +++ b/js/type_check.js @@ -11,45 +11,44 @@ exports.isColorProperty = isColorProperty; exports.isCaptureProperty = isCaptureProperty; exports.isFontProperty = isFontProperty; exports.isEmptyProperty = isEmptyProperty; -const obs = require("./module"); function isNumberProperty(property) { - return property.type === obs.EPropertyType.Int || - property.type === obs.EPropertyType.Float; + return property.type === 2 || + property.type === 3; } function isTextProperty(property) { - return property.type === obs.EPropertyType.Text; + return property.type === 4; } function isPathProperty(property) { - return property.type === obs.EPropertyType.Path; + return property.type === 5; } function isListProperty(property) { - return property.type === obs.EPropertyType.List; + return property.type === 6; } function isEditableListProperty(property) { - return property.type === obs.EPropertyType.EditableList; + return property.type === 10; } function isBooleanProperty(property) { - return property.type === obs.EPropertyType.Boolean; + return property.type === 1; } function isButtonProperty(property) { - return property.type === obs.EPropertyType.Button; + return property.type === 8; } function isColorProperty(property) { - return property.type === obs.EPropertyType.Color; + return property.type === 7; } function isCaptureProperty(property) { - return property.type === obs.EPropertyType.Capture; + return property.type === 14; } function isFontProperty(property) { - return property.type === obs.EPropertyType.Font; + return property.type === 9; } function isEmptyProperty(property) { switch (property.type) { - case obs.EPropertyType.Boolean: - case obs.EPropertyType.Button: - case obs.EPropertyType.Color: - case obs.EPropertyType.Font: - case obs.EPropertyType.Invalid: + case 1: + case 8: + case 7: + case 9: + case 0: return true; } return false;