mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Fixed the index and test files to conform to DefinitelyTyped standards
This commit is contained in:
Vendored
+9
-8
@@ -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, {}> {}
|
||||
|
||||
@@ -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"/>;
|
||||
|
||||
@@ -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"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user