PHP code example of paneon / php-to-typescript-bundle

1. Go to this page and download the library: Download paneon/php-to-typescript-bundle library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

paneon / php-to-typescript-bundle example snippets




/**
 * @TypeScriptInterface
 */
class Example
{
    /**
     * @var string
     */
    public $firstName;

    /**
     * @var string|null
     */
    public $middleName;

    /**
     * @var string
     */
    public $lastName;

    /**
     * @var int|null
     */
    public $age;
    
    /** @var Contact[] */
    public $contacts;
}
bash
$ composer req paneon/php-to-typescript-bundle
bash
$ php bin/console typescript:generate-single vendor/some-package/src/SomeDir/DTO/SomeoneElsesClass.php assets/js/external/some-package/