File tree Expand file tree Collapse file tree 1 file changed +20
-9
lines changed Expand file tree Collapse file tree 1 file changed +20
-9
lines changed Original file line number Diff line number Diff line change 11declare const System : any ;
22
3- // example ES Module declaration
3+ // example external ES Module declaration
44declare module 'example-module' {
5+
6+ // public variables
57 export const exampleVariable : number ;
8+
9+ // public functions
610 export function exampleFunction ( param : string ) : boolean ;
11+
12+ // default export
713 export default {
814 exampleVariable : exampleVariable ,
915 exampleFunction : exampleFunction
1016 } ;
1117}
1218
13- // example of external React Component declaration
14- declare module 'example-react-external-component ' {
19+ // example external React Module declaration
20+ declare module 'example-react-module ' {
1521 import * as React from 'react' ;
1622
17- export function fetchData ( name : string ) : Promise < string [ ] > ;
18-
19- export class ReactExternalComponent extends React . Component < IProps , any > { }
20- interface IProps {
23+ // public components
24+ interface ReactComponentProps extends React . Props < ReactComponent > {
2125 name : string ;
2226 age : number ;
2327 }
28+ export class ReactComponent extends React . Component < ReactComponentProps , any > {
29+ static somePrototypeMethod ( param : string ) : boolean ;
30+ }
31+
32+ // public functions
33+ export function fetchData ( name : string ) : Promise < string [ ] > ;
2434
35+ // default export
2536 export default {
26- fetchData : fetchData ,
27- ReactExternalComponent : ReactExternalComponent
37+ ReactComponent : ReactComponent ,
38+ fetchData : fetchData
2839 } ;
2940}
You can’t perform that action at this time.
0 commit comments