Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
f3b06b93
Unverified
Commit
f3b06b93
authored
Nov 24, 2024
by
Boaris
Committed by
GitHub
Nov 24, 2024
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Implement metadata types support for `exactOptionalPropertyTypes` (#72936)
parent
28a25af1
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
1163 additions
and
401 deletions
+1163
-401
alternative-urls-types.ts
...ges/next/src/lib/metadata/types/alternative-urls-types.ts
+16
-10
extra-types.ts
packages/next/src/lib/metadata/types/extra-types.ts
+54
-50
manifest-types.ts
packages/next/src/lib/metadata/types/manifest-types.ts
+102
-81
metadata-interface.ts
packages/next/src/lib/metadata/types/metadata-interface.ts
+67
-52
metadata-types.ts
packages/next/src/lib/metadata/types/metadata-types.ts
+71
-65
opengraph-types.ts
packages/next/src/lib/metadata/types/opengraph-types.ts
+146
-116
twitter-types.ts
packages/next/src/lib/metadata/types/twitter-types.ts
+29
-27
manifest.ts
...uction/typescript-basic/typechecking/metadata/manifest.ts
+76
-0
metadata.ts
...uction/typescript-basic/typechecking/metadata/metadata.ts
+507
-0
robots.ts
...oduction/typescript-basic/typechecking/metadata/robots.ts
+14
-0
sitemap.ts
...duction/typescript-basic/typechecking/metadata/sitemap.ts
+59
-0
viewport.ts
...uction/typescript-basic/typechecking/metadata/viewport.ts
+22
-0
No files found.
packages/next/src/lib/metadata/types/alternative-urls-types.ts
View file @
f3b06b93
...
@@ -427,23 +427,29 @@ type UnmatchedLang = 'x-default'
...
@@ -427,23 +427,29 @@ type UnmatchedLang = 'x-default'
type
HrefLang
=
LangCode
|
UnmatchedLang
type
HrefLang
=
LangCode
|
UnmatchedLang
export
type
Languages
<
T
>
=
{
export
type
Languages
<
T
>
=
{
[
s
in
HrefLang
]?:
T
[
s
in
HrefLang
]?:
T
|
undefined
}
}
export
type
AlternateLinkDescriptor
=
{
export
type
AlternateLinkDescriptor
=
{
title
?:
string
title
?:
string
|
undefined
url
:
string
|
URL
url
:
string
|
URL
}
}
export
type
AlternateURLs
=
{
export
type
AlternateURLs
=
{
canonical
?:
null
|
string
|
URL
|
AlternateLinkDescriptor
canonical
?:
null
|
string
|
URL
|
AlternateLinkDescriptor
|
undefined
languages
?:
Languages
<
null
|
string
|
URL
|
AlternateLinkDescriptor
[]
>
languages
?:
media
?:
{
|
Languages
<
null
|
string
|
URL
|
AlternateLinkDescriptor
[]
>
[
media
:
string
]:
null
|
string
|
URL
|
AlternateLinkDescriptor
[]
|
undefined
}
media
?:
types
?:
{
|
{
[
types
:
string
]:
null
|
string
|
URL
|
AlternateLinkDescriptor
[]
[
media
:
string
]:
null
|
string
|
URL
|
AlternateLinkDescriptor
[]
}
}
|
undefined
types
?:
|
{
[
types
:
string
]:
null
|
string
|
URL
|
AlternateLinkDescriptor
[]
}
|
undefined
}
}
export
type
ResolvedAlternateURLs
=
{
export
type
ResolvedAlternateURLs
=
{
...
...
packages/next/src/lib/metadata/types/extra-types.ts
View file @
f3b06b93
...
@@ -3,65 +3,69 @@
...
@@ -3,65 +3,69 @@
// ref: https://developers.facebook.com/docs/applinks/metadata-reference
// ref: https://developers.facebook.com/docs/applinks/metadata-reference
export
type
AppLinks
=
{
export
type
AppLinks
=
{
ios
?:
AppLinksApple
|
Array
<
AppLinksApple
>
ios
?:
AppLinksApple
|
Array
<
AppLinksApple
>
|
undefined
iphone
?:
AppLinksApple
|
Array
<
AppLinksApple
>
iphone
?:
AppLinksApple
|
Array
<
AppLinksApple
>
|
undefined
ipad
?:
AppLinksApple
|
Array
<
AppLinksApple
>
ipad
?:
AppLinksApple
|
Array
<
AppLinksApple
>
|
undefined
android
?:
AppLinksAndroid
|
Array
<
AppLinksAndroid
>
android
?:
AppLinksAndroid
|
Array
<
AppLinksAndroid
>
|
undefined
windows_phone
?:
AppLinksWindows
|
Array
<
AppLinksWindows
>
windows_phone
?:
AppLinksWindows
|
Array
<
AppLinksWindows
>
|
undefined
windows
?:
AppLinksWindows
|
Array
<
AppLinksWindows
>
windows
?:
AppLinksWindows
|
Array
<
AppLinksWindows
>
|
undefined
windows_universal
?:
AppLinksWindows
|
Array
<
AppLinksWindows
>
windows_universal
?:
AppLinksWindows
|
Array
<
AppLinksWindows
>
|
undefined
web
?:
AppLinksWeb
|
Array
<
AppLinksWeb
>
web
?:
AppLinksWeb
|
Array
<
AppLinksWeb
>
|
undefined
}
}
export
type
ResolvedAppLinks
=
{
export
type
ResolvedAppLinks
=
{
ios
?:
Array
<
AppLinksApple
>
ios
?:
Array
<
AppLinksApple
>
|
undefined
iphone
?:
Array
<
AppLinksApple
>
iphone
?:
Array
<
AppLinksApple
>
|
undefined
ipad
?:
Array
<
AppLinksApple
>
ipad
?:
Array
<
AppLinksApple
>
|
undefined
android
?:
Array
<
AppLinksAndroid
>
android
?:
Array
<
AppLinksAndroid
>
|
undefined
windows_phone
?:
Array
<
AppLinksWindows
>
windows_phone
?:
Array
<
AppLinksWindows
>
|
undefined
windows
?:
Array
<
AppLinksWindows
>
windows
?:
Array
<
AppLinksWindows
>
|
undefined
windows_universal
?:
Array
<
AppLinksWindows
>
windows_universal
?:
Array
<
AppLinksWindows
>
|
undefined
web
?:
Array
<
AppLinksWeb
>
web
?:
Array
<
AppLinksWeb
>
|
undefined
}
}
export
type
AppLinksApple
=
{
export
type
AppLinksApple
=
{
url
:
string
|
URL
url
:
string
|
URL
app_store_id
?:
string
|
number
app_store_id
?:
string
|
number
|
undefined
app_name
?:
string
app_name
?:
string
|
undefined
}
}
export
type
AppLinksAndroid
=
{
export
type
AppLinksAndroid
=
{
package
:
string
package
:
string
url
?:
string
|
URL
url
?:
string
|
URL
|
undefined
class
?:
string
class
?:
string
|
undefined
app_name
?:
string
app_name
?:
string
|
undefined
}
}
export
type
AppLinksWindows
=
{
export
type
AppLinksWindows
=
{
url
:
string
|
URL
url
:
string
|
URL
app_id
?:
string
app_id
?:
string
|
undefined
app_name
?:
string
app_name
?:
string
|
undefined
}
}
export
type
AppLinksWeb
=
{
export
type
AppLinksWeb
=
{
url
:
string
|
URL
url
:
string
|
URL
should_fallback
?:
boolean
should_fallback
?:
boolean
|
undefined
}
}
// Apple Itunes APp
// Apple Itunes APp
// https://developer.apple.com/documentation/webkit/promoting_apps_with_smart_app_banners
// https://developer.apple.com/documentation/webkit/promoting_apps_with_smart_app_banners
export
type
ItunesApp
=
{
export
type
ItunesApp
=
{
appId
:
string
appId
:
string
appArgument
?:
string
appArgument
?:
string
|
undefined
}
}
// Viewport meta structure
// Viewport meta structure
// https://developer.mozilla.org/docs/Web/HTML/Viewport_meta_tag
// https://developer.mozilla.org/docs/Web/HTML/Viewport_meta_tag
// intentionally leaving out user-scalable, use a string if you want that behavior
// intentionally leaving out user-scalable, use a string if you want that behavior
export
type
ViewportLayout
=
{
export
type
ViewportLayout
=
{
width
?:
string
|
number
width
?:
string
|
number
|
undefined
height
?:
string
|
number
height
?:
string
|
number
|
undefined
initialScale
?:
number
initialScale
?:
number
|
undefined
minimumScale
?:
number
minimumScale
?:
number
|
undefined
maximumScale
?:
number
maximumScale
?:
number
|
undefined
userScalable
?:
boolean
userScalable
?:
boolean
|
undefined
viewportFit
?:
'auto'
|
'cover'
|
'contain'
viewportFit
?:
'auto'
|
'cover'
|
'contain'
|
undefined
interactiveWidget
?:
'resizes-visual'
|
'resizes-content'
|
'overlays-content'
interactiveWidget
?:
|
'resizes-visual'
|
'resizes-content'
|
'overlays-content'
|
undefined
}
}
// Apple Web App
// Apple Web App
...
@@ -69,37 +73,37 @@ export type ViewportLayout = {
...
@@ -69,37 +73,37 @@ export type ViewportLayout = {
// https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html
// https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html
export
type
AppleWebApp
=
{
export
type
AppleWebApp
=
{
// default true
// default true
capable
?:
boolean
capable
?:
boolean
|
undefined
title
?:
string
title
?:
string
|
undefined
startupImage
?:
AppleImage
|
Array
<
AppleImage
>
startupImage
?:
AppleImage
|
Array
<
AppleImage
>
|
undefined
// default "default"
// default "default"
statusBarStyle
?:
'default'
|
'black'
|
'black-translucent'
statusBarStyle
?:
'default'
|
'black'
|
'black-translucent'
|
undefined
}
}
export
type
AppleImage
=
string
|
AppleImageDescriptor
export
type
AppleImage
=
string
|
AppleImageDescriptor
export
type
AppleImageDescriptor
=
{
export
type
AppleImageDescriptor
=
{
url
:
string
url
:
string
media
?:
string
media
?:
string
|
undefined
}
}
export
type
ResolvedAppleWebApp
=
{
export
type
ResolvedAppleWebApp
=
{
capable
:
boolean
capable
:
boolean
title
?:
string
|
null
title
?:
string
|
null
|
undefined
startupImage
?:
AppleImageDescriptor
[]
|
null
startupImage
?:
AppleImageDescriptor
[]
|
null
|
undefined
statusBarStyle
?:
'default'
|
'black'
|
'black-translucent'
statusBarStyle
?:
'default'
|
'black'
|
'black-translucent'
|
undefined
}
}
export
type
Facebook
=
FacebookAppId
|
FacebookAdmins
export
type
Facebook
=
FacebookAppId
|
FacebookAdmins
export
type
FacebookAppId
=
{
export
type
FacebookAppId
=
{
appId
:
string
appId
:
string
admins
?:
never
admins
?:
never
|
undefined
}
}
export
type
FacebookAdmins
=
{
export
type
FacebookAdmins
=
{
appId
?:
never
appId
?:
never
|
undefined
admins
:
string
|
string
[]
admins
:
string
|
string
[]
}
}
export
type
ResolvedFacebook
=
{
export
type
ResolvedFacebook
=
{
appId
?:
string
appId
?:
string
|
undefined
admins
?:
string
[]
admins
?:
string
[]
|
undefined
}
}
// Format Detection
// Format Detection
...
@@ -110,9 +114,9 @@ export type ResolvedFacebook = {
...
@@ -110,9 +114,9 @@ export type ResolvedFacebook = {
// that can initiate a phone call
// that can initiate a phone call
// https://www.goodemailcode.com/email-code/template.html
// https://www.goodemailcode.com/email-code/template.html
export
type
FormatDetection
=
{
export
type
FormatDetection
=
{
telephone
?:
boolean
telephone
?:
boolean
|
undefined
date
?:
boolean
date
?:
boolean
|
undefined
address
?:
boolean
address
?:
boolean
|
undefined
email
?:
boolean
email
?:
boolean
|
undefined
url
?:
boolean
url
?:
boolean
|
undefined
}
}
packages/next/src/lib/metadata/types/manifest-types.ts
View file @
f3b06b93
...
@@ -11,37 +11,43 @@ type File = {
...
@@ -11,37 +11,43 @@ type File = {
type
Icon
=
{
type
Icon
=
{
src
:
string
src
:
string
type
?:
string
type
?:
string
|
undefined
sizes
?:
string
sizes
?:
string
|
undefined
purpose
?:
'any'
|
'maskable'
|
'monochrome'
purpose
?:
'any'
|
'maskable'
|
'monochrome'
|
undefined
}
}
export
type
Manifest
=
{
export
type
Manifest
=
{
background_color
?:
string
background_color
?:
string
|
undefined
categories
?:
string
[]
categories
?:
string
[]
|
undefined
description
?:
string
description
?:
string
|
undefined
dir
?:
'ltr'
|
'rtl'
|
'auto'
dir
?:
'ltr'
|
'rtl'
|
'auto'
|
undefined
display
?:
'fullscreen'
|
'standalone'
|
'minimal-ui'
|
'browser'
display
?:
'fullscreen'
|
'standalone'
|
'minimal-ui'
|
'browser'
|
undefined
display_override
?:
(
display_override
?:
|
'fullscreen'
|
(
|
'standalone'
|
'fullscreen'
|
'minimal-ui'
|
'standalone'
|
'browser'
|
'minimal-ui'
|
'window-controls-overlay'
|
'browser'
)[]
|
'window-controls-overlay'
file_handlers
?:
{
)[]
action
:
string
|
undefined
accept
:
{
file_handlers
?:
[
mimeType
:
string
]:
string
[]
|
{
}
action
:
string
}[]
accept
:
{
icons
?:
Icon
[]
[
mimeType
:
string
]:
string
[]
id
?:
string
}
lang
?:
string
}[]
launch_handler
?:
{
|
undefined
client_mode
:
ClientModeEnum
|
ClientModeEnum
[]
icons
?:
Icon
[]
|
undefined
}
id
?:
string
|
undefined
name
?:
string
lang
?:
string
|
undefined
launch_handler
?:
|
{
client_mode
:
ClientModeEnum
|
ClientModeEnum
[]
}
|
undefined
name
?:
string
|
undefined
orientation
?:
orientation
?:
|
'any'
|
'any'
|
'natural'
|
'natural'
...
@@ -51,57 +57,72 @@ export type Manifest = {
...
@@ -51,57 +57,72 @@ export type Manifest = {
|
'portrait-secondary'
|
'portrait-secondary'
|
'landscape-primary'
|
'landscape-primary'
|
'landscape-secondary'
|
'landscape-secondary'
prefer_related_applications
?:
boolean
|
undefined
protocol_handlers
?:
{
prefer_related_applications
?:
boolean
|
undefined
protocol
:
string
protocol_handlers
?:
url
:
string
|
{
}[]
protocol
:
string
related_applications
?:
{
url
:
string
platform
:
string
}[]
url
:
string
|
undefined
id
?:
string
related_applications
?:
}[]
|
{
scope
?:
string
platform
:
string
screenshots
?:
{
url
:
string
form_factor
?:
'narrow'
|
'wide'
id
?:
string
|
undefined
label
?:
string
}[]
platform
?:
|
undefined
|
'android'
scope
?:
string
|
undefined
|
'chromeos'
screenshots
?:
|
'ipados'
|
{
|
'ios'
form_factor
?:
'narrow'
|
'wide'
|
undefined
|
'kaios'
label
?:
string
|
undefined
|
'macos'
platform
?:
|
'windows'
|
'android'
|
'xbox'
|
'chromeos'
|
'chrome_web_store'
|
'ipados'
|
'itunes'
|
'ios'
|
'microsoft-inbox'
|
'kaios'
|
'microsoft-store'
|
'macos'
|
'play'
|
'windows'
src
:
string
|
'xbox'
type
?:
string
|
'chrome_web_store'
sizes
?:
string
|
'itunes'
}[]
|
'microsoft-inbox'
share_target
?:
{
|
'microsoft-store'
action
:
string
|
'play'
method
?:
'get'
|
'post'
|
'GET'
|
'POST'
|
undefined
enctype
?:
'application/x-www-form-urlencoded'
|
'multipart/form-data'
src
:
string
params
:
{
type
?:
string
|
undefined
title
?:
string
sizes
?:
string
|
undefined
text
?:
string
}[]
url
?:
string
|
undefined
files
?:
File
|
File
[]
share_target
?:
}
|
{
}
action
:
string
short_name
?:
string
method
?:
'get'
|
'post'
|
'GET'
|
'POST'
|
undefined
shortcuts
?:
{
enctype
?:
name
:
string
|
'application/x-www-form-urlencoded'
short_name
?:
string
|
'multipart/form-data'
description
?:
string
|
undefined
url
:
string
params
:
{
icons
?:
Icon
[]
title
?:
string
|
undefined
}[]
text
?:
string
|
undefined
start_url
?:
string
url
?:
string
|
undefined
theme_color
?:
string
files
?:
File
|
File
[]
|
undefined
}
}
|
undefined
short_name
?:
string
|
undefined
shortcuts
?:
|
{
name
:
string
short_name
?:
string
|
undefined
description
?:
string
|
undefined
url
:
string
icons
?:
Icon
[]
|
undefined
}[]
|
undefined
start_url
?:
string
|
undefined
theme_color
?:
string
|
undefined
}
}
packages/next/src/lib/metadata/types/metadata-interface.ts
View file @
f3b06b93
This diff is collapsed.
Click to expand it.
packages/next/src/lib/metadata/types/metadata-types.ts
View file @
f3b06b93
...
@@ -9,14 +9,14 @@ export interface DeprecatedMetadataFields {
...
@@ -9,14 +9,14 @@ export interface DeprecatedMetadataFields {
* Deprecated options that have a preferred method
* Deprecated options that have a preferred method
* @deprecated Use appWebApp to configure mobile-web-app-capable which provides
* @deprecated Use appWebApp to configure mobile-web-app-capable which provides
*/
*/
'apple-touch-fullscreen'
?:
never
'apple-touch-fullscreen'
?:
never
|
undefined
/**
/**
* Obsolete since iOS 7.
* Obsolete since iOS 7.
* @see https://web.dev/apple-touch-icon/
* @see https://web.dev/apple-touch-icon/
* @deprecated use icons.apple or instead
* @deprecated use icons.apple or instead
*/
*/
'apple-touch-icon-precomposed'
?:
never
'apple-touch-icon-precomposed'
?:
never
|
undefined
}
}
export
type
TemplateString
=
export
type
TemplateString
=
...
@@ -37,9 +37,9 @@ export type AbsoluteString = {
...
@@ -37,9 +37,9 @@ export type AbsoluteString = {
export
type
Author
=
{
export
type
Author
=
{
// renders as <link rel="author"...
// renders as <link rel="author"...
url
?:
string
|
URL
url
?:
string
|
URL
|
undefined
// renders as <meta name="author"...
// renders as <meta name="author"...
name
?:
string
name
?:
string
|
undefined
}
}
// does not include "unsafe-URL". to use this users should
// does not include "unsafe-URL". to use this users should
...
@@ -63,29 +63,29 @@ export type ColorSchemeEnum =
...
@@ -63,29 +63,29 @@ export type ColorSchemeEnum =
type
RobotsInfo
=
{
type
RobotsInfo
=
{
// all and none will be inferred from index/follow boolean options
// all and none will be inferred from index/follow boolean options
index
?:
boolean
index
?:
boolean
|
undefined
follow
?:
boolean
follow
?:
boolean
|
undefined
/** @deprecated set index to false instead */
/** @deprecated set index to false instead */
noindex
?:
never
noindex
?:
never
|
undefined
/** @deprecated set follow to false instead */
/** @deprecated set follow to false instead */
nofollow
?:
never
nofollow
?:
never
|
undefined
noarchive
?:
boolean
noarchive
?:
boolean
|
undefined
nosnippet
?:
boolean
nosnippet
?:
boolean
|
undefined
noimageindex
?:
boolean
noimageindex
?:
boolean
|
undefined
nocache
?:
boolean
nocache
?:
boolean
|
undefined
notranslate
?:
boolean
notranslate
?:
boolean
|
undefined
indexifembedded
?:
boolean
indexifembedded
?:
boolean
|
undefined
nositelinkssearchbox
?:
boolean
nositelinkssearchbox
?:
boolean
|
undefined
unavailable_after
?:
string
unavailable_after
?:
string
|
undefined
'max-video-preview'
?:
number
|
string
'max-video-preview'
?:
number
|
string
|
undefined
'max-image-preview'
?:
'none'
|
'standard'
|
'large'
'max-image-preview'
?:
'none'
|
'standard'
|
'large'
|
undefined
'max-snippet'
?:
number
'max-snippet'
?:
number
|
undefined
}
}
export
type
Robots
=
RobotsInfo
&
{
export
type
Robots
=
RobotsInfo
&
{
// if you want to specify an alternate robots just for google
// if you want to specify an alternate robots just for google
googleBot
?:
string
|
RobotsInfo
googleBot
?:
string
|
RobotsInfo
|
undefined
}
}
export
type
ResolvedRobots
=
{
export
type
ResolvedRobots
=
{
...
@@ -97,63 +97,67 @@ export type IconURL = string | URL
...
@@ -97,63 +97,67 @@ export type IconURL = string | URL
export
type
Icon
=
IconURL
|
IconDescriptor
export
type
Icon
=
IconURL
|
IconDescriptor
export
type
IconDescriptor
=
{
export
type
IconDescriptor
=
{
url
:
string
|
URL
url
:
string
|
URL
type
?:
string
type
?:
string
|
undefined
sizes
?:
string
sizes
?:
string
|
undefined
color
?:
string
color
?:
string
|
undefined
/** defaults to rel="icon" unless superseded by Icons map */
/** defaults to rel="icon" unless superseded by Icons map */
rel
?:
string
rel
?:
string
|
undefined
media
?:
string
media
?:
string
|
undefined
/**
/**
* @see https://developer.mozilla.org/docs/Web/API/HTMLImageElement/fetchPriority
* @see https://developer.mozilla.org/docs/Web/API/HTMLImageElement/fetchPriority
*/
*/
fetchPriority
?:
'high'
|
'low'
|
'auto'
fetchPriority
?:
'high'
|
'low'
|
'auto'
|
undefined
}
}
export
type
Icons
=
{
export
type
Icons
=
{
/** rel="icon" */
/** rel="icon" */
icon
?:
Icon
|
Icon
[]
icon
?:
Icon
|
Icon
[]
|
undefined
/** rel="shortcut icon" */
/** rel="shortcut icon" */
shortcut
?:
Icon
|
Icon
[]
shortcut
?:
Icon
|
Icon
[]
|
undefined
/**
/**
* @see https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html
* @see https://developer.apple.com/library/archive/documentation/AppleApplications/Reference/SafariWebContent/ConfiguringWebApplications/ConfiguringWebApplications.html
* rel="apple-touch-icon"
* rel="apple-touch-icon"
*/
*/
apple
?:
Icon
|
Icon
[]
apple
?:
Icon
|
Icon
[]
|
undefined
/** rel inferred from descriptor, defaults to "icon" */
/** rel inferred from descriptor, defaults to "icon" */
other
?:
IconDescriptor
|
IconDescriptor
[]
other
?:
IconDescriptor
|
IconDescriptor
[]
|
undefined
}
}
export
type
Verification
=
{
export
type
Verification
=
{
google
?:
null
|
string
|
number
|
(
string
|
number
)[]
google
?:
null
|
string
|
number
|
(
string
|
number
)[]
|
undefined
yahoo
?:
null
|
string
|
number
|
(
string
|
number
)[]
yahoo
?:
null
|
string
|
number
|
(
string
|
number
)[]
|
undefined
yandex
?:
null
|
string
|
number
|
(
string
|
number
)[]
yandex
?:
null
|
string
|
number
|
(
string
|
number
)[]
|
undefined
me
?:
null
|
string
|
number
|
(
string
|
number
)[]
me
?:
null
|
string
|
number
|
(
string
|
number
)[]
|
undefined
// if you ad-hoc additional verification
// if you ad-hoc additional verification
other
?:
{
other
?:
[
name
:
string
]:
string
|
number
|
(
string
|
number
)[]
|
{
}
[
name
:
string
]:
string
|
number
|
(
string
|
number
)[]
}
|
undefined
}
}
export
type
ResolvedVerification
=
{
export
type
ResolvedVerification
=
{
google
?:
null
|
(
string
|
number
)[]
google
?:
null
|
(
string
|
number
)[]
|
undefined
yahoo
?:
null
|
(
string
|
number
)[]
yahoo
?:
null
|
(
string
|
number
)[]
|
undefined
yandex
?:
null
|
(
string
|
number
)[]
yandex
?:
null
|
(
string
|
number
)[]
|
undefined
me
?:
null
|
(
string
|
number
)[]
me
?:
null
|
(
string
|
number
)[]
|
undefined
other
?:
{
other
?:
[
name
:
string
]:
(
string
|
number
)[]
|
{
}
[
name
:
string
]:
(
string
|
number
)[]
}
|
undefined
}
}
export
type
ResolvedIcons
=
{
export
type
ResolvedIcons
=
{
icon
:
IconDescriptor
[]
icon
:
IconDescriptor
[]
apple
:
IconDescriptor
[]
apple
:
IconDescriptor
[]
shortcut
?:
IconDescriptor
[]
shortcut
?:
IconDescriptor
[]
|
undefined
other
?:
IconDescriptor
[]
other
?:
IconDescriptor
[]
|
undefined
}
}
export
type
ThemeColorDescriptor
=
{
export
type
ThemeColorDescriptor
=
{
color
:
string
color
:
string
media
?:
string
media
?:
string
|
undefined
}
}
export
type
Restriction
=
{
export
type
Restriction
=
{
...
@@ -165,21 +169,23 @@ export type Videos = {
...
@@ -165,21 +169,23 @@ export type Videos = {
title
:
string
title
:
string
thumbnail_loc
:
string
thumbnail_loc
:
string
description
:
string
description
:
string
content_loc
?:
string
content_loc
?:
string
|
undefined
player_loc
?:
string
player_loc
?:
string
|
undefined
duration
?:
number
duration
?:
number
|
undefined
expiration_date
?:
Date
|
string
expiration_date
?:
Date
|
string
|
undefined
rating
?:
number
rating
?:
number
|
undefined
view_count
?:
number
view_count
?:
number
|
undefined
publication_date
?:
Date
|
string
publication_date
?:
Date
|
string
|
undefined
family_friendly
?:
'yes'
|
'no'
family_friendly
?:
'yes'
|
'no'
|
undefined
restriction
?:
Restriction
restriction
?:
Restriction
|
undefined
platform
?:
Restriction
platform
?:
Restriction
|
undefined
requires_subscription
?:
'yes'
|
'no'
requires_subscription
?:
'yes'
|
'no'
|
undefined
uploader
?:
{
uploader
?:
info
?:
string
|
{
content
?:
string
info
?:
string
|
undefined
}
content
?:
string
|
undefined
live
?:
'yes'
|
'no'
}
tag
?:
string
|
undefined
live
?:
'yes'
|
'no'
|
undefined
tag
?:
string
|
undefined
}
}
packages/next/src/lib/metadata/types/opengraph-types.ts
View file @
f3b06b93
This diff is collapsed.
Click to expand it.
packages/next/src/lib/metadata/types/twitter-types.ts
View file @
f3b06b93
...
@@ -11,13 +11,13 @@ export type Twitter =
...
@@ -11,13 +11,13 @@ export type Twitter =
type
TwitterMetadata
=
{
type
TwitterMetadata
=
{
// defaults to card="summary"
// defaults to card="summary"
site
?:
string
// username for account associated to the site itself
site
?:
string
|
undefined
// username for account associated to the site itself
siteId
?:
string
// id for account associated to the site itself
siteId
?:
string
|
undefined
// id for account associated to the site itself
creator
?:
string
// username for the account associated to the creator of the content on the site
creator
?:
string
|
undefined
// username for the account associated to the creator of the content on the site
creatorId
?:
string
// id for the account associated to the creator of the content on the site
creatorId
?:
string
|
undefined
// id for the account associated to the creator of the content on the site
description
?:
string
description
?:
string
|
undefined
title
?:
string
|
TemplateString
title
?:
string
|
TemplateString
|
undefined
images
?:
TwitterImage
|
Array
<
TwitterImage
>
images
?:
TwitterImage
|
Array
<
TwitterImage
>
|
undefined
}
}
type
TwitterSummary
=
TwitterMetadata
&
{
type
TwitterSummary
=
TwitterMetadata
&
{
card
:
'summary'
card
:
'summary'
...
@@ -35,26 +35,28 @@ type TwitterApp = TwitterMetadata & {
...
@@ -35,26 +35,28 @@ type TwitterApp = TwitterMetadata & {
}
}
export
type
TwitterAppDescriptor
=
{
export
type
TwitterAppDescriptor
=
{
id
:
{
id
:
{
iphone
?:
string
|
number
iphone
?:
string
|
number
|
undefined
ipad
?:
string
|
number
ipad
?:
string
|
number
|
undefined
googleplay
?:
string
googleplay
?:
string
|
undefined
}
}
url
?:
{
url
?:
iphone
?:
string
|
URL
|
{
ipad
?:
string
|
URL
iphone
?:
string
|
URL
|
undefined
googleplay
?:
string
|
URL
ipad
?:
string
|
URL
|
undefined
}
googleplay
?:
string
|
URL
|
undefined
name
?:
string
}
|
undefined
name
?:
string
|
undefined
}
}
type
TwitterImage
=
string
|
TwitterImageDescriptor
|
URL
type
TwitterImage
=
string
|
TwitterImageDescriptor
|
URL
type
TwitterImageDescriptor
=
{
type
TwitterImageDescriptor
=
{
url
:
string
|
URL
url
:
string
|
URL
alt
?:
string
alt
?:
string
|
undefined
secureUrl
?:
string
|
URL
secureUrl
?:
string
|
URL
|
undefined
type
?:
string
type
?:
string
|
undefined
width
?:
string
|
number
width
?:
string
|
number
|
undefined
height
?:
string
|
number
height
?:
string
|
number
|
undefined
}
}
type
TwitterPlayerDescriptor
=
{
type
TwitterPlayerDescriptor
=
{
playerUrl
:
string
|
URL
playerUrl
:
string
|
URL
...
@@ -65,11 +67,11 @@ type TwitterPlayerDescriptor = {
...
@@ -65,11 +67,11 @@ type TwitterPlayerDescriptor = {
type
ResolvedTwitterImage
=
{
type
ResolvedTwitterImage
=
{
url
:
string
|
URL
url
:
string
|
URL
alt
?:
string
alt
?:
string
|
undefined
secureUrl
?:
string
|
URL
secureUrl
?:
string
|
URL
|
undefined
type
?:
string
type
?:
string
|
undefined
width
?:
string
|
number
width
?:
string
|
number
|
undefined
height
?:
string
|
number
height
?:
string
|
number
|
undefined
}
}
type
ResolvedTwitterSummary
=
{
type
ResolvedTwitterSummary
=
{
site
:
string
|
null
site
:
string
|
null
...
@@ -78,7 +80,7 @@ type ResolvedTwitterSummary = {
...
@@ -78,7 +80,7 @@ type ResolvedTwitterSummary = {
creatorId
:
string
|
null
creatorId
:
string
|
null
description
:
string
|
null
description
:
string
|
null
title
:
AbsoluteTemplateString
title
:
AbsoluteTemplateString
images
?:
Array
<
ResolvedTwitterImage
>
images
?:
Array
<
ResolvedTwitterImage
>
|
undefined
}
}
type
ResolvedTwitterPlayer
=
ResolvedTwitterSummary
&
{
type
ResolvedTwitterPlayer
=
ResolvedTwitterSummary
&
{
players
:
Array
<
TwitterPlayerDescriptor
>
players
:
Array
<
TwitterPlayerDescriptor
>
...
...
test/production/typescript-basic/typechecking/metadata/manifest.ts
0 → 100644
View file @
f3b06b93
import
type
{
MetadataRoute
}
from
'next'
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
;()
=>
{
;({
background_color
:
undefined
,
categories
:
undefined
,
description
:
undefined
,
dir
:
undefined
,
display
:
undefined
,
display_override
:
undefined
,
file_handlers
:
undefined
,
icons
:
undefined
,
id
:
undefined
,
lang
:
undefined
,
launch_handler
:
undefined
,
name
:
undefined
,
orientation
:
undefined
,
prefer_related_applications
:
undefined
,
protocol_handlers
:
undefined
,
related_applications
:
undefined
,
scope
:
undefined
,
screenshots
:
undefined
,
share_target
:
undefined
,
short_name
:
undefined
,
shortcuts
:
undefined
,
start_url
:
undefined
,
theme_color
:
undefined
,
})
satisfies
MetadataRoute
.
Manifest
;({
icons
:
[
{
src
:
''
,
type
:
undefined
,
sizes
:
undefined
,
purpose
:
undefined
,
},
],
related_applications
:
[
{
platform
:
''
,
url
:
''
,
id
:
undefined
,
},
],
screenshots
:
[
{
form_factor
:
undefined
,
label
:
undefined
,
platform
:
undefined
,
src
:
''
,
type
:
undefined
,
sizes
:
undefined
,
},
],
share_target
:
{
action
:
''
,
method
:
undefined
,
enctype
:
undefined
,
params
:
{
title
:
undefined
,
text
:
undefined
,
url
:
undefined
,
files
:
undefined
,
},
},
shortcuts
:
[
{
name
:
''
,
short_name
:
undefined
,
description
:
undefined
,
url
:
''
,
icons
:
undefined
,
},
],
})
satisfies
MetadataRoute
.
Manifest
}
test/production/typescript-basic/typechecking/metadata/metadata.ts
0 → 100644
View file @
f3b06b93
This diff is collapsed.
Click to expand it.
test/production/typescript-basic/typechecking/metadata/robots.ts
0 → 100644
View file @
f3b06b93
import
type
{
MetadataRoute
}
from
'next'
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
;()
=>
{
;({
rules
:
{
userAgent
:
undefined
,
allow
:
undefined
,
disallow
:
undefined
,
crawlDelay
:
undefined
,
},
sitemap
:
undefined
,
host
:
undefined
,
})
satisfies
MetadataRoute
.
Robots
}
test/production/typescript-basic/typechecking/metadata/sitemap.ts
0 → 100644
View file @
f3b06b93
import
type
{
MetadataRoute
}
from
'next'
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
;()
=>
{
;({
url
:
''
,
lastModified
:
undefined
,
changeFrequency
:
undefined
,
priority
:
undefined
,
alternates
:
undefined
,
images
:
undefined
,
videos
:
undefined
,
})
satisfies
MetadataRoute
.
Sitemap
[
number
]
;({
url
:
''
,
alternates
:
{
languages
:
undefined
,
},
videos
:
[
{
title
:
''
,
thumbnail_loc
:
''
,
description
:
''
,
content_loc
:
undefined
,
player_loc
:
undefined
,
duration
:
undefined
,
expiration_date
:
undefined
,
rating
:
undefined
,
view_count
:
undefined
,
publication_date
:
undefined
,
family_friendly
:
undefined
,
restriction
:
undefined
,
platform
:
undefined
,
requires_subscription
:
undefined
,
uploader
:
undefined
,
live
:
undefined
,
tag
:
undefined
,
},
],
})
satisfies
MetadataRoute
.
Sitemap
[
number
]
;({
url
:
''
,
alternates
:
{
languages
:
{
en
:
undefined
,
},
},
videos
:
[
{
title
:
''
,
thumbnail_loc
:
''
,
description
:
''
,
uploader
:
{
info
:
undefined
,
content
:
undefined
,
},
},
],
})
satisfies
MetadataRoute
.
Sitemap
[
number
]
}
test/production/typescript-basic/typechecking/metadata/viewport.ts
0 → 100644
View file @
f3b06b93
import
type
{
Viewport
}
from
'next'
// eslint-disable-next-line @typescript-eslint/no-unused-expressions
;()
=>
{
;({
width
:
undefined
,
height
:
undefined
,
initialScale
:
undefined
,
minimumScale
:
undefined
,
maximumScale
:
undefined
,
userScalable
:
undefined
,
viewportFit
:
undefined
,
interactiveWidget
:
undefined
,
themeColor
:
undefined
,
colorScheme
:
undefined
,
})
satisfies
Viewport
;({
themeColor
:
{
color
:
''
,
media
:
undefined
,
},
})
satisfies
Viewport
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment