Skip to content

Commit 0dfa522

Browse files
committed
updates types declaration and build
1 parent 99b5714 commit 0dfa522

File tree

5 files changed

+49
-26
lines changed

5 files changed

+49
-26
lines changed

index.d.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
declare module 'vue3-openlayers' {
2+
import type { App } from 'vue'
3+
import type feature from 'ol/Feature'
4+
import type * as geom from 'ol/geom'
5+
import type * as format from 'ol/format'
6+
import type * as loadingstrategy from 'ol/loadingstrategy'
7+
import type * as selectconditions from 'ol/events/condition'
8+
import type * as extent from 'ol/extent'
9+
import type * as animations from 'ol/easing'
10+
11+
module '@vue/runtime-core' {
12+
export function inject(key: 'ol-feature'): feature
13+
export function inject(key: 'ol-geom'): typeof geom
14+
export function inject(key: 'ol-animations'): typeof animations
15+
export function inject(key: 'ol-format'): typeof format
16+
export function inject(key: 'ol-loadingstrategy'): typeof loadingstrategy
17+
export function inject(key: 'ol-selectconditions'): typeof selectconditions
18+
export function inject(key: 'ol-extent'): typeof extent
19+
}
20+
21+
export default function install(app: App): void
22+
}

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@i209/vue3-openlayers",
3-
"version": "0.2.8",
3+
"version": "0.2.14",
44
"description": "Openlayers Wrapper for Vue3",
55
"repository": {
66
"type": "git",
@@ -32,7 +32,7 @@
3232
".": {
3333
"import": "./vue3-openlayers.es.js",
3434
"require": "./vue3-openlayers.umd.js",
35-
"types": "./index.d.ts"
35+
"types": "./types/src/index.d.ts"
3636
},
3737
"./vue3-openlayers.css": {
3838
"import": "./vue3-openlayers.css",
@@ -43,13 +43,13 @@
4343
"dev": "vite",
4444
"build": "vite build",
4545
"serve": "vite preview",
46-
"prepare-npm": "vite build && rm -rf ./npm && cp -r dist ./npm && mkdir ./npm/src/ && mkdir ./npm/src/components && cp -r ./src/components ./npm/src/components/ && cp components.d.ts ./npm/ && cp package.json ./npm/ && cp README.md ./npm/ && cp LICENSE ./npm/"
46+
"prepare-npm": "rm -rf ./npm && cp -r dist ./npm && mkdir ./npm/src && mkdir ./npm/src/components && cp -r ./src/components ./npm/src/ && cp components.d.ts ./npm/ && cp package.json ./npm/ && cp README.md ./npm/ && cp LICENSE ./npm/"
4747
},
4848
"files": [
4949
"./*"
5050
],
5151
"type": "module",
52-
"types": "types/index.d.ts",
52+
"types": "./types/src/index.d.ts",
5353
"dependencies": {
5454
"file-saver": "2.0.5",
5555
"jspdf": "2.5.1",

types/index.d.ts

Lines changed: 0 additions & 22 deletions
This file was deleted.

types/src/index.d.ts

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
declare module 'vue3-openlayers' {
2+
import type { App } from 'vue'
3+
import type feature from 'ol/Feature'
4+
import type * as geom from 'ol/geom'
5+
import type * as format from 'ol/format'
6+
import type * as loadingstrategy from 'ol/loadingstrategy'
7+
import type * as selectconditions from 'ol/events/condition'
8+
import type * as extent from 'ol/extent'
9+
import type * as animations from 'ol/easing'
10+
11+
module '@vue/runtime-core' {
12+
export function inject(key: 'ol-feature'): feature
13+
export function inject(key: 'ol-geom'): typeof geom
14+
export function inject(key: 'ol-animations'): typeof animations
15+
export function inject(key: 'ol-format'): typeof format
16+
export function inject(key: 'ol-loadingstrategy'): typeof loadingstrategy
17+
export function inject(key: 'ol-selectconditions'): typeof selectconditions
18+
export function inject(key: 'ol-extent'): typeof extent
19+
}
20+
21+
export default function install(app: App): void
22+
}

vite.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ export default defineConfig({
99
vue(),
1010
Components({
1111
dts: true,
12+
types: [],
1213
}),
1314
dts({
1415
outputDir: 'dist/types',

0 commit comments

Comments
 (0)