forked from Meituan-Dianping/mpvue
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Expose all types via index.d.ts (#3608)
* expose all types via index.d.ts * Fix typo
- Loading branch information
Showing
3 changed files
with
30 additions
and
3 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,6 +1,33 @@ | ||
import {Vue as _Vue} from "./vue"; | ||
import * as Options from "./options"; | ||
import * as Plugin from "./plugin"; | ||
import * as VNode from "./vnode"; | ||
|
||
// `Vue` in `export = Vue` must be a namespace | ||
declare namespace Vue {} | ||
// All available types are exported via this namespace | ||
declare namespace Vue { | ||
export type ComponentOptions = Options.ComponentOptions; | ||
export type FunctionalComponentOptions = Options.FunctionalComponentOptions; | ||
export type RenderContext = Options.RenderContext; | ||
export type PropOptions = Options.PropOptions; | ||
export type ComputedOptions = Options.ComputedOptions; | ||
export type WatchHandler = Options.WatchHandler; | ||
export type WatchOptions = Options.WatchOptions; | ||
export type DirectiveFunction = Options.DirectiveFunction; | ||
export type DirectiveOptions = Options.DirectiveOptions; | ||
|
||
export type PluginFunction<T> = Plugin.PluginFunction<T>; | ||
export type PluginObject<T> = Plugin.PluginObject<T>; | ||
|
||
export type VNodeChildren = VNode.VNodeChildren; | ||
export type VNodeChildrenArrayContents = VNode.VNodeChildrenArrayContents; | ||
export type VNode = VNode.VNode; | ||
export type VNodeComponentOptions = VNode.VNodeComponentOptions; | ||
export type VNodeData = VNode.VNodeData; | ||
export type VNodeDirective = VNode.VNodeDirective; | ||
} | ||
|
||
// TS cannot merge imported class with namespace, declare a subclass to bypass | ||
declare class Vue extends _Vue {} | ||
|
||
export = 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