File: thisIndexOnExistingReadonlyFieldIsNotNever.types

package info (click to toggle)
node-typescript 5.0.4%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 459,140 kB
  • sloc: javascript: 1,972,754; makefile: 6; sh: 1
file content (57 lines) | stat: -rw-r--r-- 2,515 bytes parent folder | download | duplicates (4)
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
=== tests/cases/compiler/thisIndexOnExistingReadonlyFieldIsNotNever.ts ===
declare class Component<P, S = {}> {
>Component : Component<P, S>

    readonly props: Readonly<{ children?: unknown }> & Readonly<P>;
>props : Readonly<{ children?: unknown; }> & Readonly<P>
>children : unknown

    state: Readonly<S>;
>state : Readonly<S>
}
interface CoachMarkAnchorProps<C> {
    anchorRef?: (anchor: C) => void;
>anchorRef : ((anchor: C) => void) | undefined
>anchor : C
}
type AnchorType<P> = Component<P>;
>AnchorType : AnchorType<P>

class CoachMarkAnchorDecorator {
>CoachMarkAnchorDecorator : CoachMarkAnchorDecorator

    decorateComponent<P>(anchor: P) {
>decorateComponent : <P>(anchor: P) => typeof CoachMarkAnchor
>anchor : P

        return class CoachMarkAnchor extends Component<CoachMarkAnchorProps<AnchorType<P>> & P, {}> {
>class CoachMarkAnchor extends Component<CoachMarkAnchorProps<AnchorType<P>> & P, {}> {            private _onAnchorRef = (anchor: AnchorType<P>) => {                const anchorRef = this.props.anchorRef;                if (anchorRef) {                    anchorRef(anchor);                }            }        } : typeof CoachMarkAnchor
>CoachMarkAnchor : typeof CoachMarkAnchor
>Component : Component<CoachMarkAnchorProps<AnchorType<P>> & P, {}>

            private _onAnchorRef = (anchor: AnchorType<P>) => {
>_onAnchorRef : (anchor: AnchorType<P>) => void
>(anchor: AnchorType<P>) => {                const anchorRef = this.props.anchorRef;                if (anchorRef) {                    anchorRef(anchor);                }            } : (anchor: AnchorType<P>) => void
>anchor : AnchorType<P>

                const anchorRef = this.props.anchorRef;
>anchorRef : (CoachMarkAnchorProps<AnchorType<P>> & P)["anchorRef"] | undefined
>this.props.anchorRef : (CoachMarkAnchorProps<AnchorType<P>> & P)["anchorRef"] | undefined
>this.props : Readonly<{ children?: unknown; }> & Readonly<CoachMarkAnchorProps<AnchorType<P>> & P>
>this : this
>props : Readonly<{ children?: unknown; }> & Readonly<CoachMarkAnchorProps<AnchorType<P>> & P>
>anchorRef : (CoachMarkAnchorProps<AnchorType<P>> & P)["anchorRef"] | undefined

                if (anchorRef) {
>anchorRef : (CoachMarkAnchorProps<AnchorType<P>> & P)["anchorRef"] | undefined

                    anchorRef(anchor);
>anchorRef(anchor) : void
>anchorRef : (anchor: AnchorType<P>) => void
>anchor : AnchorType<P>
                }
            }
        };
    }
}