Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Package Types #19

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"private": false,
"main": "./dist/index.umd.js",
"module": "./dist/index.mjs",
"types": "./types/index.d.ts",
"unpkg": "./dist/index.umd.min.js",
"jsDelivr": "./dist/index.umd.min.js",
"files": [
Expand Down
4 changes: 2 additions & 2 deletions package/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ function install(_Vue) {
}

if (typeof window !== 'undefined' && window.Vue && window.Vue === Vue) {
// plugin was inlcuded directly in a browser
// plugin was included directly in a browser
Vue.use(install);
}

export default install;
export { Portal, setSelector, config };
export { Portal, setSelector, config };
16 changes: 16 additions & 0 deletions package/types/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { PluginFunction } from 'vue'

export interface SimplePortalOptions {
name?: string
}

export interface SimplePortalConfig {
selector: string
}

export var config: Readonly<SimplePortalConfig>
export var setSelector: <T extends string>(selector: T) => T
export var Portal: any

var install: PluginFunction<SimplePortalOptions>
export default install
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ function install(_Vue, options = {}) {
}

if (typeof window !== 'undefined' && window.Vue && window.Vue === Vue) {
// plugin was inlcuded directly in a browser
// plugin was included directly in a browser
Vue.use(install)
}

Expand Down