This repository has been archived by the owner on Nov 27, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: create definitions for components exported as object with compo…
…nent properties
- Loading branch information
1 parent
46ff9a5
commit 38603a0
Showing
6 changed files
with
234 additions
and
14 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
declare module 'component' { | ||
import * as React from 'react'; | ||
|
||
export interface Component2Props { | ||
optionalString?: string; | ||
} | ||
|
||
export const Component2: React.FC<Component2Props>; | ||
|
||
export interface ComponentProps { | ||
optionalAny?: any; | ||
} | ||
|
||
const Component: React.FC<ComponentProps>; | ||
|
||
const Composed: { | ||
Component: typeof Component; | ||
Asdf: typeof Component2; | ||
}; | ||
|
||
export default Composed; | ||
|
||
} | ||
|
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import * as React from 'react'; | ||
|
||
const Component = ({ optionalAny }) => <div />; | ||
Component.propTypes = { | ||
optionalAny: React.PropTypes.any, | ||
}; | ||
|
||
export const Component2 = () => <div />; | ||
|
||
Component2.propTypes = { | ||
optionalString: React.PropTypes.string, | ||
}; | ||
|
||
const Composed = { | ||
Component, | ||
Asdf: Component2, | ||
}; | ||
|
||
export default Composed; |
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
declare module 'component' { | ||
import * as React from 'react'; | ||
|
||
export interface ComponentProps { | ||
optionalAny?: any; | ||
} | ||
|
||
const Component: React.FC<ComponentProps>; | ||
|
||
export interface Component2Props { | ||
optionalString?: string; | ||
} | ||
|
||
const Component2: React.FC<Component2Props>; | ||
|
||
export const Composed: { | ||
Component: typeof Component; | ||
Component2: typeof Component2; | ||
}; | ||
} |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import * as React from "react"; | ||
|
||
const Component = ({ optionalAny }) => <div />; | ||
Component.propTypes = { | ||
optionalAny: React.PropTypes.any, | ||
}; | ||
|
||
const Component2 = () => <div />; | ||
|
||
Component2.propTypes = { | ||
optionalString: React.PropTypes.string, | ||
}; | ||
|
||
export const Composed = { | ||
Component, | ||
Component2, | ||
}; |
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