File tree Expand file tree Collapse file tree 5 files changed +79
-2
lines changed
fixtures/components/highcharts Expand file tree Collapse file tree 5 files changed +79
-2
lines changed Original file line number Diff line number Diff line change 1+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+ // SPDX-License-Identifier: Apache-2.0
3+
4+ import * as React from 'react' ;
5+ import { NonCancelableEventHandler } from '../../internal/events' ;
6+
7+ namespace Highcharts {
8+ export interface Point {
9+ x : number ;
10+ y : number ;
11+ }
12+ }
13+
14+ export interface ChartProps {
15+ onHighlight ?: NonCancelableEventHandler < { point : Highcharts . Point } > ;
16+ }
17+
18+ /**
19+ * Chart description
20+ */
21+ export default function Chart ( { onHighlight } : ChartProps ) {
22+ return (
23+ < svg >
24+ < div onMouseOver = { ( ) => onHighlight ?.( { detail : { point : { x : 0 , y : 0 } } } ) } > </ div >
25+ </ svg >
26+ ) ;
27+ }
Original file line number Diff line number Diff line change 1+ {
2+ "extends" : " ../tsconfig.json" ,
3+ "include" : [" ./**/*.tsx" ]
4+ }
Original file line number Diff line number Diff line change @@ -27,8 +27,7 @@ export function getObjectDefinition(
2727 realType . flags & ts . TypeFlags . Number ||
2828 isArrayType ( realType ) ||
2929 realTypeName === 'HTMLElement' ||
30- realTypeName . startsWith ( 'SVG' ) ||
31- realTypeName . includes ( 'Highcharts' ) ||
30+ realTypeName === 'Highcharts.Point' ||
3231 type === 'React.ReactNode'
3332 ) {
3433 // do not expand built-in Javascript methods or primitive values
Original file line number Diff line number Diff line change 1+ // Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
2+
3+ exports [` should not expand highcharts types 1` ] = `
4+ [
5+ {
6+ " dashCaseName" : " chart" ,
7+ " description" : " Chart description" ,
8+ " events" : [
9+ {
10+ " cancelable" : false ,
11+ " deprecatedTag" : undefined ,
12+ " description" : undefined ,
13+ " detailInlineType" : {
14+ " name" : " { point: Highcharts.Point; }" ,
15+ " properties" : [
16+ {
17+ " name" : " point" ,
18+ " optional" : false ,
19+ " type" : " Highcharts.Point" ,
20+ },
21+ ],
22+ " type" : " object" ,
23+ },
24+ " detailType" : " { point: Highcharts.Point; }" ,
25+ " name" : " onHighlight" ,
26+ " systemTags" : undefined ,
27+ },
28+ ],
29+ " functions" : [],
30+ " name" : " Chart" ,
31+ " properties" : [],
32+ " regions" : [],
33+ " releaseStatus" : " stable" ,
34+ " systemTags" : undefined ,
35+ } ,
36+ ]
37+ ` ;
Original file line number Diff line number Diff line change 1+ // Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2+ // SPDX-License-Identifier: Apache-2.0
3+
4+ import { expect , test } from 'vitest' ;
5+ import { buildProject } from './test-helpers' ;
6+
7+ test ( 'should not expand highcharts types' , ( ) => {
8+ const result = buildProject ( 'highcharts' ) ;
9+ expect ( result ) . toMatchSnapshot ( ) ;
10+ } ) ;
You can’t perform that action at this time.
0 commit comments