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

TypeScript issue when using a Realm.Set<T> prop using babel plugin

      I'm using the Babel plugin syntax and using a Realm.Set<T> prop but I got a type error saying that the prop does no exist:

      I think you guys need to take a look at this RemappedRealmTypes<T>

      https://github.com/realm/realm-js/blob/5dbdb29fafc66f6f4df4e37562b57f1321990e22/types/index.d.ts#L1120

      If I add a RealmSetsRemappedModelPart type, for example something like below, the error goes away.

      Unable to find source-code formatter for language: ts. 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
      type RealmSetsRemappedModelPart<T> = {
          [K in ExtractPropertyNamesOfType<T, Realm.Set<any>>]?: T[K] extends Realm.Set<infer GT> ? Array<GT | Unmanaged<GT>> : never
      }
      
      type RemappedRealmTypes<T> =
          RealmListsRemappedModelPart<T> &
          RealmDictionaryRemappedModelPart<T> &
          RealmSetsRemappedModelPart<T>;
      
      

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

              Created:
              Updated: