o
    º¼tfÈ  ã                   @  sÌ   d dl mZ d dlmZmZmZmZ d dlmZm	Z	m
Z
 er$ddlmZ G dd„ de
ƒZG dd	„ d	e
ƒZG d
d„ de
ƒZG dd„ de
ƒZG dd„ de
ƒZG dd„ de	ƒZG dd„ de	ƒZG dd„ de	ƒZdS )é    )Úannotations)ÚTYPE_CHECKINGÚAnyÚCallableÚSequence)ÚLiteralÚProtocolÚ	TypedDicté   )ÚMimeBundleDescriptorc                   @  s&   e Zd ZU ded< ded< ded< dS )Ú
UpdateDatazLiteral['update']ÚmethodÚdictÚstatezlist[list[int | str]]Zbuffer_pathsN©Ú__name__Ú
__module__Ú__qualname__Ú__annotations__© r   r   ú]/var/www/html/software/conda/envs/catlas/lib/python3.10/site-packages/anywidget/_protocols.pyr      s   
 r   c                   @  s   e Zd ZU ded< dS )ÚRequestStateDatazLiteral['request_state']r   Nr   r   r   r   r   r      s   
 r   c                   @  ó   e Zd ZU ded< ded< dS )Ú
CustomDatazLiteral['custom']r   r   ÚcontentNr   r   r   r   r   r      ó   
 r   c                   @  r   )ÚJupyterWidgetContentÚstrZcomm_idz*UpdateData | RequestStateData | CustomDataÚdataNr   r   r   r   r   r      r   r   c                   @  sF   e Zd ZU ded< ded< ded< ded< ded< ded	< d
ed< dS )ÚCommMessager   Úheaderr   Zmsg_idÚmsg_typeZparent_headerÚmetadatar   r   zlist[memoryview]ÚbuffersNr   r   r   r   r   r      s   
 r   c                   @  s   e Zd ZdZd
dd„Zd	S )ÚMimeReprCallableaÛ  Protocol for _repr_mimebundle_.

    https://ipython.readthedocs.io/en/stable/config/integrating.html#more-powerful-methods

    > Should return a dictionary of multiple formats, keyed by mimetype, or a tuple of
    > two dictionaries: `data`, `metadata` (see Distribution metadata). If this returns
    > something, other `_repr_*_` methods are ignored. The method should take keyword
    > arguments `include` and `exclude`, though it is not required to respect them."
    ÚincludeúSequence[str]ÚexcludeÚreturnúdict | tuple[dict, dict]c                 C  ó   d S ©Nr   )Úselfr%   r'   r   r   r   Ú__call__5   ó   zMimeReprCallable.__call__N)r%   r&   r'   r&   r(   r)   )r   r   r   Ú__doc__r-   r   r   r   r   r$   *   s    
r$   c                   @  s   e Zd ZU dZded< dS )ÚAnywidgetProtocolzEAnywidget classes have a MimeBundleDescriptor at `_repr_mimebundle_`.r   Ú_repr_mimebundle_N)r   r   r   r/   r   r   r   r   r   r0   :   s   
 r0   c                   @  s$   e Zd ZdZddd	„Zddd„ZdS )Ú
WidgetBasez0Widget subclasses with a custom message reducer.Úmsgústr | dict | listr#   úlist[bytes]r(   ÚNonec                 C  r*   r+   r   )r,   r3   r#   r   r   r   ÚsendC   s    zWidgetBase.sendÚcallbackú5Callable[[Any, str | list | dict, list[bytes]], None]c                 C  r*   r+   r   )r,   r8   r   r   r   Úon_msgE   r.   zWidgetBase.on_msgN)r3   r4   r#   r5   r(   r6   )r8   r9   r(   r6   )r   r   r   r/   r7   r:   r   r   r   r   r2   @   s    
r2   N)Ú
__future__r   Útypingr   r   r   r   Ztyping_extensionsr   r   r	   Z_descriptorr   r   r   r   r   r   r$   r0   r2   r   r   r   r   Ú<module>   s    