1 | declare module 'react-hot-loader' {
|
2 | import * as React from 'react'
|
3 |
|
4 | interface ErrorReporterProps {
|
5 | error: any
|
6 | }
|
7 |
|
8 | export interface AppContainerProps {
|
9 | children?: React.ReactElement<any>
|
10 | errorReporter?:
|
11 | | React.ComponentClass<ErrorReporterProps>
|
12 | | React.StatelessComponent<ErrorReporterProps>
|
13 | }
|
14 |
|
15 | export class AppContainer extends React.Component<
|
16 | AppContainerProps,
|
17 | React.ComponentState
|
18 | > {}
|
19 |
|
20 | |
21 |
|
22 |
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 | export function hot(
|
29 | module: any,
|
30 | ): <T = React.ComponentType<any>>(Component: T) => T
|
31 |
|
32 | /**
|
33 | * Marks component as `cold`, and making it invisible for React-Hot-Loader.
|
34 | * Any changes to that component will cause local state loss.
|
35 | * @param {React.ComponentType} component to chill
|
36 | * @return {React.ComponentType} component, as it was passed in.
|
37 | *
|
38 | * @example marks some component as cold
|
39 | * export default cold(MyComponent)
|
40 | */
|
41 | export function cold<T = React.ComponentType<any>>(component: T): T
|
42 |
|
43 | /**
|
44 | * Tests are types of two components equal
|
45 | * @param {Component} typeA
|
46 | * @param {Component} typeB
|
47 | * @return {boolean} are they equal
|
48 | *
|
49 | * @example test that some rendered component(ReactElement), has the same type as BaseComponent
|
50 | * areComponentEqual(RenderedComponent.type, BaseComponent)
|
51 | */
|
52 | export function areComponentsEqual<T>(
|
53 | typeA: React.ComponentType<T>,
|
54 | typeB: React.ComponentType<T>,
|
55 | ): boolean
|
56 |
|
57 | export interface Config {
|
58 | |
59 |
|
60 |
|
61 |
|
62 | logLevel: string
|
63 |
|
64 | |
65 |
|
66 |
|
67 |
|
68 |
|
69 |
|
70 |
|
71 | onComponentRegister: (
|
72 | type: any,
|
73 | uniqueLocalName: string,
|
74 | fileName: string,
|
75 | ) => any
|
76 |
|
77 | |
78 |
|
79 |
|
80 |
|
81 |
|
82 | onComponentCreate: (type: any, displayName: string) => any
|
83 |
|
84 | |
85 |
|
86 |
|
87 | pureSFC: boolean
|
88 |
|
89 | |
90 |
|
91 |
|
92 | pureRender: boolean
|
93 |
|
94 | |
95 |
|
96 |
|
97 | allowSFC: boolean
|
98 |
|
99 | |
100 |
|
101 |
|
102 | disableHotRenderer: boolean
|
103 |
|
104 | |
105 |
|
106 |
|
107 | disableHotRendererWhenInjected: boolean
|
108 |
|
109 | |
110 |
|
111 |
|
112 | ignoreSFC: boolean
|
113 |
|
114 | |
115 |
|
116 |
|
117 | ignoreComponents: boolean
|
118 | }
|
119 | |
120 |
|
121 |
|
122 |
|
123 | export function setConfig(config: Partial<Config>): void
|
124 | }
|
125 |
|
\ | No newline at end of file |