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

TypeScript type for `Object#objectSchema()` could be narrowed

      Problem

      In its current form the return type declared for Realm#objectSchema() is an ObjectSchema, when in-fact we know that this will return the "canonical" schema representation, which is much more narrow.

      In particular:

      • All optional values will actually have values.
      • The type of properties will always be a Record<string, ObjectSchemaProperty>.

      Solution

      Split up the types in the more loose "write" types that users can provide and "read" types for values returned by our more predictable implementation.

      How important is this improvement for you?

      Fairly niche, but nice to have anyway.

            Assignee:
            Unassigned Unassigned
            Reporter:
            kraen.hansen@mongodb.com Kræn Hansen
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: