-
Notifications
You must be signed in to change notification settings - Fork 91
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Michael Dodge
committed
Sep 4, 2020
1 parent
15fe1b7
commit a1ffa74
Showing
5 changed files
with
10 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,12 @@ | ||
<% if (version === 3) { -%> | ||
import { defineComponent, Plugin } from 'vue'; | ||
|
||
type InstallFunction = Plugin['install'] & { installed?: boolean } | ||
<% } else { -%> | ||
import Vue, { PluginFunction, VueConstructor } from 'vue'; | ||
|
||
interface InstallFunction extends PluginFunction<any> { | ||
installed?: boolean; | ||
} | ||
<% } -%> | ||
|
||
declare const <%-componentNamePascal%>: { install: InstallFunction }; | ||
declare const <%-componentNamePascal%>: { install: <% if (version === 3) { %>Plugin['install']<% } else { %>PluginFunction<any><% } %> }; | ||
export default <%-componentNamePascal%>; | ||
|
||
export const <%-componentNamePascal%>Sample: <% if (version === 3) { %>ReturnType<typeof defineComponent><% } else { %>VueConstructor<Vue><% } %>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
// iife/cjs usage extends esm default export - so import it all | ||
import component /* , { RollupDemoDirective } */ from '@/entry.esm'; | ||
import component, * as namedExports from '@/entry.esm'; | ||
|
||
// Attach named exports directly to component. IIFE/CJS will | ||
// only expose one global var, with named exports exposed as properties of | ||
// that global var (eg. VivintIcon.iconList) | ||
// component.RollupDemoDirective = RollupDemoDirective; | ||
Object.entries(namedExports).forEach(([exportName, exported]) => { | ||
if (exportName !== 'default') component[exportName] = exported; | ||
}); | ||
|
||
export default component; |