This repository was archived by the owner on Oct 12, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 6 files changed +79
-79
lines changed Expand file tree Collapse file tree 6 files changed +79
-79
lines changed Original file line number Diff line number Diff line change 1
1
{
2
- "name" : " jsx-demo" ,
3
- "version" : " 0.0.1" ,
4
- "description" : " JSX in TypeScript Demo Project" ,
5
- "main" : " app.js" ,
6
- "scripts" : {
7
- "test" : " echo \" Error: no test specified\" && exit 1"
8
- },
9
- "repository" : {
10
- "type" : " git" ,
11
- "url" : " https://github.com/RyanCavanaugh/jsx-demo.git"
12
- },
13
- "keywords" : [
14
- " jsx" ,
15
- " tsx" ,
16
- " typescript" ,
17
- " ts" ,
18
- " react"
19
- ],
20
- "author" : " Ryan Cavanaugh (Microsoft)" ,
21
- "license" : " Apache" ,
22
- "bugs" : {
23
- "url" : " https://github.com/RyanCavanaugh/jsx-demo/issues"
24
- },
25
- "homepage" : " https://github.com/RyanCavanaugh/jsx-demo" ,
26
- "devDependencies" : {
27
- "typescript" : " latest" ,
28
- "http-server" : " 0.8.0"
29
- },
30
- "dependencies" : {
31
- "jquery" : " ^2.1.4" ,
32
- "react" : " ^0.13.3" ,
33
- "requirejs" : " ^2.1.20"
34
- }
2
+ "name" : " jsx-demo" ,
3
+ "version" : " 0.0.1" ,
4
+ "description" : " JSX in TypeScript Demo Project" ,
5
+ "main" : " app.js" ,
6
+ "scripts" : {
7
+ "test" : " echo \" Error: no test specified\" && exit 1"
8
+ },
9
+ "repository" : {
10
+ "type" : " git" ,
11
+ "url" : " https://github.com/RyanCavanaugh/jsx-demo.git"
12
+ },
13
+ "keywords" : [
14
+ " jsx" ,
15
+ " tsx" ,
16
+ " typescript" ,
17
+ " ts" ,
18
+ " react"
19
+ ],
20
+ "author" : " Ryan Cavanaugh (Microsoft)" ,
21
+ "license" : " Apache" ,
22
+ "bugs" : {
23
+ "url" : " https://github.com/RyanCavanaugh/jsx-demo/issues"
24
+ },
25
+ "homepage" : " https://github.com/RyanCavanaugh/jsx-demo" ,
26
+ "devDependencies" : {
27
+ "typescript" : " latest" ,
28
+ "http-server" : " 0.8.0"
29
+ },
30
+ "dependencies" : {
31
+ "jquery" : " ^2.1.4" ,
32
+ "react" : " ^0.13.3" ,
33
+ "requirejs" : " ^2.1.20"
34
+ }
35
35
}
Original file line number Diff line number Diff line change 1
1
requirejs . config ( {
2
- paths : {
3
- react : [ '/node_modules/react/dist/react' ] ,
4
- jquery : [ '/node_modules/jquery/dist/jquery' ]
5
- }
2
+ paths : {
3
+ react : [ '/node_modules/react/dist/react' ] ,
4
+ jquery : [ '/node_modules/jquery/dist/jquery' ]
5
+ }
6
6
} ) ;
Original file line number Diff line number Diff line change @@ -3,19 +3,19 @@ import $ = require('jquery');
3
3
import { Greeter as Greetifier , GreeterProps as GreeterProps } from 'greeter' ;
4
4
5
5
function getRandomGreeting ( ) {
6
- switch ( Math . floor ( Math . random ( ) * 4 ) ) {
7
- case 0 : return 'Hello' ;
8
- case 1 : return 'Howdy' ;
9
- case 2 : return 'Greetings to you' ;
10
- case 3 : return 'Hail' ;
11
- }
6
+ switch ( Math . floor ( Math . random ( ) * 4 ) ) {
7
+ case 0 : return 'Hello' ;
8
+ case 1 : return 'Howdy' ;
9
+ case 2 : return 'Greetings to you' ;
10
+ case 3 : return 'Hail' ;
11
+ }
12
12
}
13
13
14
14
$ ( ( ) => {
15
- let props : GreeterProps = {
16
- whomToGreet : 'world!' ,
17
- } ;
15
+ let props : GreeterProps = {
16
+ whomToGreet : 'world!' ,
17
+ } ;
18
18
19
- React . render ( < Greetifier { ...props } /> , $ ( '#output' ) . get ( 0 ) ) ;
19
+ React . render ( < Greetifier { ...props } /> , $ ( '#output' ) . get ( 0 ) ) ;
20
20
} ) ;
21
21
Original file line number Diff line number Diff line change 1
1
import React = require( 'react' ) ;
2
2
3
3
export interface GreeterProps extends React . Props < Greeter > {
4
- whomToGreet : string ;
5
- greeting ?: string | ( ( ) => string ) ;
4
+ whomToGreet : string ;
5
+ greeting ?: string | ( ( ) => string ) ;
6
6
}
7
7
8
8
export class Greeter extends React . Component < GreeterProps , { } > {
9
- render ( ) {
10
- let g = this . props . greeting ;
9
+ render ( ) {
10
+ let g = this . props . greeting ;
11
11
12
- let greeting = 'Hello' ;
13
- if ( typeof g === 'string' ) {
14
- greeting = g ;
15
- } else if ( g ) {
16
- greeting = g ( ) ;
17
- }
12
+ let greeting = 'Hello' ;
13
+ if ( typeof g === 'string' ) {
14
+ greeting = g ;
15
+ } else if ( g ) {
16
+ greeting = g ( ) ;
17
+ }
18
18
19
- return < div > { greeting } , { this . props . whomToGreet } </ div > ;
20
- }
19
+ return < div > { greeting } , { this . props . whomToGreet } </ div > ;
20
+ }
21
21
}
Original file line number Diff line number Diff line change 1
1
{
2
- "compilerOptions" : {
3
- "jsx" : " react" ,
4
- "outDir" : " bin" ,
5
- "module" : " amd"
6
- },
7
- "exclude" : [
8
- " node_modules"
9
- ]
2
+ "compilerOptions" : {
3
+ "jsx" : " react" ,
4
+ "outDir" : " bin" ,
5
+ "module" : " amd"
6
+ },
7
+ "exclude" : [
8
+ " node_modules"
9
+ ]
10
10
}
Original file line number Diff line number Diff line change 1
1
{
2
- "version" : " v4" ,
3
- "repo" : " borisyankov/DefinitelyTyped" ,
4
- "ref" : " master" ,
5
- "path" : " typings" ,
6
- "bundle" : " typings/tsd.d.ts" ,
7
- "installed" : {
8
- "react/react.d.ts" : {
9
- "commit" : " 77ec1408257c677f8fd8d6798ebaf6bd87c11b9d"
10
- },
11
- "jquery/jquery.d.ts" : {
12
- "commit" : " 77ec1408257c677f8fd8d6798ebaf6bd87c11b9d"
2
+ "version" : " v4" ,
3
+ "repo" : " borisyankov/DefinitelyTyped" ,
4
+ "ref" : " master" ,
5
+ "path" : " typings" ,
6
+ "bundle" : " typings/tsd.d.ts" ,
7
+ "installed" : {
8
+ "react/react.d.ts" : {
9
+ "commit" : " 77ec1408257c677f8fd8d6798ebaf6bd87c11b9d"
10
+ },
11
+ "jquery/jquery.d.ts" : {
12
+ "commit" : " 77ec1408257c677f8fd8d6798ebaf6bd87c11b9d"
13
+ }
13
14
}
14
- }
15
15
}
You can’t perform that action at this time.
0 commit comments