typescript-types

Generate TypeScript declaration files for JavaScript modules and components.

Updated Aug 25, 2018
One-click install
npx skills add https://github.com/metabench/jsgui3-html --skill typescript-types
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: typescript-types
Source: https://github.com/metabench/jsgui3-html/tree/main/docs/agi/skills/typescript-types
Command: npx skills add https://github.com/metabench/jsgui3-html --skill typescript-types

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill automates the creation and maintenance of TypeScript declaration files (.d.ts) for JavaScript projects, improving code quality, developer experience, and enabling better tooling support.

Core Features & Use Cases

  • Automated .d.ts Generation: Creates type definitions for JavaScript modules, classes, and functions.
  • API Surface Typing: Defines interfaces for constructor parameters, methods, properties, and return types.
  • Use Case: When integrating a new JavaScript library into a TypeScript project, this Skill can generate the necessary type definitions, allowing for static type checking and autocompletion.

Quick Start

Use the typescript-types skill to generate .d.ts files for the file 'window.js'.

Frequently Asked Questions about typescript-types

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I generate TypeScript declaration files for JavaScript modules?

To generate TypeScript declaration files, this Skill analyzes existing JavaScript components and modules to create .d.ts files. It defines interfaces for parameters, methods, and return types, ensuring compatibility and discoverability for TypeScript consumers.

Can I automatically define interfaces for constructor parameters and return types in JS code?

Yes, automated API surface typing defines interfaces for constructor parameters, methods, properties, and return types. This process creates comprehensive type definitions for your JavaScript modules to enable static type checking.

What is the best way to integrate a JavaScript library into a TypeScript project?

The best way to integrate a JavaScript library is by generating necessary type definitions. This Skill creates .d.ts files that allow for static type checking and autocompletion, updating package.json exports to facilitate seamless integration.

Does this tool update package.json exports when generating .d.ts files?

Yes, this Skill updates package.json exports to facilitate seamless integration. Alongside generating TypeScript declaration files for JavaScript components, it ensures the new type definitions are properly exported for TypeScript consumers.

When do I need to generate TypeScript types for JavaScript code?

You need to generate TypeScript types when integrating a new JavaScript library into a TypeScript project. Creating .d.ts files improves code quality, developer experience, and enables better tooling support like autocompletion and static type checking.