Features
- Automatic TypeScript interface generation
- Support for multiple serializer libraries (Alba,ActiveModel::Serializer,Oj::Serializer)
- File watching and automatic regeneration in development
Installation
To install Typelizer, add the following line to your Gemfile and run bundle install:
gem "typelizer"Usage
Basic Setup
Include the Typelizer DSL in your serializers:
class ApplicationResource
  include Alba::Resource
  include Typelizer::DSL
end
class PostResource < ApplicationResource
  attributes :id, :title, :body
  has_one :author, serializer: AuthorResource
end
class AuthorResource < ApplicationResource
  # specify the model to infer types from (optional)
  typelize_from User
  attributes :id, :name
endTypelizer will automatically generate TypeScript interfaces based on your serializer definitions using information from your models.


