html_compose.attributes.img_attrs

  1from . import BaseAttribute
  2from typing import Literal
  3from ..base_types import StrLike
  4
  5
  6class ImgAttrs:
  7    """
  8    This module contains functions for attributes in the 'img' element.
  9    Which is inherited by a class so we can generate type hints
 10    """
 11
 12    @staticmethod
 13    def alt(value: StrLike) -> BaseAttribute:
 14        """
 15        "img" attribute: alt
 16        Replacement text for use when images are not available
 17
 18        Args:
 19            value:
 20                Text*
 21
 22        Returns:
 23            An alt attribute to be added to your element
 24
 25        """
 26
 27        return BaseAttribute("alt", value)
 28
 29    @staticmethod
 30    def crossorigin(
 31        value: Literal["anonymous", "use-credentials"],
 32    ) -> BaseAttribute:
 33        """
 34        "img" attribute: crossorigin
 35        How the element handles crossorigin requests
 36
 37        Args:
 38            value:
 39                ['anonymous', 'use-credentials']
 40
 41        Returns:
 42            An crossorigin attribute to be added to your element
 43
 44        """
 45
 46        return BaseAttribute("crossorigin", value)
 47
 48    @staticmethod
 49    def decoding(value: Literal["sync", "async", "auto"]) -> BaseAttribute:
 50        """
 51        "img" attribute: decoding
 52        Decoding hint to use when processing this image for presentation
 53
 54        Args:
 55            value:
 56                ['sync', 'async', 'auto']
 57
 58        Returns:
 59            An decoding attribute to be added to your element
 60
 61        """
 62
 63        return BaseAttribute("decoding", value)
 64
 65    @staticmethod
 66    def fetchpriority(value: Literal["auto", "high", "low"]) -> BaseAttribute:
 67        """
 68        "img" attribute: fetchpriority
 69        Sets the priority for fetches initiated by the element
 70
 71        Args:
 72            value:
 73                ['auto', 'high', 'low']
 74
 75        Returns:
 76            An fetchpriority attribute to be added to your element
 77
 78        """
 79
 80        return BaseAttribute("fetchpriority", value)
 81
 82    @staticmethod
 83    def height(value: int) -> BaseAttribute:
 84        """
 85        "img" attribute: height
 86        Vertical dimension
 87
 88        Args:
 89            value:
 90                Valid non-negative integer
 91
 92        Returns:
 93            An height attribute to be added to your element
 94
 95        """
 96
 97        return BaseAttribute("height", value)
 98
 99    @staticmethod
100    def ismap(value: bool) -> BaseAttribute:
101        """
102        "img" attribute: ismap
103        Whether the image is a server-side image map
104
105        Args:
106            value:
107                Boolean attribute
108
109        Returns:
110            An ismap attribute to be added to your element
111
112        """
113
114        return BaseAttribute("ismap", value)
115
116    @staticmethod
117    def loading(value: Literal["lazy", "eager"]) -> BaseAttribute:
118        """
119        "img" attribute: loading
120        Used when determining loading deferral
121
122        Args:
123            value:
124                ['lazy', 'eager']
125
126        Returns:
127            An loading attribute to be added to your element
128
129        """
130
131        return BaseAttribute("loading", value)
132
133    @staticmethod
134    def referrerpolicy(value) -> BaseAttribute:
135        """
136        "img" attribute: referrerpolicy
137        Referrer policy for fetches initiated by the element
138
139        Args:
140            value:
141                Referrer policy
142
143        Returns:
144            An referrerpolicy attribute to be added to your element
145
146        """
147
148        return BaseAttribute("referrerpolicy", value)
149
150    @staticmethod
151    def sizes(value) -> BaseAttribute:
152        """
153        "img" attribute: sizes
154        Image sizes for different page layouts
155
156        Args:
157            value:
158                Valid source size list
159
160        Returns:
161            An sizes attribute to be added to your element
162
163        """
164
165        return BaseAttribute("sizes", value)
166
167    @staticmethod
168    def src(value) -> BaseAttribute:
169        """
170        "img" attribute: src
171        Address of the resource
172
173        Args:
174            value:
175                Valid non-empty URL potentially surrounded by spaces
176
177        Returns:
178            An src attribute to be added to your element
179
180        """
181
182        return BaseAttribute("src", value)
183
184    @staticmethod
185    def srcset(value) -> BaseAttribute:
186        """
187        "img" attribute: srcset
188        Images to use in different situations, e.g., high-resolution displays, small monitors, etc.
189
190        Args:
191            value:
192                Comma-separated list of image candidate strings
193
194        Returns:
195            An srcset attribute to be added to your element
196
197        """
198
199        return BaseAttribute("srcset", value)
200
201    @staticmethod
202    def usemap(value) -> BaseAttribute:
203        """
204        "img" attribute: usemap
205        Name of image map to use
206
207        Args:
208            value:
209                Valid hash-name reference*
210
211        Returns:
212            An usemap attribute to be added to your element
213
214        """
215
216        return BaseAttribute("usemap", value)
217
218    @staticmethod
219    def width(value: int) -> BaseAttribute:
220        """
221        "img" attribute: width
222        Horizontal dimension
223
224        Args:
225            value:
226                Valid non-negative integer
227
228        Returns:
229            An width attribute to be added to your element
230
231        """
232
233        return BaseAttribute("width", value)
class ImgAttrs:
  7class ImgAttrs:
  8    """
  9    This module contains functions for attributes in the 'img' element.
 10    Which is inherited by a class so we can generate type hints
 11    """
 12
 13    @staticmethod
 14    def alt(value: StrLike) -> BaseAttribute:
 15        """
 16        "img" attribute: alt
 17        Replacement text for use when images are not available
 18
 19        Args:
 20            value:
 21                Text*
 22
 23        Returns:
 24            An alt attribute to be added to your element
 25
 26        """
 27
 28        return BaseAttribute("alt", value)
 29
 30    @staticmethod
 31    def crossorigin(
 32        value: Literal["anonymous", "use-credentials"],
 33    ) -> BaseAttribute:
 34        """
 35        "img" attribute: crossorigin
 36        How the element handles crossorigin requests
 37
 38        Args:
 39            value:
 40                ['anonymous', 'use-credentials']
 41
 42        Returns:
 43            An crossorigin attribute to be added to your element
 44
 45        """
 46
 47        return BaseAttribute("crossorigin", value)
 48
 49    @staticmethod
 50    def decoding(value: Literal["sync", "async", "auto"]) -> BaseAttribute:
 51        """
 52        "img" attribute: decoding
 53        Decoding hint to use when processing this image for presentation
 54
 55        Args:
 56            value:
 57                ['sync', 'async', 'auto']
 58
 59        Returns:
 60            An decoding attribute to be added to your element
 61
 62        """
 63
 64        return BaseAttribute("decoding", value)
 65
 66    @staticmethod
 67    def fetchpriority(value: Literal["auto", "high", "low"]) -> BaseAttribute:
 68        """
 69        "img" attribute: fetchpriority
 70        Sets the priority for fetches initiated by the element
 71
 72        Args:
 73            value:
 74                ['auto', 'high', 'low']
 75
 76        Returns:
 77            An fetchpriority attribute to be added to your element
 78
 79        """
 80
 81        return BaseAttribute("fetchpriority", value)
 82
 83    @staticmethod
 84    def height(value: int) -> BaseAttribute:
 85        """
 86        "img" attribute: height
 87        Vertical dimension
 88
 89        Args:
 90            value:
 91                Valid non-negative integer
 92
 93        Returns:
 94            An height attribute to be added to your element
 95
 96        """
 97
 98        return BaseAttribute("height", value)
 99
100    @staticmethod
101    def ismap(value: bool) -> BaseAttribute:
102        """
103        "img" attribute: ismap
104        Whether the image is a server-side image map
105
106        Args:
107            value:
108                Boolean attribute
109
110        Returns:
111            An ismap attribute to be added to your element
112
113        """
114
115        return BaseAttribute("ismap", value)
116
117    @staticmethod
118    def loading(value: Literal["lazy", "eager"]) -> BaseAttribute:
119        """
120        "img" attribute: loading
121        Used when determining loading deferral
122
123        Args:
124            value:
125                ['lazy', 'eager']
126
127        Returns:
128            An loading attribute to be added to your element
129
130        """
131
132        return BaseAttribute("loading", value)
133
134    @staticmethod
135    def referrerpolicy(value) -> BaseAttribute:
136        """
137        "img" attribute: referrerpolicy
138        Referrer policy for fetches initiated by the element
139
140        Args:
141            value:
142                Referrer policy
143
144        Returns:
145            An referrerpolicy attribute to be added to your element
146
147        """
148
149        return BaseAttribute("referrerpolicy", value)
150
151    @staticmethod
152    def sizes(value) -> BaseAttribute:
153        """
154        "img" attribute: sizes
155        Image sizes for different page layouts
156
157        Args:
158            value:
159                Valid source size list
160
161        Returns:
162            An sizes attribute to be added to your element
163
164        """
165
166        return BaseAttribute("sizes", value)
167
168    @staticmethod
169    def src(value) -> BaseAttribute:
170        """
171        "img" attribute: src
172        Address of the resource
173
174        Args:
175            value:
176                Valid non-empty URL potentially surrounded by spaces
177
178        Returns:
179            An src attribute to be added to your element
180
181        """
182
183        return BaseAttribute("src", value)
184
185    @staticmethod
186    def srcset(value) -> BaseAttribute:
187        """
188        "img" attribute: srcset
189        Images to use in different situations, e.g., high-resolution displays, small monitors, etc.
190
191        Args:
192            value:
193                Comma-separated list of image candidate strings
194
195        Returns:
196            An srcset attribute to be added to your element
197
198        """
199
200        return BaseAttribute("srcset", value)
201
202    @staticmethod
203    def usemap(value) -> BaseAttribute:
204        """
205        "img" attribute: usemap
206        Name of image map to use
207
208        Args:
209            value:
210                Valid hash-name reference*
211
212        Returns:
213            An usemap attribute to be added to your element
214
215        """
216
217        return BaseAttribute("usemap", value)
218
219    @staticmethod
220    def width(value: int) -> BaseAttribute:
221        """
222        "img" attribute: width
223        Horizontal dimension
224
225        Args:
226            value:
227                Valid non-negative integer
228
229        Returns:
230            An width attribute to be added to your element
231
232        """
233
234        return BaseAttribute("width", value)

This module contains functions for attributes in the 'img' element. Which is inherited by a class so we can generate type hints

@staticmethod
def alt( value: str | float | int | bool) -> html_compose.base_attribute.BaseAttribute:
13    @staticmethod
14    def alt(value: StrLike) -> BaseAttribute:
15        """
16        "img" attribute: alt
17        Replacement text for use when images are not available
18
19        Args:
20            value:
21                Text*
22
23        Returns:
24            An alt attribute to be added to your element
25
26        """
27
28        return BaseAttribute("alt", value)

"img" attribute: alt Replacement text for use when images are not available

Args: value: Text*

Returns: An alt attribute to be added to your element

@staticmethod
def crossorigin( value: Literal['anonymous', 'use-credentials']) -> html_compose.base_attribute.BaseAttribute:
30    @staticmethod
31    def crossorigin(
32        value: Literal["anonymous", "use-credentials"],
33    ) -> BaseAttribute:
34        """
35        "img" attribute: crossorigin
36        How the element handles crossorigin requests
37
38        Args:
39            value:
40                ['anonymous', 'use-credentials']
41
42        Returns:
43            An crossorigin attribute to be added to your element
44
45        """
46
47        return BaseAttribute("crossorigin", value)

"img" attribute: crossorigin How the element handles crossorigin requests

Args: value: ['anonymous', 'use-credentials']

Returns: An crossorigin attribute to be added to your element

@staticmethod
def decoding( value: Literal['sync', 'async', 'auto']) -> html_compose.base_attribute.BaseAttribute:
49    @staticmethod
50    def decoding(value: Literal["sync", "async", "auto"]) -> BaseAttribute:
51        """
52        "img" attribute: decoding
53        Decoding hint to use when processing this image for presentation
54
55        Args:
56            value:
57                ['sync', 'async', 'auto']
58
59        Returns:
60            An decoding attribute to be added to your element
61
62        """
63
64        return BaseAttribute("decoding", value)

"img" attribute: decoding Decoding hint to use when processing this image for presentation

Args: value: ['sync', 'async', 'auto']

Returns: An decoding attribute to be added to your element

@staticmethod
def fetchpriority( value: Literal['auto', 'high', 'low']) -> html_compose.base_attribute.BaseAttribute:
66    @staticmethod
67    def fetchpriority(value: Literal["auto", "high", "low"]) -> BaseAttribute:
68        """
69        "img" attribute: fetchpriority
70        Sets the priority for fetches initiated by the element
71
72        Args:
73            value:
74                ['auto', 'high', 'low']
75
76        Returns:
77            An fetchpriority attribute to be added to your element
78
79        """
80
81        return BaseAttribute("fetchpriority", value)

"img" attribute: fetchpriority Sets the priority for fetches initiated by the element

Args: value: ['auto', 'high', 'low']

Returns: An fetchpriority attribute to be added to your element

@staticmethod
def height(value: int) -> html_compose.base_attribute.BaseAttribute:
83    @staticmethod
84    def height(value: int) -> BaseAttribute:
85        """
86        "img" attribute: height
87        Vertical dimension
88
89        Args:
90            value:
91                Valid non-negative integer
92
93        Returns:
94            An height attribute to be added to your element
95
96        """
97
98        return BaseAttribute("height", value)

"img" attribute: height Vertical dimension

Args: value: Valid non-negative integer

Returns: An height attribute to be added to your element

@staticmethod
def ismap(value: bool) -> html_compose.base_attribute.BaseAttribute:
100    @staticmethod
101    def ismap(value: bool) -> BaseAttribute:
102        """
103        "img" attribute: ismap
104        Whether the image is a server-side image map
105
106        Args:
107            value:
108                Boolean attribute
109
110        Returns:
111            An ismap attribute to be added to your element
112
113        """
114
115        return BaseAttribute("ismap", value)

"img" attribute: ismap Whether the image is a server-side image map

Args: value: Boolean attribute

Returns: An ismap attribute to be added to your element

@staticmethod
def loading( value: Literal['lazy', 'eager']) -> html_compose.base_attribute.BaseAttribute:
117    @staticmethod
118    def loading(value: Literal["lazy", "eager"]) -> BaseAttribute:
119        """
120        "img" attribute: loading
121        Used when determining loading deferral
122
123        Args:
124            value:
125                ['lazy', 'eager']
126
127        Returns:
128            An loading attribute to be added to your element
129
130        """
131
132        return BaseAttribute("loading", value)

"img" attribute: loading Used when determining loading deferral

Args: value: ['lazy', 'eager']

Returns: An loading attribute to be added to your element

@staticmethod
def referrerpolicy(value) -> html_compose.base_attribute.BaseAttribute:
134    @staticmethod
135    def referrerpolicy(value) -> BaseAttribute:
136        """
137        "img" attribute: referrerpolicy
138        Referrer policy for fetches initiated by the element
139
140        Args:
141            value:
142                Referrer policy
143
144        Returns:
145            An referrerpolicy attribute to be added to your element
146
147        """
148
149        return BaseAttribute("referrerpolicy", value)

"img" attribute: referrerpolicy Referrer policy for fetches initiated by the element

Args: value: Referrer policy

Returns: An referrerpolicy attribute to be added to your element

@staticmethod
def sizes(value) -> html_compose.base_attribute.BaseAttribute:
151    @staticmethod
152    def sizes(value) -> BaseAttribute:
153        """
154        "img" attribute: sizes
155        Image sizes for different page layouts
156
157        Args:
158            value:
159                Valid source size list
160
161        Returns:
162            An sizes attribute to be added to your element
163
164        """
165
166        return BaseAttribute("sizes", value)

"img" attribute: sizes Image sizes for different page layouts

Args: value: Valid source size list

Returns: An sizes attribute to be added to your element

@staticmethod
def src(value) -> html_compose.base_attribute.BaseAttribute:
168    @staticmethod
169    def src(value) -> BaseAttribute:
170        """
171        "img" attribute: src
172        Address of the resource
173
174        Args:
175            value:
176                Valid non-empty URL potentially surrounded by spaces
177
178        Returns:
179            An src attribute to be added to your element
180
181        """
182
183        return BaseAttribute("src", value)

"img" attribute: src Address of the resource

Args: value: Valid non-empty URL potentially surrounded by spaces

Returns: An src attribute to be added to your element

@staticmethod
def srcset(value) -> html_compose.base_attribute.BaseAttribute:
185    @staticmethod
186    def srcset(value) -> BaseAttribute:
187        """
188        "img" attribute: srcset
189        Images to use in different situations, e.g., high-resolution displays, small monitors, etc.
190
191        Args:
192            value:
193                Comma-separated list of image candidate strings
194
195        Returns:
196            An srcset attribute to be added to your element
197
198        """
199
200        return BaseAttribute("srcset", value)

"img" attribute: srcset Images to use in different situations, e.g., high-resolution displays, small monitors, etc.

Args: value: Comma-separated list of image candidate strings

Returns: An srcset attribute to be added to your element

@staticmethod
def usemap(value) -> html_compose.base_attribute.BaseAttribute:
202    @staticmethod
203    def usemap(value) -> BaseAttribute:
204        """
205        "img" attribute: usemap
206        Name of image map to use
207
208        Args:
209            value:
210                Valid hash-name reference*
211
212        Returns:
213            An usemap attribute to be added to your element
214
215        """
216
217        return BaseAttribute("usemap", value)

"img" attribute: usemap Name of image map to use

Args: value: Valid hash-name reference*

Returns: An usemap attribute to be added to your element

@staticmethod
def width(value: int) -> html_compose.base_attribute.BaseAttribute:
219    @staticmethod
220    def width(value: int) -> BaseAttribute:
221        """
222        "img" attribute: width
223        Horizontal dimension
224
225        Args:
226            value:
227                Valid non-negative integer
228
229        Returns:
230            An width attribute to be added to your element
231
232        """
233
234        return BaseAttribute("width", value)

"img" attribute: width Horizontal dimension

Args: value: Valid non-negative integer

Returns: An width attribute to be added to your element