@twick/studio 0.14.10 → 0.14.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,13 @@
1
- import { TrackElement } from '@twick/timeline';
1
+ import { VideoElement, TrackElement } from '@twick/timeline';
2
+ import { ISubtitleGenerationPollingResponse, SubtitleEntry } from '../../types';
2
3
 
3
4
  interface PropertiesPanelContainerProps {
4
5
  selectedProp: string;
5
6
  selectedElement: TrackElement | null;
6
7
  updateElement: (element: TrackElement) => void;
8
+ addSubtitlesToTimeline: (subtitles: SubtitleEntry[]) => void;
9
+ onGenerateSubtitles: (videoElement: VideoElement) => Promise<string | null>;
10
+ getSubtitleStatus: (reqId: string) => Promise<ISubtitleGenerationPollingResponse>;
7
11
  }
8
- export declare function PropertiesPanelContainer({ selectedProp, selectedElement, updateElement, }: PropertiesPanelContainerProps): import("react/jsx-runtime").JSX.Element;
12
+ export declare function PropertiesPanelContainer({ selectedProp, selectedElement, updateElement, addSubtitlesToTimeline, onGenerateSubtitles, getSubtitleStatus, }: PropertiesPanelContainerProps): import("react/jsx-runtime").JSX.Element;
9
13
  export {};
@@ -1,3 +1,3 @@
1
1
  import { AudioPanelProps } from '../../types/media-panel';
2
2
 
3
- export declare const AudioPanel: ({ items, onItemSelect, onFileUpload, acceptFileTypes, onUrlAdd, }: AudioPanelProps) => import("react/jsx-runtime").JSX.Element;
3
+ export declare const AudioPanel: ({ items, onItemSelect, onUrlAdd, }: AudioPanelProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import { ImagePanelProps } from '../../types/media-panel';
2
2
 
3
- export declare function ImagePanel({ items, onItemSelect, onFileUpload, acceptFileTypes, onUrlAdd, }: ImagePanelProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare function ImagePanel({ items, onItemSelect, onUrlAdd, }: ImagePanelProps): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,3 @@
1
1
  import { VideoPanelProps } from '../../types/media-panel';
2
2
 
3
- export declare function VideoPanel({ items, onItemSelect, onFileUpload, acceptFileTypes, onUrlAdd, }: VideoPanelProps): import("react/jsx-runtime").JSX.Element;
3
+ export declare function VideoPanel({ items, onItemSelect, onUrlAdd, }: VideoPanelProps): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { TrackElement, VideoElement } from '@twick/timeline';
2
+ import { ISubtitleGenerationPollingResponse } from '../../types';
3
+
4
+ export declare function GenerateSubtitlesPanel({ selectedElement, addSubtitlesToTimeline, onGenerateSubtitles, getSubtitleStatus, }: {
5
+ selectedElement: TrackElement;
6
+ addSubtitlesToTimeline: (subtitles: {
7
+ s: number;
8
+ e: number;
9
+ t: string;
10
+ }[]) => void;
11
+ onGenerateSubtitles: (videoElement: VideoElement) => Promise<string | null>;
12
+ getSubtitleStatus: (reqId: string) => Promise<ISubtitleGenerationPollingResponse>;
13
+ }): import("react/jsx-runtime").JSX.Element;
@@ -1,3 +1,4 @@
1
1
  import { BrowserMediaManager } from '@twick/video-editor';
2
2
 
3
3
  export declare const getMediaManager: () => BrowserMediaManager;
4
+ export declare const initializeDefaultVideos: () => Promise<void>;
@@ -0,0 +1,21 @@
1
+ import { ProjectJSON, VideoElement } from '@twick/timeline';
2
+ import { ISubtitleGenerationPollingResponse, ISubtitleGenerationService, SubtitleEntry } from '../types';
3
+
4
+ declare class GenerateSubtitlesService implements ISubtitleGenerationService {
5
+ videoElement: VideoElement | null;
6
+ projectJSON: ProjectJSON | null;
7
+ generateSubtiltesApi: (videoUrl: string) => Promise<string>;
8
+ requestStatusApi: (reqId: string) => Promise<ISubtitleGenerationPollingResponse>;
9
+ constructor({ generateSubtiltesApi, requestStatusApi, }: {
10
+ generateSubtiltesApi: (videoUrl: string) => Promise<string>;
11
+ requestStatusApi: (reqId: string) => Promise<ISubtitleGenerationPollingResponse>;
12
+ });
13
+ generateSubtitles(videoElement: VideoElement, projectJSON: ProjectJSON): Promise<string>;
14
+ getRequestStatus(reqId: string): Promise<ISubtitleGenerationPollingResponse>;
15
+ updateProjectWithSubtitles(subtitles: SubtitleEntry[]): ProjectJSON;
16
+ generateSubtitleVideo(videoUrl: string, videoSize?: {
17
+ width: number;
18
+ height: number;
19
+ }): Promise<string>;
20
+ }
21
+ export default GenerateSubtitlesService;
@@ -1,8 +1,12 @@
1
- import { StudioConfig } from '../types';
1
+ import { VideoElement } from '@twick/timeline';
2
+ import { ISubtitleGenerationPollingResponse, StudioConfig, SubtitleEntry } from '../types';
2
3
 
3
4
  declare const useStudioOperation: (studioConfig?: StudioConfig) => {
4
5
  onLoadProject: () => Promise<void>;
5
6
  onSaveProject: () => Promise<void>;
6
7
  onExportVideo: () => Promise<void>;
8
+ onGenerateSubtitles: (videoElement: VideoElement) => Promise<string | null>;
9
+ addSubtitlesToTimeline: (subtitles: SubtitleEntry[]) => void;
10
+ getSubtitleStatus: (reqId: string) => Promise<ISubtitleGenerationPollingResponse>;
7
11
  };
8
12
  export default useStudioOperation;
package/dist/index.d.ts CHANGED
@@ -38,4 +38,5 @@ IconPanel, };
38
38
  export {
39
39
  /** Studio state management hook */
40
40
  useStudioManager, };
41
+ export * from './types';
41
42
  export default TwickStudio;