html_compose.attributes.script_attrs

  1from . import BaseAttribute
  2from typing import Literal
  3from ..base_types import Resolvable, StrLike
  4
  5
  6class ScriptAttrs:
  7    """
  8    This module contains functions for attributes in the 'script' element.
  9    Which is inherited by a class so we can generate type hints
 10    """
 11
 12    @staticmethod
 13    def async_(value: bool) -> BaseAttribute:
 14        """
 15        "script" attribute: async
 16        Execute script when available, without blocking while fetching
 17
 18        Args:
 19            value:
 20                Boolean attribute
 21
 22        Returns:
 23            An async attribute to be added to your element
 24
 25        """
 26
 27        return BaseAttribute("async", value)
 28
 29    @staticmethod
 30    def blocking(value: Resolvable) -> BaseAttribute:
 31        """
 32        "script" attribute: blocking
 33        Whether the element is potentially render-blocking
 34
 35        Args:
 36            value:
 37                Unordered set of unique space-separated tokens*
 38
 39        Returns:
 40            An blocking attribute to be added to your element
 41
 42        """
 43
 44        return BaseAttribute("blocking", value)
 45
 46    @staticmethod
 47    def crossorigin(
 48        value: Literal["anonymous", "use-credentials"],
 49    ) -> BaseAttribute:
 50        """
 51        "script" attribute: crossorigin
 52        How the element handles crossorigin requests
 53
 54        Args:
 55            value:
 56                ['anonymous', 'use-credentials']
 57
 58        Returns:
 59            An crossorigin attribute to be added to your element
 60
 61        """
 62
 63        return BaseAttribute("crossorigin", value)
 64
 65    @staticmethod
 66    def defer(value: bool) -> BaseAttribute:
 67        """
 68        "script" attribute: defer
 69        Defer script execution
 70
 71        Args:
 72            value:
 73                Boolean attribute
 74
 75        Returns:
 76            An defer attribute to be added to your element
 77
 78        """
 79
 80        return BaseAttribute("defer", value)
 81
 82    @staticmethod
 83    def fetchpriority(value: Literal["auto", "high", "low"]) -> BaseAttribute:
 84        """
 85        "script" attribute: fetchpriority
 86        Sets the priority for fetches initiated by the element
 87
 88        Args:
 89            value:
 90                ['auto', 'high', 'low']
 91
 92        Returns:
 93            An fetchpriority attribute to be added to your element
 94
 95        """
 96
 97        return BaseAttribute("fetchpriority", value)
 98
 99    @staticmethod
100    def integrity(value: StrLike) -> BaseAttribute:
101        """
102        "script" attribute: integrity
103        Integrity metadata used in Subresource Integrity checks [SRI]
104
105        Args:
106            value:
107                Text
108
109        Returns:
110            An integrity attribute to be added to your element
111
112        """
113
114        return BaseAttribute("integrity", value)
115
116    @staticmethod
117    def nomodule(value: bool) -> BaseAttribute:
118        """
119        "script" attribute: nomodule
120        Prevents execution in user agents that support module scripts
121
122        Args:
123            value:
124                Boolean attribute
125
126        Returns:
127            An nomodule attribute to be added to your element
128
129        """
130
131        return BaseAttribute("nomodule", value)
132
133    @staticmethod
134    def referrerpolicy(value) -> BaseAttribute:
135        """
136        "script" 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 src(value) -> BaseAttribute:
152        """
153        "script" attribute: src
154        Address of the resource
155
156        Args:
157            value:
158                Valid non-empty URL potentially surrounded by spaces
159
160        Returns:
161            An src attribute to be added to your element
162
163        """
164
165        return BaseAttribute("src", value)
166
167    @staticmethod
168    def type(value) -> BaseAttribute:
169        """
170        "script" attribute: type
171        Type of script
172
173        Args:
174            value:
175                "module"; a valid MIME type string that is not a JavaScript MIME type essence match
176
177        Returns:
178            An type attribute to be added to your element
179
180        """
181
182        return BaseAttribute("type", value)
class ScriptAttrs:
  7class ScriptAttrs:
  8    """
  9    This module contains functions for attributes in the 'script' element.
 10    Which is inherited by a class so we can generate type hints
 11    """
 12
 13    @staticmethod
 14    def async_(value: bool) -> BaseAttribute:
 15        """
 16        "script" attribute: async
 17        Execute script when available, without blocking while fetching
 18
 19        Args:
 20            value:
 21                Boolean attribute
 22
 23        Returns:
 24            An async attribute to be added to your element
 25
 26        """
 27
 28        return BaseAttribute("async", value)
 29
 30    @staticmethod
 31    def blocking(value: Resolvable) -> BaseAttribute:
 32        """
 33        "script" attribute: blocking
 34        Whether the element is potentially render-blocking
 35
 36        Args:
 37            value:
 38                Unordered set of unique space-separated tokens*
 39
 40        Returns:
 41            An blocking attribute to be added to your element
 42
 43        """
 44
 45        return BaseAttribute("blocking", value)
 46
 47    @staticmethod
 48    def crossorigin(
 49        value: Literal["anonymous", "use-credentials"],
 50    ) -> BaseAttribute:
 51        """
 52        "script" attribute: crossorigin
 53        How the element handles crossorigin requests
 54
 55        Args:
 56            value:
 57                ['anonymous', 'use-credentials']
 58
 59        Returns:
 60            An crossorigin attribute to be added to your element
 61
 62        """
 63
 64        return BaseAttribute("crossorigin", value)
 65
 66    @staticmethod
 67    def defer(value: bool) -> BaseAttribute:
 68        """
 69        "script" attribute: defer
 70        Defer script execution
 71
 72        Args:
 73            value:
 74                Boolean attribute
 75
 76        Returns:
 77            An defer attribute to be added to your element
 78
 79        """
 80
 81        return BaseAttribute("defer", value)
 82
 83    @staticmethod
 84    def fetchpriority(value: Literal["auto", "high", "low"]) -> BaseAttribute:
 85        """
 86        "script" attribute: fetchpriority
 87        Sets the priority for fetches initiated by the element
 88
 89        Args:
 90            value:
 91                ['auto', 'high', 'low']
 92
 93        Returns:
 94            An fetchpriority attribute to be added to your element
 95
 96        """
 97
 98        return BaseAttribute("fetchpriority", value)
 99
100    @staticmethod
101    def integrity(value: StrLike) -> BaseAttribute:
102        """
103        "script" attribute: integrity
104        Integrity metadata used in Subresource Integrity checks [SRI]
105
106        Args:
107            value:
108                Text
109
110        Returns:
111            An integrity attribute to be added to your element
112
113        """
114
115        return BaseAttribute("integrity", value)
116
117    @staticmethod
118    def nomodule(value: bool) -> BaseAttribute:
119        """
120        "script" attribute: nomodule
121        Prevents execution in user agents that support module scripts
122
123        Args:
124            value:
125                Boolean attribute
126
127        Returns:
128            An nomodule attribute to be added to your element
129
130        """
131
132        return BaseAttribute("nomodule", value)
133
134    @staticmethod
135    def referrerpolicy(value) -> BaseAttribute:
136        """
137        "script" 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 src(value) -> BaseAttribute:
153        """
154        "script" attribute: src
155        Address of the resource
156
157        Args:
158            value:
159                Valid non-empty URL potentially surrounded by spaces
160
161        Returns:
162            An src attribute to be added to your element
163
164        """
165
166        return BaseAttribute("src", value)
167
168    @staticmethod
169    def type(value) -> BaseAttribute:
170        """
171        "script" attribute: type
172        Type of script
173
174        Args:
175            value:
176                "module"; a valid MIME type string that is not a JavaScript MIME type essence match
177
178        Returns:
179            An type attribute to be added to your element
180
181        """
182
183        return BaseAttribute("type", value)

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

@staticmethod
def async_(value: bool) -> html_compose.base_attribute.BaseAttribute:
13    @staticmethod
14    def async_(value: bool) -> BaseAttribute:
15        """
16        "script" attribute: async
17        Execute script when available, without blocking while fetching
18
19        Args:
20            value:
21                Boolean attribute
22
23        Returns:
24            An async attribute to be added to your element
25
26        """
27
28        return BaseAttribute("async", value)

"script" attribute: async Execute script when available, without blocking while fetching

Args: value: Boolean attribute

Returns: An async attribute to be added to your element

@staticmethod
def blocking( value: Union[NoneType, str, float, int, bool, Iterable[str | float | int | bool], Mapping[str | float | int | bool, bool]]) -> html_compose.base_attribute.BaseAttribute:
30    @staticmethod
31    def blocking(value: Resolvable) -> BaseAttribute:
32        """
33        "script" attribute: blocking
34        Whether the element is potentially render-blocking
35
36        Args:
37            value:
38                Unordered set of unique space-separated tokens*
39
40        Returns:
41            An blocking attribute to be added to your element
42
43        """
44
45        return BaseAttribute("blocking", value)

"script" attribute: blocking Whether the element is potentially render-blocking

Args: value: Unordered set of unique space-separated tokens*

Returns: An blocking attribute to be added to your element

@staticmethod
def crossorigin( value: Literal['anonymous', 'use-credentials']) -> html_compose.base_attribute.BaseAttribute:
47    @staticmethod
48    def crossorigin(
49        value: Literal["anonymous", "use-credentials"],
50    ) -> BaseAttribute:
51        """
52        "script" attribute: crossorigin
53        How the element handles crossorigin requests
54
55        Args:
56            value:
57                ['anonymous', 'use-credentials']
58
59        Returns:
60            An crossorigin attribute to be added to your element
61
62        """
63
64        return BaseAttribute("crossorigin", value)

"script" 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 defer(value: bool) -> html_compose.base_attribute.BaseAttribute:
66    @staticmethod
67    def defer(value: bool) -> BaseAttribute:
68        """
69        "script" attribute: defer
70        Defer script execution
71
72        Args:
73            value:
74                Boolean attribute
75
76        Returns:
77            An defer attribute to be added to your element
78
79        """
80
81        return BaseAttribute("defer", value)

"script" attribute: defer Defer script execution

Args: value: Boolean attribute

Returns: An defer attribute to be added to your element

@staticmethod
def fetchpriority( value: Literal['auto', 'high', 'low']) -> html_compose.base_attribute.BaseAttribute:
83    @staticmethod
84    def fetchpriority(value: Literal["auto", "high", "low"]) -> BaseAttribute:
85        """
86        "script" attribute: fetchpriority
87        Sets the priority for fetches initiated by the element
88
89        Args:
90            value:
91                ['auto', 'high', 'low']
92
93        Returns:
94            An fetchpriority attribute to be added to your element
95
96        """
97
98        return BaseAttribute("fetchpriority", value)

"script" 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 integrity( value: str | float | int | bool) -> html_compose.base_attribute.BaseAttribute:
100    @staticmethod
101    def integrity(value: StrLike) -> BaseAttribute:
102        """
103        "script" attribute: integrity
104        Integrity metadata used in Subresource Integrity checks [SRI]
105
106        Args:
107            value:
108                Text
109
110        Returns:
111            An integrity attribute to be added to your element
112
113        """
114
115        return BaseAttribute("integrity", value)

"script" attribute: integrity Integrity metadata used in Subresource Integrity checks [SRI]

Args: value: Text

Returns: An integrity attribute to be added to your element

@staticmethod
def nomodule(value: bool) -> html_compose.base_attribute.BaseAttribute:
117    @staticmethod
118    def nomodule(value: bool) -> BaseAttribute:
119        """
120        "script" attribute: nomodule
121        Prevents execution in user agents that support module scripts
122
123        Args:
124            value:
125                Boolean attribute
126
127        Returns:
128            An nomodule attribute to be added to your element
129
130        """
131
132        return BaseAttribute("nomodule", value)

"script" attribute: nomodule Prevents execution in user agents that support module scripts

Args: value: Boolean attribute

Returns: An nomodule 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        "script" 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)

"script" 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 src(value) -> html_compose.base_attribute.BaseAttribute:
151    @staticmethod
152    def src(value) -> BaseAttribute:
153        """
154        "script" attribute: src
155        Address of the resource
156
157        Args:
158            value:
159                Valid non-empty URL potentially surrounded by spaces
160
161        Returns:
162            An src attribute to be added to your element
163
164        """
165
166        return BaseAttribute("src", value)

"script" 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 type(value) -> html_compose.base_attribute.BaseAttribute:
168    @staticmethod
169    def type(value) -> BaseAttribute:
170        """
171        "script" attribute: type
172        Type of script
173
174        Args:
175            value:
176                "module"; a valid MIME type string that is not a JavaScript MIME type essence match
177
178        Returns:
179            An type attribute to be added to your element
180
181        """
182
183        return BaseAttribute("type", value)

"script" attribute: type Type of script

Args: value: "module"; a valid MIME type string that is not a JavaScript MIME type essence match

Returns: An type attribute to be added to your element