github.com/primecitizens/pcz/std@v0.2.1/plat/js/webext/incognito/apis_js_wasm.go (about) 1 // SPDX-License-Identifier: Apache-2.0 2 // Copyright 2023 The Prime Citizens 3 4 package incognito 5 6 import ( 7 "github.com/primecitizens/pcz/std/ffi/js" 8 "github.com/primecitizens/pcz/std/plat/js/webext/incognito/bindings" 9 ) 10 11 type IncognitoMode uint32 12 13 const ( 14 _ IncognitoMode = iota 15 16 IncognitoMode_SPLIT 17 IncognitoMode_SPANNING 18 IncognitoMode_NOT_ALLOWED 19 ) 20 21 func (IncognitoMode) FromRef(str js.Ref) IncognitoMode { 22 return IncognitoMode(bindings.ConstOfIncognitoMode(str)) 23 } 24 25 func (x IncognitoMode) String() (string, bool) { 26 switch x { 27 case IncognitoMode_SPLIT: 28 return "split", true 29 case IncognitoMode_SPANNING: 30 return "spanning", true 31 case IncognitoMode_NOT_ALLOWED: 32 return "not_allowed", true 33 default: 34 return "", false 35 } 36 }