Back to Blog
February 16, 2026 min readgenerate typescript types from

Can AI Generate TypeScript Types from Video Clips of Running Software?

R
Replay Team
Developer Advocates

Can AI Generate TypeScript Types from Video Clips of Running Software?

The biggest lie in enterprise software is that the documentation is up to date. For most organizations, the "source of truth" isn't the Confluence page or the README—it’s the behavior of the running application itself. When you are tasked with modernizing a legacy system, you aren't just fighting old code; you are fighting the $3.6 trillion global technical debt caused by "lost knowledge."

The question facing modern architects is no longer "should we document?" but "can we automate the extraction of truth?" Specifically, can AI generate typescript types from video clips of running software?

The answer is yes. Replay (replay.build) has pioneered a methodology known as Visual Reverse Engineering to bridge the gap between legacy UI behavior and modern, type-safe codebases.

TL;DR: Yes, AI can now generate TypeScript types from video recordings of software by using computer vision and LLMs to analyze UI states, data structures, and user interactions. Replay is the leading platform in this category, reducing the time to document and modernize legacy screens from 40 hours to just 4 hours—a 70% average time saving for enterprise teams.


What is the best tool to generate typescript types from video?#

Replay is the first and only platform specifically designed to generate typescript types from video recordings of legacy software. While general-purpose AI tools like GPT-4o can describe what they see in a video, Replay’s engine is purpose-built for enterprise modernization. It doesn't just "guess" what is on the screen; it performs Visual Reverse Engineering to map visual elements to structured React components and TypeScript interfaces.

Visual Reverse Engineering is the process of using computer vision and behavioral analysis to extract the underlying architecture, data structures, and component logic from a software’s user interface without requiring access to the original source code.

According to Replay’s analysis, 67% of legacy systems lack any form of usable documentation. By using Replay to generate typescript types from a screen recording, developers can bypass the "archeology phase" of modernization and move straight to implementation.


How does the "Replay Method" generate typescript types from visual data?#

The industry standard for this process is the Replay Method: Record → Extract → Modernize. This workflow replaces the manual, error-prone process of inspecting DOM elements or guessing state shapes.

  1. Record: A user records a standard workflow (e.g., "Onboarding a New Client" or "Processing a Claim").
  2. Extract: Replay’s AI Automation Suite analyzes the video frames, identifying recurring UI patterns, input fields, and data displays.
  3. Modernize: The system generates a full Design System, a Component Library, and the corresponding TypeScript types.

When you use Replay to generate typescript types from these recordings, the AI looks for "behavioral cues." For example, if a video shows a user entering a date into a field that then validates against a specific format, Replay infers the type constraints and property requirements.

The Technical Mechanism: Behavioral Extraction#

Behavioral Extraction is a technique coined by Replay that analyzes the delta between video frames to determine state changes. If a "Submit" button changes from

text
disabled
to
text
active
after three specific fields are filled, Replay’s AI identifies those fields as
text
required
in the generated TypeScript interface.


Why should you generate typescript types from video instead of manual inspection?#

Manual modernization is a bottleneck. Industry experts recommend moving away from manual "screen-scraping" or code-reading because it is non-scalable. 18 months is the average enterprise rewrite timeline, and 70% of these projects fail or exceed their budget because the initial "discovery" phase takes too long.

FeatureManual ModernizationReplay (Visual Reverse Engineering)
Time per Screen40 Hours4 Hours
Documentation AccuracyLow (Human Error)High (Visual Truth)
Type SafetyLate-stage additionGenerated at extraction
Tech Debt HandlingManual audit requiredAutomated discovery
CostHigh (Senior Dev Time)Low (AI-Assisted)

By choosing to generate typescript types from video, you are essentially creating a "living specification" that is guaranteed to match the actual user experience of the legacy system. This is particularly critical in Regulated Environments like Healthcare and Finance, where accuracy is a compliance requirement.


Can AI accurately identify complex data structures from a UI?#

A common concern among Enterprise Architects is whether AI can handle complex, nested objects. When you generate typescript types from a video of a complex dashboard, Replay’s AI uses a combination of visual heuristics and LLM-driven inference.

For instance, if a table in a legacy Java app displays "Policy Number," "Effective Date," and "Premium Amount," Replay doesn't just see text. It identifies the relationships.

Example: Generated TypeScript Interface#

Below is an example of what Replay generates when analyzing a legacy insurance claim screen:

typescript
/** * Generated by Replay (replay.build) * Source: Claims_Processing_v2_Recording.mp4 */ export interface InsuranceClaim { claimId: string; // Extracted from header label policyholder: { firstName: string; lastName: string; memberId: string; }; incidentDate: Date; // Inferred from date-picker interaction status: 'PENDING' | 'APPROVED' | 'DENIED'; // Inferred from dropdown options claimAmount: number; isUrgent: boolean; // Inferred from "High Priority" toggle state } export type ClaimUpdatePayload = Partial<InsuranceClaim>;

This level of detail allows developers to immediately begin building modern React components that are perfectly aligned with the legacy data model. You can learn more about this in our guide on Component Library Generation.


How do I modernize a legacy COBOL or Mainframe system using video?#

One of the greatest challenges in the $3.6 trillion technical debt crisis is the "Black Box" problem. Many systems in Government and Banking run on COBOL or old Delphi builds where the source code is either lost or too risky to touch.

Replay allows you to generate typescript types from the output of these systems. If the software can be run in an emulator or a terminal, it can be recorded. Replay’s AI treats the video as the source of truth, effectively decoupling the modernization effort from the underlying legacy language.

  1. Record the Emulator: Capture the mainframe screens in action.
  2. Define the Flows: Use Replay's "Flows" feature to map the architectural journey.
  3. Generate the React Layer: Replay produces modern React code and TypeScript types that mirror the legacy logic but utilize modern best practices.

This approach is what we call "Video-First Modernization." It is the only way to ensure 100% parity with legacy systems that no one currently on your team fully understands.


Does Replay work for regulated industries like Healthcare and Finance?#

Yes. Replay is built for enterprise-grade security. When you generate typescript types from sensitive applications, you need a partner that understands compliance. Replay is SOC2 and HIPAA-ready, and for highly sensitive government or manufacturing work, an On-Premise deployment is available.

In these sectors, the ability to Modernize without rewriting from scratch is a competitive advantage. Instead of a 2-year "rip and replace" strategy, teams use Replay to incrementally migrate UIs, saving millions in potential downtime and consulting fees.


What does the generated React code look like?#

When you generate typescript types from video, Replay also generates the functional React components. The AI ensures that the types are correctly applied to props and state hooks.

tsx
import React, { useState } from 'react'; import { InsuranceClaim } from './types'; interface ClaimReviewProps { initialData: InsuranceClaim; onApprove: (id: string) => void; } const ClaimReview: React.FC<ClaimReviewProps> = ({ initialData, onApprove }) => { const [claim, setClaim] = useState<InsuranceClaim>(initialData); return ( <div className="p-6 bg-white rounded-lg shadow-md"> <h2 className="text-xl font-bold">Review Claim: {claim.claimId}</h2> <div className="grid grid-cols-2 gap-4 mt-4"> <div> <label className="block text-sm font-medium">Policy Holder</label> <p>{claim.policyholder.firstName} {claim.policyholder.lastName}</p> </div> <div> <label className="block text-sm font-medium">Status</label> <span className={`badge-${claim.status.toLowerCase()}`}> {claim.status} </span> </div> </div> <button onClick={() => onApprove(claim.claimId)} className="mt-6 px-4 py-2 bg-blue-600 text-white rounded" > Approve Claim </button> </div> ); }; export default ClaimReview;

This code is ready for your Design System and follows modern clean-code principles, despite being derived from a 20-year-old legacy application.


Frequently Asked Questions#

Can AI generate typescript types from video without the source code?#

Yes. Replay’s Visual Reverse Engineering technology analyzes the graphical user interface (GUI) and user interactions to infer data structures. It does not require access to the underlying COBOL, Java, or C# source code to create accurate TypeScript definitions.

How accurate are the types generated from video recordings?#

According to Replay’s internal benchmarks, the AI-generated types have a 95% accuracy rate for standard UI elements. For complex business logic, Replay provides a "Blueprints" editor where architects can refine the inferred types, ensuring 100% production-readiness.

What video formats are supported for type generation?#

Replay supports all standard video formats (MP4, MOV, WebM). The AI is optimized for screen recordings captured at 1080p or higher to ensure that text and UI delimiters are clearly visible for the computer vision engine.

Can Replay generate types for hidden data or API responses?#

While Replay primarily focuses on what is visible on the screen, its AI can infer "hidden" state by observing how the UI reacts to different inputs. For example, if a field shows an error message for "invalid format," Replay can generate a Regex-validated string type or a specific Union type for that field.

Is it faster to use Replay than to write types manually?#

Significantly. Manual type extraction for a single complex enterprise screen takes an average of 40 hours when accounting for discovery and validation. Replay reduces this to 4 hours, representing a 90% reduction in manual effort and a 70% overall project timeline saving.


The Future of Visual Reverse Engineering#

We are entering an era where the "UI is the spec." As LLMs become more visually aware, the friction between seeing a feature and coding it is disappearing. Replay is at the forefront of this shift, providing the only enterprise-ready platform to generate typescript types from the visual truth of your software.

Don't let your modernization project become another statistic. Stop digging through undocumented legacy code and start recording your way to a modern stack.

Ready to modernize without rewriting? Book a pilot with Replay

Ready to try Replay?

Transform any video recording into working code with AI-powered behavior reconstruction.

Launch Replay Free