@re-shell/cli
Version:
Full-stack development platform uniting microservices and microfrontends. Build complete applications with .NET (ASP.NET Core Web API, Minimal API), Java (Spring Boot, Quarkus, Micronaut, Vert.x), Rust (Actix-Web, Warp, Rocket, Axum), Python (FastAPI, Dja
399 lines (398 loc) • 9.98 kB
TypeScript
import { EventEmitter } from 'events';
export interface VideoTutorialConfig {
outputPath?: string;
recordingsPath?: string;
transcriptsPath?: string;
videoFormats?: VideoFormat[];
resolutions?: VideoResolution[];
generateTranscripts?: boolean;
generateSubtitles?: boolean;
generateChapters?: boolean;
includeCodeSnippets?: boolean;
includeInteractiveElements?: boolean;
customBranding?: BrandingConfig;
publishTargets?: PublishTarget[];
}
export interface BrandingConfig {
logo?: string;
watermark?: string;
introVideo?: string;
outroVideo?: string;
colorScheme?: ColorScheme;
fonts?: FontConfig;
music?: MusicConfig;
}
export interface ColorScheme {
primary: string;
secondary: string;
accent: string;
background: string;
text: string;
}
export interface FontConfig {
title: string;
body: string;
code: string;
sizes: {
title: number;
subtitle: number;
body: number;
code: number;
};
}
export interface MusicConfig {
intro?: string;
background?: string;
outro?: string;
volume: number;
}
export type VideoFormat = 'mp4' | 'webm' | 'avi' | 'mov' | 'mkv';
export type VideoResolution = '720p' | '1080p' | '1440p' | '4k';
export type PublishTarget = 'youtube' | 'vimeo' | 'website' | 'docs' | 'social';
export interface VideoTutorial {
id: string;
title: string;
description: string;
duration: number;
difficulty: 'beginner' | 'intermediate' | 'advanced';
topics: string[];
prerequisites?: string[];
script: TutorialScript;
recordings?: Recording[];
assets: TutorialAssets;
chapters: Chapter[];
metadata: VideoMetadata;
}
export interface TutorialScript {
scenes: Scene[];
voiceover?: VoiceoverScript;
captions: Caption[];
annotations: Annotation[];
}
export interface Scene {
id: string;
title: string;
duration: number;
type: 'intro' | 'demo' | 'explanation' | 'code' | 'summary' | 'outro';
content: SceneContent;
transitions: Transition[];
}
export interface SceneContent {
narration?: string;
actions: Action[];
highlights?: Highlight[];
codeBlocks?: CodeBlock[];
diagrams?: Diagram[];
}
export interface Action {
timestamp: number;
type: 'click' | 'type' | 'scroll' | 'navigate' | 'highlight' | 'zoom';
target?: string;
value?: string;
duration?: number;
description: string;
}
export interface Highlight {
timestamp: number;
area: Rectangle;
style: HighlightStyle;
duration: number;
label?: string;
}
export interface Rectangle {
x: number;
y: number;
width: number;
height: number;
}
export interface HighlightStyle {
color: string;
opacity: number;
borderWidth: number;
borderStyle: 'solid' | 'dashed' | 'dotted';
animation?: 'pulse' | 'fade' | 'slide';
}
export interface CodeBlock {
timestamp: number;
language: string;
code: string;
fileName?: string;
lineNumbers?: boolean;
highlightLines?: number[];
duration: number;
}
export interface Diagram {
timestamp: number;
type: 'flowchart' | 'architecture' | 'sequence' | 'graph';
content: string;
format: 'mermaid' | 'svg' | 'png';
duration: number;
}
export interface VoiceoverScript {
narrator: 'ai' | 'human';
voice?: string;
speed: number;
pitch: number;
segments: VoiceSegment[];
}
export interface VoiceSegment {
sceneId: string;
text: string;
timestamp: number;
duration: number;
emotions?: string[];
}
export interface Caption {
timestamp: number;
duration: number;
text: string;
position?: 'top' | 'bottom' | 'custom';
style?: CaptionStyle;
}
export interface CaptionStyle {
fontSize: number;
color: string;
backgroundColor: string;
fontFamily: string;
opacity: number;
}
export interface Annotation {
timestamp: number;
type: 'text' | 'arrow' | 'box' | 'circle' | 'line';
content: string;
position: Position;
style: AnnotationStyle;
duration: number;
}
export interface Position {
x: number;
y: number;
anchor?: 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'center';
}
export interface AnnotationStyle {
color: string;
fontSize?: number;
fontWeight?: string;
backgroundColor?: string;
borderColor?: string;
borderWidth?: number;
arrowStyle?: 'solid' | 'dashed';
}
export interface Transition {
type: 'fade' | 'slide' | 'zoom' | 'wipe' | 'dissolve';
duration: number;
direction?: 'left' | 'right' | 'up' | 'down';
}
export interface Recording {
id: string;
sceneId: string;
filePath: string;
format: VideoFormat;
resolution: VideoResolution;
duration: number;
fileSize: number;
metadata: RecordingMetadata;
}
export interface RecordingMetadata {
recordedAt: Date;
device: string;
software: string;
framerate: number;
bitrate: number;
audioChannels: number;
}
export interface TutorialAssets {
thumbnails: Thumbnail[];
overlays: Overlay[];
backgroundMusic?: MusicTrack[];
soundEffects?: SoundEffect[];
images: ImageAsset[];
fonts: FontAsset[];
}
export interface Thumbnail {
id: string;
title: string;
filePath: string;
resolution: string;
timestamp?: number;
}
export interface Overlay {
id: string;
type: 'logo' | 'watermark' | 'banner' | 'lower-third';
filePath: string;
position: Position;
opacity: number;
displayTime?: {
start: number;
end: number;
};
}
export interface MusicTrack {
id: string;
title: string;
filePath: string;
duration: number;
volume: number;
fadeIn?: number;
fadeOut?: number;
}
export interface SoundEffect {
id: string;
name: string;
filePath: string;
timestamp: number;
volume: number;
}
export interface ImageAsset {
id: string;
filePath: string;
alt: string;
dimensions: {
width: number;
height: number;
};
}
export interface FontAsset {
id: string;
family: string;
filePath: string;
weight: string;
style: string;
}
export interface Chapter {
id: string;
title: string;
startTime: number;
endTime: number;
description?: string;
keyPoints: string[];
}
export interface VideoMetadata {
tags: string[];
category: string;
language: string;
targetAudience: string[];
learningObjectives: string[];
relatedTutorials?: string[];
resources?: Resource[];
}
export interface Resource {
type: 'documentation' | 'code' | 'article' | 'video';
title: string;
url: string;
description?: string;
}
export interface InteractiveGuide {
id: string;
title: string;
description: string;
difficulty: 'beginner' | 'intermediate' | 'advanced';
estimatedTime: number;
steps: InteractiveStep[];
checkpoints: Checkpoint[];
achievements: Achievement[];
}
export interface InteractiveStep {
id: string;
title: string;
description: string;
type: 'instruction' | 'action' | 'verification' | 'quiz';
content: StepContent;
validation?: StepValidation;
hints?: string[];
nextStep?: string;
}
export interface StepContent {
text?: string;
code?: string;
command?: string;
expectedOutput?: string;
diagram?: string;
video?: string;
interactive?: InteractiveElement;
}
export interface InteractiveElement {
type: 'terminal' | 'editor' | 'browser' | 'diagram';
initialState?: any;
allowedActions?: string[];
targetState?: any;
}
export interface StepValidation {
type: 'exact' | 'contains' | 'regex' | 'custom';
value: string;
errorMessage?: string;
successMessage?: string;
}
export interface Checkpoint {
id: string;
afterStep: string;
title: string;
description: string;
validation: CheckpointValidation;
}
export interface CheckpointValidation {
checks: ValidationCheck[];
requireAll: boolean;
}
export interface ValidationCheck {
type: 'file_exists' | 'command_output' | 'code_contains' | 'test_passes';
target: string;
expected: string;
description: string;
}
export interface Achievement {
id: string;
title: string;
description: string;
icon: string;
condition: AchievementCondition;
points: number;
}
export interface AchievementCondition {
type: 'complete_guide' | 'speed_run' | 'no_hints' | 'perfect_score' | 'streak';
value: number;
}
export interface VideoGenerationResult {
tutorialsGenerated: number;
videosCreated: number;
guidesCreated: number;
totalDuration: number;
outputPath: string;
publishedTo: string[];
}
export declare class VideoTutorialGenerator extends EventEmitter {
private config;
private tutorials;
private guides;
private recordings;
constructor(config?: VideoTutorialConfig);
generateVideoTutorials(): Promise<VideoGenerationResult>;
private initializeBuiltInTutorials;
private initializeBuiltInGuides;
private addTutorial;
private addGuide;
private generateScript;
private generateReadableScript;
private createVisualAssets;
private generateTitleCard;
private generateChapterCard;
private generateEndScreen;
private generateVideo;
private generateTranscript;
private generateSubtitles;
private generateInteractiveGuide;
private generateGuideHTML;
private generateGuideJS;
private generateGuideCSS;
private generateTutorialIndex;
private generateLearningPlatform;
private publishToTarget;
private calculateTotalDuration;
private getSceneStartTime;
private isInScene;
private formatTime;
private formatTimeVTT;
private formatTimeSRT;
searchTutorials(query: string): Promise<VideoTutorial[]>;
getProgress(userId: string): Promise<any>;
}