File: mappedTypeProperties.js

package info (click to toggle)
node-typescript 4.9.5%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 533,908 kB
  • sloc: javascript: 2,018,330; makefile: 7; sh: 1
file content (72 lines) | stat: -rw-r--r-- 1,377 bytes parent folder | download
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
//// [mappedTypeProperties.ts]
export type PlaceType = 'openSky' | 'roofed' | 'garage'
type Before = {
    model: 'hour' | 'day';
    [placeType in PlaceType]: void;
}

type After = {
    [placeType in PlaceType]: void;
    model: 'hour' | 'day'
}

type AfterQuestion = {
    [placeType in PlaceType]?: void;
    model: 'hour' | 'day';
}
type AfterMethod = {
    [placeType in PlaceType]?: void;
    model(duration: number): 'hour' | 'day';
}

type AfterImplicit = {
    [placeType in PlaceType]
    model: 'hour' | 'day';
}
type AfterImplicitQ = {
    [placeType in PlaceType]?
    model: 'hour' | 'day'
}

interface I {
    [P in PlaceType]: any
}
class C {
    [P in PlaceType]: any
}
const D = class {
    [P in PlaceType]: any
}
const E = class {
    [P in 'a' | 'b']: any
}


//// [mappedTypeProperties.js]
"use strict";
var _a, _b;
exports.__esModule = true;
var C = /** @class */ (function () {
    function C() {
    }
    return C;
}());
P in PlaceType;
var D = (_a = /** @class */ (function () {
        function class_1() {
        }
        return class_1;
    }()),
    P in PlaceType,
    _a);
var E = (_b = /** @class */ (function () {
        function class_2() {
        }
        return class_2;
    }()),
    P in 'a' | 'b',
    _b);


//// [mappedTypeProperties.d.ts]
export type PlaceType = 'openSky' | 'roofed' | 'garage';