diff --git a/openvidu-browser/config/replace_for_ts44.sh b/openvidu-browser/config/replace_for_ts44.sh new file mode 100755 index 00000000..87bab506 --- /dev/null +++ b/openvidu-browser/config/replace_for_ts44.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e +SEARCH_STRING_1="(type: K," +REPLACE_STRING_1="(type: K | string," +SEARCH_STRING_2='\[key: `signal:\${string}`\]: SignalEvent;' +sed -i "s~${SEARCH_STRING_1}~${REPLACE_STRING_1}~g" ts4.4/lib/OpenVidu/Session.d.ts +sed -i "/${SEARCH_STRING_2}/d" ts4.4/lib/OpenViduInternal/Events/EventMap/SessionEventMap.d.ts \ No newline at end of file diff --git a/openvidu-browser/package.json b/openvidu-browser/package.json index e281dce1..cbdc4964 100644 --- a/openvidu-browser/package.json +++ b/openvidu-browser/package.json @@ -11,8 +11,8 @@ }, "description": "OpenVidu Browser", "devDependencies": { - "@types/node": "15.12.2", - "@types/platform": "1.3.3", + "@types/node": "17.0.8", + "@types/platform": "1.3.4", "browserify": "17.0.0", "grunt": "1.4.1", "grunt-cli": "1.4.3", @@ -23,11 +23,11 @@ "grunt-postcss": "0.9.0", "grunt-string-replace": "1.3.1", "grunt-ts": "6.0.0-beta.22", - "terser": "5.7.0", + "terser": "5.10.0", "tsify": "5.0.4", "tslint": "6.1.3", "typedoc": "0.19.2", - "typescript": "4.0.7" + "typescript": "4.5.4" }, "license": "Apache-2.0", "main": "lib/index.js", @@ -39,9 +39,16 @@ "scripts": { "browserify": "VERSION=${VERSION:-dev}; mkdir -p static/js/ && cd src && ../node_modules/browserify/bin/cmd.js Main.ts -p [ tsify ] --exclude kurento-browser-extensions --debug -o ../static/js/openvidu-browser-$VERSION.js -v", "browserify-prod": "VERSION=${VERSION:-dev}; mkdir -p static/js/ && cd src && ../node_modules/browserify/bin/cmd.js --debug Main.ts -p [ tsify ] --exclude kurento-browser-extensions | ../node_modules/terser/bin/terser --source-map content=inline --output ../static/js/openvidu-browser-$VERSION.min.js", - "build": "cd src/OpenVidu && ./../../node_modules/typescript/bin/tsc && cd ../.. && ./node_modules/typescript/bin/tsc --declaration src/index.ts --outDir ./lib --sourceMap --target es5 --lib dom,es5,es2015.promise,scripthost", + "build": "cd src/OpenVidu && ./../../node_modules/typescript/bin/tsc && cd ../.. && ./node_modules/typescript/bin/tsc --declaration src/index.ts --outDir ./lib --sourceMap --target es5 --lib dom,es5,es2015.promise,scripthost && rm -rf ./ts4.4 && mkdir -p ./ts4.4/lib && cp -r ./lib ./ts4.4 && find ./ts4.4/lib -type f ! -iname '*.d.ts' -delete && ./config/replace_for_ts44.sh", "docs": "./generate-docs.sh" }, "types": "lib/index.d.ts", + "typesVersions": { + "<4.4": { + "*": [ + "ts4.4/*" + ] + } + }, "version": "2.20.0" } diff --git a/openvidu-browser/src/OpenViduInternal/Events/EventMap/SessionEventMap.ts b/openvidu-browser/src/OpenViduInternal/Events/EventMap/SessionEventMap.ts index 979b52de..1663df30 100644 --- a/openvidu-browser/src/OpenViduInternal/Events/EventMap/SessionEventMap.ts +++ b/openvidu-browser/src/OpenViduInternal/Events/EventMap/SessionEventMap.ts @@ -19,6 +19,10 @@ export interface SessionEventMap { streamPropertyChanged: StreamPropertyChangedEvent; publisherStartSpeaking: PublisherSpeakingEvent; publisherStopSpeaking: PublisherSpeakingEvent; + /** + * @hidden + */ + [key: `signal:${string}`]: SignalEvent; signal: SignalEvent; recordingStarted: RecordingEvent; recordingStopped: RecordingEvent;