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    The default public initializer of the shared object.
16    */
17   public init() {}
18 
19   /**
20    Returns the JavaScript shared object associated with the native shared object.
21    */
getJavaScriptObjectnull22   public func getJavaScriptObject() -> JavaScriptObject? {
23     return SharedObjectRegistry.toJavaScriptObject(self)
24   }
25 }
26