TextText-based
text/x-typescript
TypeScript Source (Text)
Reference for text/x-typescript, the text MIME type for TypeScript source files in web and Node.js development.
MIME Type Detector
Drop a file to detect its MIME type — no upload, runs in your browser
📄
Drop any file here or click to choose
Expected extensions: .ts, .tsx
HTTP Content-Type Header
HTTP Header
Content-Type: text/x-typescript; charset=utf-8Associated File Extensions
.ts.tsx
Quick Facts
| MIME Type | text/x-typescript |
| Category | Text |
| Type | Text-based (human-readable) |
| Extensions | .ts, .tsx |
Common Usage
TypeScript adds static types to JavaScript for better tooling and reliability. It is used for React, Angular, Vue.js, Node.js, Deno, and large-scale web applications.
TypeScript compiles to JavaScript and runs anywhere JavaScript does.
Code Examples
HTML
<!-- Link or embed with explicit type -->
<link rel="stylesheet" href="file.ts" type="text/x-typescript">
<!-- Or for script/media elements -->
<script type="text/x-typescript" src="file.ts"></script>Node.js
// Express.js
app.get('/file', (req, res) => {
res.type('text/x-typescript');
res.send(data);
});
// Node.js http
res.writeHead(200, { 'Content-Type': 'text/x-typescript' });nginx
# nginx.conf — add to types block or use default
types {
text/x-typescript ts tsx;
}
# Or set for a specific location
location /api/ {
default_type text/x-typescript;
}Related MIME Types
More Text MIME Types
Other text types in the Text family
Related Tools
Explore More MIME Types
Browse our complete reference of 185 MIME types with usage examples, HTTP headers, and code snippets.