Skip to content

Commit 4cd40bd

Browse files
committed
Update types based on latest tag
1 parent bb950a6 commit 4cd40bd

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

scripts/build-types.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,14 @@ const headers = {
7979

8080
// Defaulting to the branch for now to get the latest docs-only changes
8181
let commit = process.argv[2] ?? process.env.GH_COMMIT ?? 'master';
82+
// Get the latest tag
8283
if (!commit) {
83-
const {body: release} = await got('https://api.github.com/repos/obsproject/obs-websocket/releases/latest', {
84+
const {body: tags} = await got('https://api.github.com/repos/obsproject/obs-websocket/tags', {
8485
headers,
8586
responseType: 'json',
8687
});
87-
commit = (release as JsonObject).tag_name as string;
88+
// @ts-expect-error cba typing the response
89+
commit = tags[0].name as string;
8890
}
8991

9092
const {body: protocol} = await got<GeneratedProtocol>(`https://raw.githubusercontent.com/obsproject/obs-websocket/${commit}/docs/generated/protocol.json`, {

src/types.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -838,6 +838,12 @@ export interface OBSEventTypes {
838838
*/
839839
studioModeEnabled: boolean;
840840
};
841+
ScreenshotSaved: {
842+
/**
843+
* Path of the saved image file
844+
*/
845+
savedScreenshotPath: string;
846+
};
841847
VendorEvent: {
842848
/**
843849
* Name of the vendor emitting the event

0 commit comments

Comments
 (0)