Total Complexity | 4 |
Complexity/F | 1 |
Lines of Code | 28 |
Function Count | 4 |
Duplicated Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | //@ts-nocheck |
||
2 | import type { JSXElementConstructor, Component, ReactElement } from "react" |
||
3 | import { ClassNamed, ClassNamesProperty, ClassHash } from "../src/main.types" |
||
4 | |||
5 | function FWith(_: ClassNamed & ClassNamesProperty<{a: ClassHash}>) { return null } |
||
6 | function FWithout(_: ClassNamed) { return null } |
||
7 | |||
8 | describe("extending", () => { |
||
9 | it("function", () => { |
||
10 | type ReactFunction<P = never> = (props: P) => ReactElement<any, any> | null |
||
11 | type FnWithClassNames = ReactFunction<{ |
||
12 | classname: any |
||
13 | [k: string]: any |
||
14 | }> |
||
15 | // function check1(_: FnWithClassNames) {} |
||
16 | // function check2<T extends FnWithClassNames>(_: T) {} |
||
17 | function check1(_: ReactFunction) {} |
||
18 | function check2<T extends ReactFunction>(_: T) {} |
||
19 | check1(FWith) |
||
20 | check2(FWith) |
||
21 | }) |
||
22 | // type X = JSXElementConstructor |
||
23 | // type JSXElementConstructor<P> = |
||
24 | // | ((props: P) => ReactElement<any, any> | null) |
||
25 | // | (new (props: P) => Component<P, any>); |
||
26 | |||
27 | |||
28 | }) |