Uploaded image for project: 'Realm JavaScript SDK'
  1. Realm JavaScript SDK
  2. RJS-2093

Defining typescript schema with "extends Realm.Object" not support dictionary, embed model and linking objects

      Problem

      I am using @realm/babel-plugin@0.1.1, it seems currently only support simple types, but not:

      • dictionary with typescript interface
      • typescript enum
      • typescript union type
      • embed model
      • linking objects

      Is there a plan to support them or I missed something to know?
      Currrently I need to use the old way of defining schema property to make my models work.

      A little example:

      Unable to find source-code formatter for language: typescript. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
      export class NoteModel extends Realm.Object<NoteModel> {
        // @ts-ignore
        static name = "Note";
        static primaryKey = "_id";
      
        _id: Realm.Types.ObjectId = new Realm.BSON.ObjectId();
        createdAt: Realm.Types.Date = new Date();
        title!: string;
      
        // not work
        meta!: Realm.Types.Dictionary< {
          type: string;
          count: number;
        }>
        
       // not work
        status!: MyEmbedModel
      }
      
      export class MyEmbedModel extends Realm.Object<MyEmbedModel> {
        // @ts-ignore
        static name = "Status";
        static embedded = true;
      
        enabled!: boolean;
      }
      

      Solution

      No response

      How important is this improvement for you?

      Would be a major improvement

            Assignee:
            Unassigned Unassigned
            Reporter:
            unitosyncbot Unito Sync Bot
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: