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
9ce177f9
Unverified
Commit
9ce177f9
authored
Apr 25, 2019
by
Tim Neutkens
Committed by
GitHub
Apr 25, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add missing property types for styled-jsx (#7154)
parent
78a959bd
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
101 additions
and
93 deletions
+101
-93
package.json
packages/next/package.json
+3
-1
amp-react.d.ts
packages/next/types/amp-react.d.ts
+0
-14
index.d.ts
packages/next/types/index.d.ts
+13
-78
misc.d.ts
packages/next/types/misc.d.ts
+85
-0
No files found.
packages/next/package.json
View file @
9ce177f9
...
@@ -7,6 +7,7 @@
...
@@ -7,6 +7,7 @@
"repository"
:
"zeit/next.js"
,
"repository"
:
"zeit/next.js"
,
"bugs"
:
"https://github.com/zeit/next.js/issues"
,
"bugs"
:
"https://github.com/zeit/next.js/issues"
,
"homepage"
:
"https://nextjs.org"
,
"homepage"
:
"https://nextjs.org"
,
"types"
:
"types/index.d.ts"
,
"files"
:
[
"files"
:
[
"dist"
,
"dist"
,
"app.js"
,
"app.js"
,
...
@@ -34,7 +35,8 @@
...
@@ -34,7 +35,8 @@
"router.js"
,
"router.js"
,
"router.d.ts"
,
"router.d.ts"
,
"amp.js"
,
"amp.js"
,
"amp.d.ts"
"amp.d.ts"
,
"types/index.d.ts"
],
],
"bin"
:
{
"bin"
:
{
"next"
:
"./dist/bin/next"
"next"
:
"./dist/bin/next"
...
...
packages/next/types/amp-react.d.ts
deleted
100644 → 0
View file @
78a959bd
import
React
from
'react'
/**
* Types for AMP in React are not available, here we add only the types required for the core
*/
declare
module
'react'
{
interface
HtmlHTMLAttributes
<
T
>
extends
React
.
HTMLAttributes
<
T
>
{
amp
?:
string
;
}
// nonce in <link /> is allowed
interface
LinkHTMLAttributes
<
T
>
extends
HTMLAttributes
<
T
>
{
nonce
?:
string
}
}
packages/next/types/index.d.ts
View file @
9ce177f9
declare
module
'@babel/plugin-transform-modules-commonjs'
;
import
React
from
'react'
declare
module
'next-server/next-config'
;
declare
module
'next-server/constants'
;
declare
module
'webpack/lib/GraphHelpers'
;
declare
module
'unfetch'
;
declare
module
'styled-jsx/server'
;
// Extend the React types with missing properties
declare
module
'next/dist/compiled/nanoid/index.js'
{
declare
module
'react'
{
function
nanoid
(
size
?:
number
):
string
;
// <html amp=""> support
interface
HtmlHTMLAttributes
<
T
>
extends
React
.
HTMLAttributes
<
T
>
{
export
=
nanoid
;
amp
?:
string
;
}
declare
module
'next/dist/compiled/unistore'
{
import
unistore
from
'unistore'
export
=
unistore
}
declare
module
'next/dist/compiled/resolve/index.js'
{
import
resolve
from
'resolve'
export
=
resolve
;
}
declare
module
'next/dist/compiled/text-table'
{
function
textTable
(
rows
:
Array
<
Array
<
{}
>>
,
opts
?:
{
hsep
?:
string
,
align
?:
Array
<
'l'
|
'r'
|
'c'
|
'.'
>
,
stringLength
?(
str
:
string
):
number
}):
string
;
export
=
textTable
;
}
declare
module
'next/dist/compiled/arg/index.js'
{
function
arg
<
T
extends
arg
.
Spec
>
(
spec
:
T
,
options
?:
{
argv
?:
string
[],
permissive
?:
boolean
}):
arg
.
Result
<
T
>
;
namespace
arg
{
export
type
Handler
=
(
value
:
string
)
=>
any
;
export
interface
Spec
{
[
key
:
string
]:
string
|
Handler
|
[
Handler
];
}
export
type
Result
<
T
extends
Spec
>
=
{
_
:
string
[]
}
&
{
[
K
in
keyof
T
]:
T
[
K
]
extends
string
?
never
:
T
[
K
]
extends
Handler
?
ReturnType
<
T
[
K
]
>
:
T
[
K
]
extends
[
Handler
]
?
Array
<
ReturnType
<
T
[
K
][
0
]
>>
:
never
};
}
}
export
=
arg
;
// <link nonce=""> support
}
interface
LinkHTMLAttributes
<
T
>
extends
HTMLAttributes
<
T
>
{
nonce
?:
string
declare
module
'autodll-webpack-plugin'
{
import
webpack
from
'webpack'
class
AutoDllPlugin
implements
webpack
.
Plugin
{
constructor
(
settings
?:
{
inject
?:
boolean
,
plugins
?:
webpack
.
Configuration
[
"plugins"
],
context
?:
string
,
debug
?:
boolean
,
filename
?:
string
,
path
?:
string
,
inherit
?:
boolean
,
entry
?:
webpack
.
Entry
,
config
?:
webpack
.
Configuration
})
apply
:
webpack
.
Plugin
[
"apply"
]
[
k
:
string
]:
any
}
}
export
=
AutoDllPlugin
// <style jsx> and <style jsx global> support for styled-jsx
}
interface
StyleHTMLAttributes
<
T
>
extends
HTMLAttributes
<
T
>
{
jsx
?:
boolean
;
declare
module
NodeJS
{
global
?:
boolean
;
interface
Process
{
crossOrigin
?:
string
;
}
}
}
}
packages/next/types/misc.d.ts
0 → 100644
View file @
9ce177f9
declare
module
'@babel/plugin-transform-modules-commonjs'
;
declare
module
'next-server/next-config'
;
declare
module
'next-server/constants'
;
declare
module
'webpack/lib/GraphHelpers'
;
declare
module
'unfetch'
;
declare
module
'styled-jsx/server'
;
declare
module
'next/dist/compiled/nanoid/index.js'
{
function
nanoid
(
size
?:
number
):
string
;
export
=
nanoid
;
}
declare
module
'next/dist/compiled/unistore'
{
import
unistore
from
'unistore'
export
=
unistore
}
declare
module
'next/dist/compiled/resolve/index.js'
{
import
resolve
from
'resolve'
export
=
resolve
;
}
declare
module
'next/dist/compiled/text-table'
{
function
textTable
(
rows
:
Array
<
Array
<
{}
>>
,
opts
?:
{
hsep
?:
string
,
align
?:
Array
<
'l'
|
'r'
|
'c'
|
'.'
>
,
stringLength
?(
str
:
string
):
number
}):
string
;
export
=
textTable
;
}
declare
module
'next/dist/compiled/arg/index.js'
{
function
arg
<
T
extends
arg
.
Spec
>
(
spec
:
T
,
options
?:
{
argv
?:
string
[],
permissive
?:
boolean
}):
arg
.
Result
<
T
>
;
namespace
arg
{
export
type
Handler
=
(
value
:
string
)
=>
any
;
export
interface
Spec
{
[
key
:
string
]:
string
|
Handler
|
[
Handler
];
}
export
type
Result
<
T
extends
Spec
>
=
{
_
:
string
[]
}
&
{
[
K
in
keyof
T
]:
T
[
K
]
extends
string
?
never
:
T
[
K
]
extends
Handler
?
ReturnType
<
T
[
K
]
>
:
T
[
K
]
extends
[
Handler
]
?
Array
<
ReturnType
<
T
[
K
][
0
]
>>
:
never
};
}
export
=
arg
;
}
declare
module
'autodll-webpack-plugin'
{
import
webpack
from
'webpack'
class
AutoDllPlugin
implements
webpack
.
Plugin
{
constructor
(
settings
?:
{
inject
?:
boolean
,
plugins
?:
webpack
.
Configuration
[
"plugins"
],
context
?:
string
,
debug
?:
boolean
,
filename
?:
string
,
path
?:
string
,
inherit
?:
boolean
,
entry
?:
webpack
.
Entry
,
config
?:
webpack
.
Configuration
})
apply
:
webpack
.
Plugin
[
"apply"
]
[
k
:
string
]:
any
}
export
=
AutoDllPlugin
}
declare
module
NodeJS
{
interface
Process
{
crossOrigin
?:
string
;
}
}
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