From 8c03b7360eb4c70c66c42037d999fbf43430c8da Mon Sep 17 00:00:00 2001 From: Galad Dirie Date: Mon, 23 Sep 2024 21:16:57 -0400 Subject: [PATCH 1/2] Update: Add ApplicationEventHandler type definition and new event - Add ApplicationEventHandler type definition to app.bind - Add "onItemsAddedToProjectSuccess" ApplicationEvent --- Premiere/15.0/index.d.ts | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Premiere/15.0/index.d.ts b/Premiere/15.0/index.d.ts index 49befd7..6fdaf21 100644 --- a/Premiere/15.0/index.d.ts +++ b/Premiere/15.0/index.d.ts @@ -2068,6 +2068,7 @@ declare class PrProduction { type ApplicationEvent = | "onSourceClipSelectedInProjectPanel" + | "onItemsAddedToProjectSuccess" | "onSequenceActivated" | "onActiveSequenceChanged" | "onActiveSequenceSelectionChanged" @@ -2077,6 +2078,19 @@ type ApplicationEvent = | "onProjectChanged" | "onProjectEndDrop" +type ApplicationEventHandler = { + onSourceClipSelectedInProjectPanel: (items: ProjectItem[]) => void; + onItemsAddedToProjectSuccess: () => void; + onSequenceActivated: () => void; + onActiveSequenceChanged: () => void; + onActiveSequenceSelectionChanged: () => void; + onActiveSequenceTrackItemAdded: (track: Track, trackItem: TrackItem) => void; + onActiveSequenceTrackItemRemoved: (track: Track, trackItem: TrackItem) => void; + onActiveSequenceStructureChanged: () => void; + onProjectChanged: (documentID: string) => void; + onProjectEndDrop: () => void; +}; + /** * */ @@ -2164,7 +2178,7 @@ declare class Application { /** * */ - bind(eventName: ApplicationEvent, function_: Function): void + bind(eventName: T, function_: ApplicationEventHandler[T]): void; /** * From 42d0e0f67952f36ddb95a1cd0fdfde1e6e3bf971 Mon Sep 17 00:00:00 2001 From: Galad Dirie Date: Tue, 24 Sep 2024 15:53:38 -0400 Subject: [PATCH 2/2] Fix: unbind eventName is typed to ApplicationEvent --- Premiere/15.0/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Premiere/15.0/index.d.ts b/Premiere/15.0/index.d.ts index 6fdaf21..f0a2068 100644 --- a/Premiere/15.0/index.d.ts +++ b/Premiere/15.0/index.d.ts @@ -2310,7 +2310,7 @@ declare class Application { /** * */ - unbind(eventName: string): void + unbind(eventName: ApplicationEvent): void /** *