top | item 42891949

(no title)

tonyg | 1 year ago

There are no string keys in the Person example above. You could add some, though, or use numbers instead with the same host-language API:

  Person = <person @name String @address Address>
as above, or

  Person = <person {
    @name "name": String
    @address "address": Address
  }>
or

  Person = {
    @name 1: String
    @address 2: Address
  }
etc. all produce the same host-language record, e.g. in TypeScript

  export type Person = {
    name: String,
    address: Address,
  };

discuss

order

No comments yet.