File: circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.types

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 (126 lines) | stat: -rw-r--r-- 3,745 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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
=== tests/cases/compiler/circularlyConstrainedMappedTypeContainingConditionalNoInfiniteInstantiationDepth.ts ===
declare class Component<P> {
>Component : Component<P>

    constructor(props: Readonly<P>);
>props : Readonly<P>

    constructor(props: P, context?: any);
>props : P
>context : any

    readonly props: Readonly<P> & Readonly<{ children?: {} }>;
>props : Readonly<P> & Readonly<{ children?: {} | undefined; }>
>children : {} | undefined
}
interface ComponentClass<P = {}> {
    new (props: P, context?: any): Component<P>;
>props : P
>context : any

    propTypes?: WeakValidationMap<P>;
>propTypes : WeakValidationMap<P> | undefined

    defaultProps?: Partial<P>;
>defaultProps : Partial<P> | undefined

    displayName?: string;
>displayName : string | undefined
}
interface FunctionComponent<P = {}> {
    (props: P & { children?: {} }, context?: any): {} | null;
>props : P & { children?: {} | undefined; }
>children : {} | undefined
>context : any
>null : null

    propTypes?: WeakValidationMap<P>;
>propTypes : WeakValidationMap<P> | undefined

    defaultProps?: Partial<P>;
>defaultProps : Partial<P> | undefined

    displayName?: string;
>displayName : string | undefined
}

export declare const nominalTypeHack: unique symbol;
>nominalTypeHack : unique symbol

export interface Validator<T> {
    (props: object, propName: string, componentName: string, location: string, propFullName: string): Error | null;
>props : object
>propName : string
>componentName : string
>location : string
>propFullName : string
>null : null

    [nominalTypeHack]?: T;
>[nominalTypeHack] : T | undefined
>nominalTypeHack : unique symbol
}
type WeakValidationMap<T> = {
>WeakValidationMap : WeakValidationMap<T>

    [K in keyof T]?: null extends T[K]
>null : null

        ? Validator<T[K] | null | undefined>
>null : null

        : undefined extends T[K]
        ? Validator<T[K] | null | undefined>
>null : null

        : Validator<T[K]>
};
type ComponentType<P = {}> = ComponentClass<P> | FunctionComponent<P>;
>ComponentType : ComponentType<P>

export type Shared<
>Shared : Shared<InjectedProps, DecorationTargetProps>

    InjectedProps,
    DecorationTargetProps extends Shared<InjectedProps, DecorationTargetProps>
    > = {
        [P in Extract<keyof InjectedProps, keyof DecorationTargetProps>]?: InjectedProps[P] extends DecorationTargetProps[P] ? DecorationTargetProps[P] : never;
    };

// Infers prop type from component C
export type GetProps<C> = C extends ComponentType<infer P> ? P : never;
>GetProps : GetProps<C>

export type ConnectedComponentClass<
>ConnectedComponentClass : ConnectedComponentClass<C, P>

    C extends ComponentType<any>,
    P
> = ComponentClass<P> & {
    WrappedComponent: C;
>WrappedComponent : C

};

export type Matching<InjectedProps, DecorationTargetProps> = {
>Matching : Matching<InjectedProps, DecorationTargetProps>

    [P in keyof DecorationTargetProps]: P extends keyof InjectedProps
        ? InjectedProps[P] extends DecorationTargetProps[P]
            ? DecorationTargetProps[P]
            : InjectedProps[P]
        : DecorationTargetProps[P];
};

export type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;
>Omit : Omit<T, K>

export type InferableComponentEnhancerWithProps<TInjectedProps, TNeedsProps> =
>InferableComponentEnhancerWithProps : InferableComponentEnhancerWithProps<TInjectedProps, TNeedsProps>

    <C extends ComponentType<Matching<TInjectedProps, GetProps<C>>>>(
        component: C
>component : C

    ) => ConnectedComponentClass<C, Omit<GetProps<C>, keyof Shared<TInjectedProps, GetProps<C>>> & TNeedsProps>;