import * as Y from 'yjs'; // eslint-disable-next-line @typescript-eslint/no-explicit-any export function assertDocumentAttachment>( sharedType: T ): asserts sharedType is T & { doc: NonNullable } { if (!sharedType.doc) { throw new Error("shared type isn't attached to a document"); } }