Skip to content

Commit

Permalink
type: fix type error.
Browse files Browse the repository at this point in the history
  • Loading branch information
jaywcjlove committed Jun 23, 2024
1 parent 0158ebd commit 083869d
Show file tree
Hide file tree
Showing 26 changed files with 34 additions and 1 deletion.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@
"website"
],
"devDependencies": {
"@types/react": "~18.2.16",
"@types/react-dom": "~18.2.7",
"@babel/runtime": "^7.18.9",
"@kkt/ncc": "~1.1.0",
"compile-less-cli": "~1.9.0",
Expand Down
4 changes: 4 additions & 0 deletions packages/api-loader/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
/// <reference types="@uiw/react-baidu-map-types" />

/**
* 初始化和加载baidu地图
*/
import React from 'react';
import { requireScript } from '@uiw/react-baidu-map-utils';
import '@uiw/react-baidu-map-types';

declare global {
interface Window {
BMap: any;
[index: string]: () => any; // or just any
}
}
Expand Down
2 changes: 2 additions & 0 deletions packages/canvas-layer/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/// <reference types="@uiw/react-baidu-map-types" />

import React, { useImperativeHandle } from 'react';
import { OverlayProps } from '@uiw/react-baidu-map-map';
import { useCanvasLayer, CanvasLayerResult } from './useCanvasLayer';
Expand Down
2 changes: 2 additions & 0 deletions packages/circle/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/// <reference types="@uiw/react-baidu-map-types" />

import React, { useImperativeHandle } from 'react';
import { OverlayProps } from '@uiw/react-baidu-map-map';
import { useCircle } from './useCircle';
Expand Down
2 changes: 2 additions & 0 deletions packages/control/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/// <reference types="@uiw/react-baidu-map-types" />

import React, { useImperativeHandle } from 'react';
import { OverlayProps } from '@uiw/react-baidu-map-map';
import { useControl } from './useControl';
Expand Down
1 change: 1 addition & 0 deletions packages/copyright-control/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@uiw/react-baidu-map-types" />
import React, { useImperativeHandle, Fragment } from 'react';
import { OverlayProps } from '@uiw/react-baidu-map-map';
import { useCopyrightControl } from './useCopyrightControl';
Expand Down
1 change: 1 addition & 0 deletions packages/curve-line/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@uiw/react-baidu-map-types" />
import React, { useEffect, useImperativeHandle } from 'react';
import { OverlayProps } from '@uiw/react-baidu-map-map';
import { useCurveLine } from './useCurveLine';
Expand Down
2 changes: 2 additions & 0 deletions packages/custom-overlay/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
/// <reference types="@uiw/react-baidu-map-types" />

import React, { useImperativeHandle } from 'react';
import { OverlayProps } from '@uiw/react-baidu-map-map';
import { useCustomOverlay } from './useCustomOverlay';
Expand Down
1 change: 1 addition & 0 deletions packages/drawing-manager/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@uiw/react-baidu-map-types" />
import React, { useImperativeHandle } from 'react';
import { MapChildProps } from '@uiw/react-baidu-map-map';
import { useDrawingManager } from './useDrawingManager';
Expand Down
1 change: 1 addition & 0 deletions packages/geolocation-control/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@uiw/react-baidu-map-types" />
import React, { useImperativeHandle } from 'react';
import { OverlayProps } from '@uiw/react-baidu-map-map';
import { useGeolocationControl } from './useGeolocationControl';
Expand Down
1 change: 1 addition & 0 deletions packages/ground-overlay/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@uiw/react-baidu-map-types" />
import React, { useImperativeHandle } from 'react';
import { OverlayProps } from '@uiw/react-baidu-map-map';
import { useGroundOverlay } from './useGroundOverlay';
Expand Down
1 change: 1 addition & 0 deletions packages/info-window/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@uiw/react-baidu-map-types" />
import React, { Fragment, useEffect, useImperativeHandle } from 'react';
import { OverlayProps } from '@uiw/react-baidu-map-map';
import { useInfoWindow } from './useInfoWindow';
Expand Down
1 change: 1 addition & 0 deletions packages/label/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@uiw/react-baidu-map-types" />
import React, { CSSProperties, useImperativeHandle } from 'react';
import { OverlayProps } from '@uiw/react-baidu-map-map';
import { useLabel } from './useLabel';
Expand Down
1 change: 1 addition & 0 deletions packages/marker/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@uiw/react-baidu-map-types" />
import React, { useEffect, useImperativeHandle } from 'react';
import { OverlayProps } from '@uiw/react-baidu-map-map';
import { useMarker } from './useMarker';
Expand Down
1 change: 1 addition & 0 deletions packages/navigation-control/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@uiw/react-baidu-map-types" />
import React, { useImperativeHandle } from 'react';
import { OverlayProps } from '@uiw/react-baidu-map-map';
import { useNavigationControl } from './useNavigationControl';
Expand Down
1 change: 1 addition & 0 deletions packages/overview-map-control/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@uiw/react-baidu-map-types" />
import React, { useImperativeHandle } from 'react';
import { OverlayProps } from '@uiw/react-baidu-map-map';
import { useOverviewMapControl } from './useOverviewMapControl';
Expand Down
1 change: 1 addition & 0 deletions packages/panorama-control/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@uiw/react-baidu-map-types" />
import React, { useImperativeHandle } from 'react';
import { OverlayProps } from '@uiw/react-baidu-map-map';
import { usePanoramaControl } from './usePanoramaControl';
Expand Down
1 change: 1 addition & 0 deletions packages/point-collection/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@uiw/react-baidu-map-types" />
import React, { useEffect, useImperativeHandle } from 'react';
import { OverlayProps } from '@uiw/react-baidu-map-map';
import { usePointCollection } from './usePointCollection';
Expand Down
1 change: 1 addition & 0 deletions packages/polygon/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@uiw/react-baidu-map-types" />
import React, { useEffect, useImperativeHandle } from 'react';
import { OverlayProps } from '@uiw/react-baidu-map-map';
import { usePolygon } from './usePolygon';
Expand Down
1 change: 1 addition & 0 deletions packages/polyline/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@uiw/react-baidu-map-types" />
import React, { useEffect, useImperativeHandle } from 'react';
import { OverlayProps } from '@uiw/react-baidu-map-map';
import { usePolyline } from './usePolyline';
Expand Down
1 change: 1 addition & 0 deletions packages/require-script/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@uiw/react-baidu-map-types" />
import React, { Fragment, useEffect, useState } from 'react';
import { requireScript } from '@uiw/react-baidu-map-utils';
import { RenderProps } from '@uiw/react-baidu-map-map';
Expand Down
1 change: 1 addition & 0 deletions packages/scale-control/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@uiw/react-baidu-map-types" />
import React, { useImperativeHandle } from 'react';
import { OverlayProps } from '@uiw/react-baidu-map-map';
import { useScaleControl } from './useScaleControl';
Expand Down
1 change: 1 addition & 0 deletions packages/tile-layer/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@uiw/react-baidu-map-types" />
import React, { useImperativeHandle, useEffect } from 'react';
import { OverlayProps } from '@uiw/react-baidu-map-map';
import { useTileLayer } from './useTileLayer';
Expand Down
1 change: 1 addition & 0 deletions packages/type-control/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@uiw/react-baidu-map-types" />
import React, { useImperativeHandle } from 'react';
import { OverlayProps } from '@uiw/react-baidu-map-map';
import { useMapTypeControl } from './useMapTypeControl';
Expand Down
1 change: 1 addition & 0 deletions packages/with-map/src/index.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="@uiw/react-baidu-map-types" />
import React from 'react';
import Map, { MapProps } from '@uiw/react-baidu-map-map';

Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"isolatedModules": true,
"declaration": true,
"baseUrl": ".",
"jsx": "react",
"jsx": "react-jsx",
"noFallthroughCasesInSwitch": true,
"noUnusedLocals": true,
"experimentalDecorators": true,
Expand Down

0 comments on commit 083869d

Please sign in to comment.