diff --git a/addons/knobs/src/KnobStore.ts b/addons/knobs/src/KnobStore.ts index 0ba53a7bc58f..5ee42ffd8e8a 100644 --- a/addons/knobs/src/KnobStore.ts +++ b/addons/knobs/src/KnobStore.ts @@ -48,7 +48,7 @@ export default class KnobStore { callbacks: Callback[] = []; - timer: number; + timer: NodeJS.Timeout; has(key: string) { return this.store[key] !== undefined; diff --git a/addons/options/tsconfig.json b/addons/options/tsconfig.json index 266f855ff1a3..1d10f46e8b7f 100644 --- a/addons/options/tsconfig.json +++ b/addons/options/tsconfig.json @@ -1,7 +1,8 @@ { "extends": "../../tsconfig.json", "compilerOptions": { - "rootDir": "./src" + "rootDir": "./src", + "types": ["webpack-env"] }, "include": [ "src/**/*" diff --git a/addons/storyshots/storyshots-core/stories/__snapshots__/storyshot.enzyme.test.js.snap b/addons/storyshots/storyshots-core/stories/__snapshots__/storyshot.enzyme.test.js.snap index cae5deca1852..94367ee4014b 100644 --- a/addons/storyshots/storyshots-core/stories/__snapshots__/storyshot.enzyme.test.js.snap +++ b/addons/storyshots/storyshots-core/stories/__snapshots__/storyshot.enzyme.test.js.snap @@ -166,7 +166,6 @@ exports[`Storyshots Welcome to Storybook 1`] = ` onClick={[Function]} > diff --git a/app/react/src/demo/Welcome.js b/app/react/src/demo/Welcome.tsx similarity index 74% rename from app/react/src/demo/Welcome.js rename to app/react/src/demo/Welcome.tsx index 0c5a4cafaf5f..78c87898d66f 100644 --- a/app/react/src/demo/Welcome.js +++ b/app/react/src/demo/Welcome.tsx @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; -const Main = props => ( +const Main = (props?: React.DetailedHTMLProps, HTMLElement>) => (
( /> ); -const Title = ({ children, ...props }) =>

{children}

; +const Title = ({ + children, + ...props +}: { + children: string; + props?: React.DetailedHTMLProps, HTMLHeadingElement>; +}) =>

{children}

; Title.propTypes = { children: PropTypes.node, }; @@ -21,7 +27,9 @@ Title.defaultProps = { children: undefined, }; -const Note = props => ( +const Note = ( + props?: React.DetailedHTMLProps, HTMLParagraphElement> +) => (

( /> ); -const InlineCode = props => ( +const InlineCode = ( + props?: React.DetailedHTMLProps, HTMLElement> +) => ( ( /> ); -const Link = ({ children, href, ...props }) => ( +const Link = ({ + children, + href, + target, + ...props +}: { + children: string; + href: string; + target: string; + rel: string; + props?: React.DetailedHTMLProps, HTMLAnchorElement>; +}) => ( ( +const NavButton = ({ + children, + onClick, + ...props +}: { + children: string; + onClick: (event: React.MouseEvent) => void; + props?: React.DetailedHTMLProps, HTMLButtonElement>; +}) => (