File: moduleExportAssignment.types

package info (click to toggle)
node-typescript 5.0.4%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 459,116 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (79 lines) | stat: -rw-r--r-- 2,288 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
=== tests/cases/conformance/salsa/use.js ===
var npmlog = require('./npmlog')
>npmlog : { on(s: string): void; x: number; y: 2; }
>require('./npmlog') : { on(s: string): void; x: number; y: 2; }
>require : any
>'./npmlog' : "./npmlog"

npmlog.x
>npmlog.x : number
>npmlog : { on(s: string): void; x: number; y: 2; }
>x : number

npmlog.on
>npmlog.on : (s: string) => void
>npmlog : { on(s: string): void; x: number; y: 2; }
>on : (s: string) => void

=== tests/cases/conformance/salsa/npmlog.js ===
class EE {
>EE : EE

    /** @param {string} s */
    on(s) { }
>on : (s: string) => void
>s : string
}
var npmlog = module.exports = new EE()
>npmlog : { on(s: string): void; x: number; y: 2; }
>module.exports = new EE() : { on(s: string): void; x: number; y: 2; }
>module.exports : { on(s: string): void; x: number; y: 2; }
>module : { exports: { on(s: string): void; x: number; y: 2; }; }
>exports : { on(s: string): void; x: number; y: 2; }
>new EE() : EE
>EE : typeof EE

npmlog.on('hi') // both references should see EE.on
>npmlog.on('hi') : void
>npmlog.on : (s: string) => void
>npmlog : { on(s: string): void; x: number; y: 2; }
>on : (s: string) => void
>'hi' : "hi"

module.exports.on('hi') // here too
>module.exports.on('hi') : void
>module.exports.on : (s: string) => void
>module.exports : { on(s: string): void; x: number; y: 2; }
>module : { exports: { on(s: string): void; x: number; y: 2; }; }
>exports : { on(s: string): void; x: number; y: 2; }
>on : (s: string) => void
>'hi' : "hi"

npmlog.x = 1
>npmlog.x = 1 : 1
>npmlog.x : number
>npmlog : { on(s: string): void; x: number; y: 2; }
>x : number
>1 : 1

module.exports.y = 2
>module.exports.y = 2 : 2
>module.exports.y : 2
>module.exports : { on(s: string): void; x: number; y: 2; }
>module : { exports: { on(s: string): void; x: number; y: 2; }; }
>exports : { on(s: string): void; x: number; y: 2; }
>y : 2
>2 : 2

npmlog.y
>npmlog.y : 2
>npmlog : { on(s: string): void; x: number; y: 2; }
>y : 2

module.exports.x
>module.exports.x : number
>module.exports : { on(s: string): void; x: number; y: 2; }
>module : { exports: { on(s: string): void; x: number; y: 2; }; }
>exports : { on(s: string): void; x: number; y: 2; }
>x : number