iq2i / typescript-types-bundle
Symfony bundle that downloads TypeScript type definitions from npm packages via jsDelivr CDN, enabling IDE autocompletion with Symfony AssetMapper.
Package info
github.com/IQ2i/typescript-types-bundle
Type:symfony-bundle
pkg:composer/iq2i/typescript-types-bundle
Requires
- php: >=8.1
- symfony/console: ^6.4|^7.4|^8.0
- symfony/framework-bundle: ^6.4|^7.4|^8.0
- symfony/http-client: ^6.4|^7.4|^8.0
- symfony/http-kernel: ^6.4|^7.4|^8.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.52
- phpstan/phpstan: ^2.1
- phpstan/phpstan-symfony: ^2.0
- phpunit/phpunit: ^10.5
This package is auto-updated.
Last update: 2026-03-02 15:42:21 UTC
README
Symfony bundle that downloads TypeScript type definitions (.d.ts files) from npm packages via the jsDelivr CDN, enabling IDE autocompletion when using TypeScript with Symfony AssetMapper.
Installation
composer require --dev iq2i/typescript-types-bundle
If you don't use Symfony Flex, enable the bundle manually in config/bundles.php:
return [ IQ2i\TypescriptTypesBundle\IQ2iTypescriptTypesBundle::class => ['all' => true], ];
Usage
Download TypeScript type definitions for all packages declared in importmap.php:
php bin/console typescript:types:download
The command reads your importmap.php file, resolves type definitions for each versioned package, and downloads them into assets/vendor/@types/<package>/.
For scoped packages, the / separator is replaced with __ (e.g. @hotwired/stimulus → assets/vendor/@types/@hotwired/stimulus/).
tsconfig.json
After downloading, the command automatically creates or updates tsconfig.json at the root of your project with the appropriate paths configuration so your IDE can resolve the types:
{
"compilerOptions": {
"paths": {
"@hotwired/stimulus": ["./assets/vendor/@types/@hotwired/stimulus"]
}
}
}
If tsconfig.json already exists, only missing or outdated paths are added.
Documentation
See docs/index.md for the full documentation.
License
This bundle is released under the MIT License.