承接 baraja-core/entity-to-typescript 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

baraja-core/entity-to-typescript

最新稳定版本:v1.0.1

Composer 安装命令:

composer require baraja-core/entity-to-typescript

包简介

Convert any PHP entity to TypeScript.

README 文档

README

Tool for simple conversion of PHP model entities to TypeScript.

  • No Composer package dependencies
  • Native support for PHP property types and annotations
  • Analyze dependent entities recursively including arrays
  • Native support for TypeScript Record like Record<number, Record<boolean, Record<string, number>>>;
  • Unique interface names when scanning multiple entities

How to use

// create service instance (no dependency needed!)
$service = new EntityToTypescript();

// analyze your service and write dependencies to bag
$bag = new DependencyBag();
$bag = $service->process(SampleEntity::class, $bag);

// render TypeScript to string
echo $service->render($bag);

The principle of storing dependencies in Badge

When scanning a passed PHP entity, dependent entities are also recursively scanned, including annotations and compound types such as PHP arrays. Information about all scanned entities is stored in a common location in a so-called Badge, which ensures that the names of all generated interfaces are unique.

If you need to generate TypeScript definitions for a group of multiple entities, or an entire project, simply pass the same Badge instance to multiple generations.

统计信息

  • 总下载量: 57
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 3
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 3
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2022-11-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固