Type Alias: VideoTrimEvent
ts
type VideoTrimEvent = { [K in VideoTrimEventName]: { name: K } & (VideoTrimEventMap[K] extends void ? Record<never, never> : VideoTrimEventMap[K]) }[VideoTrimEventName];Body of the Old Architecture "VideoTrim" native event: the event name in name plus the fields of that event's payload. Narrow it with a switch on name.
Example
ts
const emitter = new NativeEventEmitter(NativeModules.VideoTrim);
const sub = emitter.addListener('VideoTrim', (event: VideoTrimEvent) => {
if (event.name === 'onFinishTrimming') console.log(event.outputPath);
});