diff --git a/indexedDb/implementation.go b/indexedDb/implementation.go index f8159c5156bd3796cdbe742d1e34e9bd8a8dd458..e88499d22e452013be2c39de73f057a74ec163fd 100644 --- a/indexedDb/implementation.go +++ b/indexedDb/implementation.go @@ -28,7 +28,7 @@ import ( ) // dbTimeout is the global timeout for operations with the storage -// context.Contact. +// [context.Context]. const dbTimeout = time.Second // wasmModel implements [channels.EventModel] interface, which uses the channels diff --git a/utils/convert.go b/utils/convert.go index 6f4be8fd876b64da85895064a95eb4ae69d991d5..121112045ebbf573655f68a30235921f53a455c1 100644 --- a/utils/convert.go +++ b/utils/convert.go @@ -14,16 +14,16 @@ import ( "syscall/js" ) -// CopyBytesToGo copies the Uint8Array stored in the js.Value to []byte. This is -// a wrapper for js.CopyBytesToGo to make it more convenient. +// CopyBytesToGo copies the [Uint8Array] stored in the [js.Value] to []byte. +// This is a wrapper for [js.CopyBytesToGo] to make it more convenient. func CopyBytesToGo(src js.Value) []byte { b := make([]byte, src.Length()) js.CopyBytesToGo(b, src) return b } -// CopyBytesToJS copies the []byte to a Uint8Array stored in a js.Value. This is -// a wrapper for js.CopyBytesToJS to make it more convenient. +// CopyBytesToJS copies the []byte to a [Uint8Array] stored in a [js.Value]. +// This is a wrapper for [js.CopyBytesToJS] to make it more convenient. func CopyBytesToJS(src []byte) js.Value { dst := Uint8Array.New(len(src)) js.CopyBytesToJS(dst, src) diff --git a/wasm/delivery.go b/wasm/delivery.go index 74cbf0386667332555856dcc1f44060cf12cf575..937ab3db87923069ab2a0753aa95420ee55d3733 100644 --- a/wasm/delivery.go +++ b/wasm/delivery.go @@ -52,7 +52,7 @@ type messageDeliveryCallback struct { // monitored. Returns false if all rounds statuses were returned (boolean). // - roundResults - rounds contains a mapping of all previously requested // rounds to their respective round results. Marshalled bytes of -// map[id.Round]cmix.RoundResult (Uint8Array). +// map[[id.Round]][cmix.RoundResult] (Uint8Array). func (mdc *messageDeliveryCallback) EventCallback( delivered, timedOut bool, roundResults []byte) { mdc.eventCallback(delivered, timedOut, utils.CopyBytesToJS(roundResults)) diff --git a/wasm/e2eHandler.go b/wasm/e2eHandler.go index 5f63de183d0490b7e40337e50fe6f0b110800434..1929b3539ba721e1b0157a194cecf4964a238c83 100644 --- a/wasm/e2eHandler.go +++ b/wasm/e2eHandler.go @@ -28,7 +28,7 @@ func (e *E2e) GetReceptionID(js.Value, []js.Value) interface{} { // - args[0] - Marshalled bytes of the partner [id.ID] (Uint8Array). // // Returns: -// - Throws utils.TypeError if deleting the partner fails. +// - Throws TypeError if deleting the partner fails. func (e *E2e) DeleteContact(_ js.Value, args []js.Value) interface{} { err := e.api.DeleteContact(utils.CopyBytesToGo(args[0])) if err != nil { diff --git a/wasm/ud.go b/wasm/ud.go index 9a373d7656850d18d6f40743615c4f8ede90dc71..ab90997be686172e3580722ca5355c4924595bd8 100644 --- a/wasm/ud.go +++ b/wasm/ud.go @@ -198,9 +198,9 @@ func (ud *UserDiscovery) GetContact(js.Value, []js.Value) interface{} { return utils.CopyBytesToJS(c) } -// ConfirmFact confirms a fact first registered via SendRegisterFact. The -// confirmation ID comes from SendRegisterFact while the code will come over the -// associated communications system. +// ConfirmFact confirms a fact first registered via [SendRegisterFact]. The +// confirmation ID comes from [SendRegisterFact] while the code will come over +// the associated communications system. // // Parameters: // - args[0] - Confirmation ID (string). @@ -290,8 +290,8 @@ type udLookupCallback struct { callback func(args ...interface{}) js.Value } -// Callback is called by LookupUD to return the contact that matches the passed -// in ID. +// Callback is called by [LookupUD] to return the contact that matches the +// passed in ID. // // Parameters: // - contactBytes - Marshalled bytes of the [contact.Contact] returned from the @@ -349,8 +349,8 @@ type udSearchCallback struct { callback func(args ...interface{}) js.Value } -// Callback is called by SearchUD to return a list of [contact.Contact] objects -// that match the list of facts passed into SearchUD. +// Callback is called by [SearchUD] to return a list of [contact.Contact] +// objects that match the list of facts passed into [SearchUD]. // // Parameters: // - contactListJSON - JSON of an array of [contact.Contact], or nil if an diff --git a/wasm/vars.go b/wasm/vars.go index d748c5eebf364307a077a8787ec10df313cee50c..b8c5b6eeb7e2b41bf1cd96ba1af9fb22c9a8035d 100644 --- a/wasm/vars.go +++ b/wasm/vars.go @@ -11,11 +11,13 @@ import ( "github.com/spf13/jwalterweatherman" "gitlab.com/elixxir/client/catalog" "gitlab.com/elixxir/client/channels" + "gitlab.com/elixxir/client/cmix" "gitlab.com/elixxir/client/cmix/message" "gitlab.com/elixxir/client/connect" "gitlab.com/elixxir/client/e2e/ratchet/partner" ftE2e "gitlab.com/elixxir/client/fileTransfer/e2e" "gitlab.com/elixxir/client/groupChat/groupStore" + "gitlab.com/elixxir/client/restlike" "gitlab.com/elixxir/client/single" "gitlab.com/elixxir/crypto/channel" "gitlab.com/elixxir/crypto/contact" @@ -23,6 +25,7 @@ import ( "gitlab.com/elixxir/crypto/fileTransfer" "gitlab.com/elixxir/crypto/group" "gitlab.com/elixxir/primitives/fact" + "gitlab.com/elixxir/primitives/format" "gitlab.com/xx_network/primitives/id" "gitlab.com/xx_network/primitives/id/ephemeral" "gitlab.com/xx_network/primitives/ndf" @@ -33,7 +36,9 @@ import ( var ( _ = id.ID{} _ = ephemeral.Id{} + _ = id.Round(0) _ = contact.Contact{} + _ = cmix.RoundResult{} _ = single.RequestParams{} _ = channels.Manager(nil) _ = catalog.MessageType(0) @@ -51,4 +56,6 @@ var ( _ = fact.FactList{} _ = fact.Fact{} _ = jwalterweatherman.LogListener(nil) + _ = format.Message{} + _ = restlike.Message{} )