Skip to content

Commit

Permalink
feat(types): change export types
Browse files Browse the repository at this point in the history
  • Loading branch information
Dongkyuuuu committed Sep 5, 2021
1 parent dc1269f commit b1f44b1
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 22 deletions.
2 changes: 1 addition & 1 deletion playground/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

<script lang="ts">
import { defineComponent, reactive, ref } from "vue";
import { naverV3 } from "../dist/vue3-naver-maps";
import type { naverV3 } from "../dist/vue3-naver-maps";
export default defineComponent({
name: "App",
Expand Down
2 changes: 1 addition & 1 deletion src/components/Marker.vue
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import {
toRefs,
PropType,
} from "vue";
import type { naverV3 } from "../types";
import { naverMapObject, addEventMarker, UI_EVENT } from "../utils";
import type { naverV3 } from "../types";
export default defineComponent({
name: "Marker",
Expand Down
10 changes: 5 additions & 5 deletions src/config/install.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { App } from "vue";
import { install } from "../types";
import type { naverV3 } from "../types";
import { components } from "./components";

export function install(app: App<Element>, options: install.options) {
export function install(app: App<Element>, options: naverV3.install.options) {
// const ERROR_MSG_BROWSER =
// "Sorry, this plugin is only available in browsers at now. If you are using Nuxt.js, turn off ssr for this plugin.";
const ERROR_MSG_CLIENT = "options must be included clientId";
Expand All @@ -16,7 +16,7 @@ export function install(app: App<Element>, options: install.options) {
/**
* vue3-naver-maps script setup
*/
function _setupScript(options: install.options) {
function _setupScript(options: naverV3.install.options) {
const isExist = document.getElementById("vue3-naver-maps");
if (!isExist) {
const URL = _createURL(options);
Expand All @@ -38,10 +38,10 @@ function _setupScript(options: install.options) {
/**
* create Javscript naver-maps URL
*/
function _createURL(options: install.options) {
function _createURL(options: naverV3.install.options) {
const baseURL: string =
"https://openapi.map.naver.com/openapi/v3/maps.js" + "?";
const category: install.category = options.category
const category: naverV3.install.category = options.category
? options.category
: "ncp";
const clientId: string = "ClientId=" + options.clientId;
Expand Down
1 change: 0 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { install } from "./config";

export * from "./types";
export * from "./apis";

export default install;
25 changes: 12 additions & 13 deletions src/types/index.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
export namespace install {
export type category = "gov" | "ncp" | "fin";
export declare namespace naverV3 {
namespace install {
type category = "gov" | "ncp" | "fin";

export interface options {
clientId: string;
category?: category;
subModules?: string;
interface options {
clientId: string;
category?: category;
subModules?: string;
}
}
}

export namespace naverV3 {
export interface layers {
interface layers {
[key: string]: string;
BACKGROUND: "bg";
BACKGROUND_DETAIL: "ol";
Expand All @@ -25,7 +24,7 @@ export namespace naverV3 {
CHINESE: "lzh";
JAPANESE: "lja";
}
export type initLayer =
type initLayer =
| "BACKGROUND"
| "BACKGROUND_DETAIL"
| "BICYCLE"
Expand All @@ -40,12 +39,12 @@ export namespace naverV3 {
| "CHINESE"
| "JAPANESE";

export interface mapOptions extends naver.maps.MapOptions {
interface mapOptions extends naver.maps.MapOptions {
latitude?: number;
longitude?: number;
}

export interface htmlIcon {
interface htmlIcon {
size: {
width: number;
height: number;
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@
"__tests__/**/*.ts",
"node_modules/@types"
],
"exclude": ["node_modules"]
"exclude": ["node_modules", "playground"]
}

0 comments on commit b1f44b1

Please sign in to comment.