Fixed the index and test files to conform to DefinitelyTyped standards

This commit is contained in:
prakarshpandey
2017-06-28 16:28:26 -07:00
parent 8959bd86fa
commit 371c22e0dc
3 changed files with 17 additions and 15 deletions
+9 -8
View File
@@ -1,12 +1,13 @@
// Type definitions for react-app 1.0.0-alpha.3
// Type definitions for react-app 1.0
// Project: https://github.com/kriasoft/react-app#readme
// Definitions by: Prakarsh Pandey <https://github.com/prakarshpandey>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// Typescript Version: 2.3
import * as React from 'react';
export interface LinkProps {
to: string | object;
to: string;
onClick?(): void;
className?: string;
}
@@ -22,19 +23,19 @@ export interface RouteProps { // takes the form of universal-router routes
export interface ChildProps {
path: string;
action(params: any): object;
action(params: any): any;
}
export interface CreateAppObject {
routes: RouteProps;
context: object;
context: {};
container: Element | null;
}
// exporting the createApp function
export function createApp(createAppObject: CreateAppObject): JSX.Element;
export const Link: React.ComponentClass<LinkProps>;
export const Layout: React.ComponentClass<LayoutProps>;
export const Header: React.ComponentClass<{}>;
export const Navigation: React.ComponentClass<{}>;
export class Link extends React.Component<LinkProps, {}> {}
export class Layout extends React.Component<LayoutProps, {}> {}
export class Header extends React.Component<never, {}> {}
export class Navigation extends React.Component<never, {}> {}
+6 -6
View File
@@ -1,12 +1,12 @@
import * as React from 'react';
import { Navigation, Link, Layout, Header, createApp } from './index';
import { Navigation, Link, Layout, Header, createApp } from 'react-app';
const store = {};
const routes = {
path: '/',
children: {
fooRoute: {
path = '/',
children: [
{
path: '/',
action() {
return {
title: 'Foo Page',
@@ -14,7 +14,7 @@ const routes = {
};
}
},
barRoute: {
{
path: '/bar',
action() {
return {
@@ -23,7 +23,7 @@ const routes = {
};
}
}
}
]
};
<Link to="/bar" className="a-link"/>;
+2 -1
View File
@@ -9,6 +9,7 @@
"noImplicitThis": true,
"strictNullChecks": true,
"baseUrl": "../",
"jsx": "react",
"typeRoots": [
"../"
],
@@ -18,6 +19,6 @@
},
"files": [
"index.d.ts",
"react-app-tests.ts"
"react-app-tests.tsx"
]
}