Laur's blog
Sign in Subscribe

assign

A collection of 1 post
Initialize a Typescript Interface with JSON
array

Initialize a Typescript Interface with JSON

TL;DR: You can initialise a typescript interface using JSON objects. On my quest to load and save objects as JSON, I found that you can convert a JSON object to an interface via something called type assertion. Basically, if you have an interface: export interface PathInterface { path: string enabled:
Feb 21, 2017 1 min read
Page 1 of 1
Laur's blog © 2025
  • Sign up
Powered by Ghost