a11y.skipToMainContent
1

JSON 에 TypeScript

JSON 페이로드를 붙여서 즉시 TypeScript 인터페이스(또는 타입 별칭)을 얻습니다. 선택적 또는 readonly로 모든 속성을 표시합니다. API 모성 자료, 정착물, 또는 빠른 유형 stubs를 위해 유용한.

Was this tool helpful?
Send output to:
Advertisement

How to use JSON to TypeScript

  1. Paste 유효한 JSON.
  2. Root 인터페이스 이름을 설정합니다.
  3. 인터페이스 또는 유형 별칭 및 옵션 플래그를 선택합니다.
  4. 생성된 TypeScript를 복사합니다.

JSON을 TypeScript로 변환은 무엇입니까?

도구는 JSON 트리를 걸어, infers type (string / number / boolean / null / array / object), recursively 각 객체의 이름 인터페이스를 생성하고 깨끗한 TypeScript 파일로 조립합니다. 혼합 형 배열은 조합 배열 (예를들면, (string | number)[])가 됩니다.

Advertisement

FAQ

차별된 조합은 어떨까요?
자동 감지되지 않음. 도구는 단일 샘플에서 구조 유형을 생성합니다. 당신이 다수 표본이 있는 경우에 Hand-merge 조합.
API 응답을 입력하는 것이 유용합니까?
API에서 JSON을 절대로 파서, 문서, 또는 프론트엔드 코드의 TypeScript 인터페이스를 생성합니다.
심하게 배열 된 JSON 구조를 지원합니까?
예, 그것은 포괄적인 TypeScript 유형 정의를 만들기 위해 배열 된 객체와 배열을 처리합니다.

Related tools

Author

MW
Marcus Webb"The DevTool Craftsman"

Full-Stack Developer & Tools Architect

Marcus has been writing code since the dial-up era. He has contributed to open-source developer tools, built CI/CD pipelines for startups, and debugged production incidents at 3 AM more times than he would like to admit. His philosophy is that the best developer tool is the one that gets out of your way, and he writes about practical tooling that helps teams ship faster with fewer headaches.

Advertisement