o
    l>j9                     @  sZ   d Z ddlmZ ddlmZ ddlmZmZ G dd deZedddG d	d
 d
Z	dS )a  
Transport-agnostic renderer interface for Apple Notes.

Defines the minimal datasource seam (`NoteDataSource`) that the renderer
requires to resolve:
  - the UTI of an embedded attachment (by identifier), and
  - the mergeable table bytes (gzipped) for table attachments.

Optional richer datasource capabilities (if present) may include:
  - get_primary_asset_url(identifier)
  - get_thumbnail_url(identifier)
  - get_title(identifier)

The renderer never performs I/O; it only calls this interface.
    )annotations)	dataclass)OptionalProtocolc                   @  s$   e Zd ZdZdddZdd	d
ZdS )NoteDataSourcez7Minimal attachment datasource required by the renderer.
identifierstrreturnOptional[str]c                 C     d S N selfr   r   r   e/home/thesage/.local/lib/python3.10/site-packages/pyicloud/services/notes/rendering/renderer_iface.pyget_attachment_uti       z!NoteDataSource.get_attachment_utiOptional[bytes]c                 C  r   r   r   r   r   r   r   get_mergeable_gz   r   zNoteDataSource.get_mergeable_gzN)r   r   r	   r
   )r   r   r	   r   )__name__
__module____qualname____doc__r   r   r   r   r   r   r      s    
r   T)frozenslotsc                   @  s4   e Zd ZU dZdZded< dZded< dd	d
ZdS )AttachmentRefz:Lightweight reference created while walking AttributeRuns.Nr
   r   uti_hint
datasourceOptional[NoteDataSource]r	   c                 C  s&   | j r| j S |r| jr|| jS d S r   )r   r   r   )r   r   r   r   r   resolved_uti&   s
   
zAttachmentRef.resolved_uti)r   r   r	   r
   )r   r   r   r   r   __annotations__r   r   r   r   r   r   r      s
   
 r   N)
r   
__future__r   dataclassesr   typingr   r   r   r   r   r   r   r   <module>   s    
