import type Disposable from './Disposable'; /** * Represents an object that can be shared among multiple instances (multiple ownership). */ export default class Shared implements Disposable { private readonly _object; private readonly _owner; private readonly _refCount; private readonly _onDispose; private _disposed; private constructor(); /** * The underlying shared object. */ get object(): T; /** * Gets the original (first) owner of the shared object. */ get owner(): Owner; /** * Creates a new shared object with the specified owner. * @param obj - The object to share. * @param owner - The owner of the object. * @param onDispose - The callback to apply when the ref count reaches zero. */ static new(obj: T, owner: Owner, onDispose: (obj: T) => void): Shared; /** * Clones the reference to the shared object, incrementing the ref count. * Note: this does _not_ clone the shared object itself. */ clone(): Shared; private checkDisposed; /** * Decrement the ref count of this object. If the count becomes zero, the underlying object is also disposed. */ dispose(): void; } //# sourceMappingURL=Shared.d.ts.map