javascript: Resolve remaining API Extractor "forgotten exports"
Follow-up to https://github.com/automerge/automerge/pull/1545.
Some of the types are not handled in the PR as they warrant more attention: ScalarValue_2, Automerge, API_2, ChangeToEncode, and JsSyncState.
For ScalarValue_2 (ScalarValue in raw wasm), it cannot be exported as ScalarValue because there already exists a type with that name which is similar but includes Counter and ImmutableString. The raw wasm ScalarValue is referenced by the public Mark, MarkSet, and Value. The raw shape is identical to MarkValue. We could either:
- Point
Mark/MarkSetatMarkValue - Alias the wasm type to
MarkScalarValue
For Automerge, API_2, and ChangeToEncode, these are all under @hidden escape hatches. We could either:
- Export the types, but this makes internals part of the public API
- Mark the functions as
@internaland strip them from the public API, which is a breaking change
JsSyncState is intentionally opaque SyncState (JsSyncState & { _opaque }). We could again either:
- Export it
- Restructure things so that it isn't referenced by name
Source: automerge/automerge