File tree 4 files changed +27
-3
lines changed
packages/unhead/src/types/schema
4 files changed +27
-3
lines changed Original file line number Diff line number Diff line change 1
1
import type { HttpEventAttributes } from './attributes/event'
2
2
import type { GlobalAttributes } from './attributes/global'
3
3
import type { ReferrerPolicy } from './shared'
4
+ import type { Blocking } from './struct/blocking'
4
5
5
6
export type LinkRelTypes = 'alternate' |
6
7
'author' |
@@ -33,7 +34,7 @@ export type LinkRelTypes = 'alternate' |
33
34
'apple-touch-icon' |
34
35
'apple-touch-startup-image'
35
36
36
- export interface LinkBase extends Pick < GlobalAttributes , 'nonce' > {
37
+ export interface LinkBase extends Pick < GlobalAttributes , 'nonce' > , Blocking {
37
38
/**
38
39
* This attribute is only used when rel="preload" or rel="prefetch" has been set on the `<link>` element.
39
40
* It specifies the type of content being loaded by the `<link>`, which is necessary for request matching,
Original file line number Diff line number Diff line change @@ -2,8 +2,9 @@ import type { Booleanable } from '../util'
2
2
import type { HttpEventAttributes } from './attributes/event'
3
3
import type { GlobalAttributes } from './attributes/global'
4
4
import type { ReferrerPolicy } from './shared'
5
+ import type { Blocking } from './struct/blocking'
5
6
6
- export interface ScriptBase extends Pick < GlobalAttributes , 'nonce' > {
7
+ export interface ScriptBase extends Pick < GlobalAttributes , 'nonce' > , Blocking {
7
8
/**
8
9
* For classic scripts, if the async attribute is present,
9
10
* then the classic script will be fetched in parallel to parsing and evaluated as soon as it is available.
Original file line number Diff line number Diff line change
1
+ /**
2
+ * Represents the possible blocking tokens for an element.
3
+ */
4
+ export type BlockingToken = 'render'
5
+
6
+ /**
7
+ * Represents the blocking attribute for an element.
8
+ * The blocking attribute must have a value that is an unordered set of unique space-separated tokens,
9
+ * each of which are possible blocking tokens.
10
+ */
11
+ export interface Blocking {
12
+ /**
13
+ * The blocking attribute indicates that certain operations should be blocked on the fetching of an external resource.
14
+ * The value is an unordered set of unique space-separated tokens, each of which are possible blocking tokens.
15
+ *
16
+ * @example
17
+ * blocking: "render"
18
+ */
19
+ blocking ?: BlockingToken | string // escape hatch
20
+ }
Original file line number Diff line number Diff line change 1
- export interface Style {
1
+ import type { Blocking } from './struct/blocking'
2
+
3
+ export interface Style extends Blocking {
2
4
/**
3
5
* This attribute defines which media the style should be applied to.
4
6
* Its value is a media query, which defaults to all if the attribute is missing.
You can’t perform that action at this time.
0 commit comments