-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve typescript definitions #525
Merged
cagataycivici
merged 1 commit into
primefaces:master
from
aloker:feature/basic-typescript-issues
Aug 21, 2018
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
import React = require("react"); | ||
import {Omit} from "../util"; | ||
|
||
interface ButtonProps extends React.HTMLProps<HTMLButtonElement> { | ||
interface ButtonProps extends Omit<React.HTMLProps<HTMLButtonElement>, 'ref'> { | ||
label?: string; | ||
icon?: string; | ||
iconPos?: string; | ||
cornerStyleClass?: string; | ||
[key: string]: any; | ||
} | ||
|
||
export class Button extends React.Component<ButtonProps,any> {} | ||
export class Button extends React.Component<ButtonProps,any> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import React = require("react"); | ||
|
||
// tslint:disable-next-line:no-empty-interface | ||
interface ColumnGroupProps { | ||
} | ||
|
||
export class ColumnGroup extends React.Component<ColumnGroupProps,any> {} | ||
export class ColumnGroup extends React.Component<ColumnGroupProps,any> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import React = require("react"); | ||
|
||
// tslint:disable-next-line:no-empty-interface | ||
interface BodyCellProps { | ||
} | ||
|
||
export class BodyCell extends React.Component<BodyCellProps,any> {} | ||
export class BodyCell extends React.Component<BodyCellProps,any> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import React = require("react"); | ||
|
||
// tslint:disable-next-line:no-empty-interface | ||
interface BodyRowProps { | ||
} | ||
|
||
export class BodyRow extends React.Component<BodyRowProps,any> {} | ||
export class BodyRow extends React.Component<BodyRowProps,any> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import React = require("react"); | ||
|
||
// tslint:disable-next-line:no-empty-interface | ||
interface FooterCellProps { | ||
} | ||
|
||
export class FooterCell extends React.Component<FooterCellProps,any> {} | ||
export class FooterCell extends React.Component<FooterCellProps,any> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import React = require("react"); | ||
|
||
// tslint:disable-next-line:no-empty-interface | ||
interface HeaderCellProps { | ||
} | ||
|
||
export class HeaderCell extends React.Component<HeaderCellProps,any> {} | ||
export class HeaderCell extends React.Component<HeaderCellProps,any> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import React = require("react"); | ||
|
||
// tslint:disable-next-line:no-empty-interface | ||
interface TableBodyProps { | ||
} | ||
|
||
export class TableBody extends React.Component<TableBodyProps,any> {} | ||
export class TableBody extends React.Component<TableBodyProps,any> {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
import React = require("react"); | ||
|
||
// tslint:disable-next-line:no-empty-interface | ||
interface TableFooterProps { | ||
} | ||
|
||
export class TableFooter extends React.Component<TableFooterProps,any> {} | ||
export class TableFooter extends React.Component<TableFooterProps,any> {} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This one is tricky.
React.HTMLProps<HTMLButtonElement>
already has aref
-prop which exposes the HTMLButtonElement. HoweverButton
(as every component) has its ownref
. Those definitions now clash, so I removed it from the inherited props type. Also, the ref is now for the Button instance, not the DOM element. So if you need to expose the native element, there are two solutions: either have an extra prop that is passed to the DOM element (e.g. nativeRef) or consider using forward refs (https://reactjs.org/docs/forwarding-refs.html#forwarding-refs-to-dom-components).This change was necessary for the DataScroller demo.