1 // Copyright 2022-present 650 Industries. All rights reserved.
2 
3 public protocol AnySharedObject: AnyArgument {
4   var sharedObjectId: SharedObjectId { get }
5 }
6 
7 open class SharedObject: AnySharedObject {
8   /**
9    An identifier of the native shared object that maps to the JavaScript object.
10    When the object is not linked with any JavaScript object, its value is 0.
11    */
12   public internal(set) var sharedObjectId: SharedObjectId = 0
13 
14   /**
15    Returns the JavaScript shared object associated with the native shared object.
16    */
17   public func getJavaScriptObject() -> JavaScriptObject? {
18     return SharedObjectRegistry.toJavaScriptObject(self)
19   }
20 }
21