Skip to content

Commit

Permalink
feat(ts): migrate CircleOverlay props to index.d.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
vinayakkulkarni committed Aug 8, 2021
1 parent f3da5ca commit debcb37
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/components/overlays/Circle.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,8 @@
import { Ref, ref, shallowRef } from 'vue';
import { CircleOverlayProps } from '~/types';
import { useGlobalState } from '../../utils/store';

type CircleProps = {
'circle-coordinates': number[];
'circle-radius': number;
'circle-style': mapkit.StyleConstructorOptions;
};

export const CircleOverlay = (props: CircleProps): void => {
export const CircleOverlay = (props: CircleOverlayProps): void => {
const state = useGlobalState();
const mapkit: Ref<typeof window.mapkit> = shallowRef(state.mapkit.value);
if (state.mapLoad && state.map.value) {
Expand Down
8 changes: 8 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,11 @@ export type MarkerProps = {
} & ComponentCustomProps &
VNodeProps;
export const MarkerAnnotation: DefineComponent<MarkerProps>;

export type CircleOverlayProps = {
'circle-coordinates': number[];
'circle-radius': number;
'circle-style': mapkit.StyleConstructorOptions;
} & ComponentCustomProps &
VNodeProps;
export const CircleOverlay: DefineComponent<CircleOverlayProps>;

0 comments on commit debcb37

Please sign in to comment.