Skip to content

Commit aaf2003

Browse files
committed
version 0.7.0
1 parent 7f5b7fa commit aaf2003

File tree

15 files changed

+1270
-40
lines changed

15 files changed

+1270
-40
lines changed

.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"semi": false,
3+
"singleQuote": true,
4+
"printWidth": 120
5+
}

.travis.yml

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
11
language: node_js
22
node_js:
3-
- "10"
4-
5-
install:
6-
- npm install
7-
8-
script:
9-
- npm run test
3+
- '10'

.vscode/settings.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"typescript.tsdk": "node_modules/typescript/lib"
3+
}

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
**Note**: Gaps between patch versions are faulty/broken releases. **Note**: A feature tagged as Experimental is in a
1414
high state of flux, you're at risk of it changing without notice.
1515

16+
# 0.7.0
17+
18+
- **Breaking Change**
19+
- Upgrade to io-ts@2 and add fp-ts dependency, #20 (@ifiokjr)
20+
1621
# 0.6.2
1722

1823
- **Polish**

README.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,11 @@ export default class Alert extends React.Component<Props, void> {
6262
# Errors on console
6363

6464
```ts
65-
;<Alert type="foo" /> // => Invalid value "foo" supplied to : Props/type: AlertType
65+
<Alert type="foo" /> // => Invalid value "foo" supplied to : Props/type: AlertType
6666
```
6767

6868
```ts
69-
;<Alert type="info" foo="bar" /> // => Invalid additional prop(s): ["foo"]
69+
<Alert type="info" foo="bar" /> // => Invalid additional prop(s): ["foo"]
7070
```
7171

7272
# Excess Property Checks
@@ -136,4 +136,7 @@ export default class Alert extends React.Component<Props, void> {
136136

137137
# TypeScript compatibility
138138

139-
The stable version is tested against TypeScript 3.2.2, but should run with TypeScript 2.7.1+ too
139+
| `prop-type-ts` version | required `typescript` version |
140+
| ---------------------- | ----------------------------- |
141+
| 0.7.x+ | 3.5+ |
142+
| 0.6.x+ | 3.2+ |

docs/_config.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
remote_theme: pmarsceill/just-the-docs
2+
3+
# Enable or disable the site search
4+
search_enabled: true
5+
6+
# Aux links for the upper right navigation
7+
aux_links:
8+
'prop-types-ts on GitHub':
9+
- 'https://github.com/gcanti/prop-types-ts'

docs/index.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
---
2+
title: Home
3+
nav_order: 1
4+
---

docs/modules/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
title: Modules
3+
has_children: true
4+
permalink: /docs/modules
5+
nav_order: 2
6+
---

docs/modules/index.ts.md

Lines changed: 218 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,218 @@
1+
---
2+
title: index.ts
3+
nav_order: 1
4+
parent: Modules
5+
---
6+
7+
# index overview
8+
9+
Added in v0.6.0
10+
11+
---
12+
13+
<h2 class="text-delta">Table of contents</h2>
14+
15+
- [PropTypeableIntersection (interface)](#proptypeableintersection-interface)
16+
- [PropTypeableReadonlyType (interface)](#proptypeablereadonlytype-interface)
17+
- [PropTypeableRefinement (interface)](#proptypeablerefinement-interface)
18+
- [PropTypeableUnion (interface)](#proptypeableunion-interface)
19+
- [Options (type alias)](#options-type-alias)
20+
- [PropTypeable (type alias)](#proptypeable-type-alias)
21+
- [ReactChildType (class)](#reactchildtype-class)
22+
- [ReactElementType (class)](#reactelementtype-class)
23+
- [ReactFragmentType (class)](#reactfragmenttype-class)
24+
- [ReactNodeType (class)](#reactnodetype-class)
25+
- [ReactChild (constant)](#reactchild-constant)
26+
- [ReactElement (constant)](#reactelement-constant)
27+
- [ReactFragment (constant)](#reactfragment-constant)
28+
- [ReactNode (constant)](#reactnode-constant)
29+
- [getPropTypes (function)](#getproptypes-function)
30+
- [props (function)](#props-function)
31+
32+
---
33+
34+
# PropTypeableIntersection (interface)
35+
36+
**Signature**
37+
38+
```ts
39+
export interface PropTypeableIntersection extends t.IntersectionType<Array<PropTypeable>> {}
40+
```
41+
42+
Added in v0.6.0
43+
44+
# PropTypeableReadonlyType (interface)
45+
46+
**Signature**
47+
48+
```ts
49+
export interface PropTypeableReadonlyType extends t.ReadonlyType<PropTypeable> {}
50+
```
51+
52+
Added in v0.6.0
53+
54+
# PropTypeableRefinement (interface)
55+
56+
**Signature**
57+
58+
```ts
59+
export interface PropTypeableRefinement extends t.RefinementType<PropTypeable> {}
60+
```
61+
62+
Added in v0.6.0
63+
64+
# PropTypeableUnion (interface)
65+
66+
**Signature**
67+
68+
```ts
69+
export interface PropTypeableUnion extends t.UnionType<Array<PropTypeable>> {}
70+
```
71+
72+
Added in v0.6.0
73+
74+
# Options (type alias)
75+
76+
**Signature**
77+
78+
```ts
79+
export type Options = {
80+
strict?: boolean
81+
children?: t.Mixed
82+
reporter?: Reporter<string[]>
83+
}
84+
```
85+
86+
Added in v0.6.0
87+
88+
# PropTypeable (type alias)
89+
90+
**Signature**
91+
92+
```ts
93+
export type PropTypeable =
94+
// tslint:disable-next-line: deprecation
95+
| t.AnyType
96+
| PropTypeableRefinement
97+
| PropTypeableReadonlyType
98+
| PropTypeableIntersection
99+
| t.InterfaceType<any>
100+
// tslint:disable-next-line: deprecation
101+
| t.StrictType<any>
102+
| t.PartialType<any>
103+
| PropTypeableUnion
104+
```
105+
106+
Added in v0.6.0
107+
108+
# ReactChildType (class)
109+
110+
**Signature**
111+
112+
```ts
113+
export class ReactChildType {
114+
constructor() { ... }
115+
...
116+
}
117+
```
118+
119+
Added in v0.6.0
120+
121+
# ReactElementType (class)
122+
123+
**Signature**
124+
125+
```ts
126+
export class ReactElementType {
127+
constructor() { ... }
128+
...
129+
}
130+
```
131+
132+
Added in v0.6.0
133+
134+
# ReactFragmentType (class)
135+
136+
**Signature**
137+
138+
```ts
139+
export class ReactFragmentType {
140+
constructor() { ... }
141+
...
142+
}
143+
```
144+
145+
Added in v0.6.0
146+
147+
# ReactNodeType (class)
148+
149+
**Signature**
150+
151+
```ts
152+
export class ReactNodeType {
153+
constructor() { ... }
154+
...
155+
}
156+
```
157+
158+
Added in v0.6.0
159+
160+
# ReactChild (constant)
161+
162+
**Signature**
163+
164+
```ts
165+
export const ReactChild: ReactChildType = ...
166+
```
167+
168+
Added in v0.6.0
169+
170+
# ReactElement (constant)
171+
172+
**Signature**
173+
174+
```ts
175+
export const ReactElement: ReactElementType = ...
176+
```
177+
178+
Added in v0.6.0
179+
180+
# ReactFragment (constant)
181+
182+
**Signature**
183+
184+
```ts
185+
export const ReactFragment: ReactFragmentType = ...
186+
```
187+
188+
Added in v0.6.0
189+
190+
# ReactNode (constant)
191+
192+
**Signature**
193+
194+
```ts
195+
export const ReactNode: ReactNodeType = ...
196+
```
197+
198+
Added in v0.6.0
199+
200+
# getPropTypes (function)
201+
202+
**Signature**
203+
204+
```ts
205+
export function getPropTypes(type: PropTypeable, options: Options = { strict: true }) { ... }
206+
```
207+
208+
Added in v0.6.0
209+
210+
# props (function)
211+
212+
**Signature**
213+
214+
```ts
215+
export function props(type: PropTypeable, options?: Options): (C: React.ComponentClass<any>) => void { ... }
216+
```
217+
218+
Added in v0.6.0

0 commit comments

Comments
 (0)