]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
types: trim exports
authorEvan You <yyx990803@gmail.com>
Thu, 4 Oct 2018 22:12:18 +0000 (18:12 -0400)
committerEvan You <yyx990803@gmail.com>
Thu, 4 Oct 2018 22:12:18 +0000 (18:12 -0400)
packages/core/src/index.ts
packages/core/src/optional/asyncComponent.ts
packages/core/src/optional/context.ts
packages/core/src/optional/directive.ts

index aeb14ca5a1d13a4e4eefb7d4340fa17a0aaf69b8..5718252c8a6a74e8af2409460a1756d35eb9a419 100644 (file)
@@ -15,13 +15,13 @@ export { createComponentInstance } from './componentUtils'
 
 // Optional APIs
 // these are imported on-demand and can be tree-shaken
-export * from './optional/directive'
-export * from './optional/context'
-export * from './optional/asyncComponent'
-export * from './optional/keepAlive'
+export { applyDirective } from './optional/directive'
+export { Provide, Inject } from './optional/context'
+export { createAsyncComponent } from './optional/asyncComponent'
+export { KeepAlive } from './optional/keepAlive'
 
 // flags & types
 export { ComponentType, ComponentClass, FunctionalComponent } from './component'
 export { ComponentOptions, PropType } from './componentOptions'
 export { VNodeFlags, ChildrenFlags } from './flags'
-export { VNode, VNodeData, VNodeChildren, Key, Ref, Slots, Slot } from './vdom'
+export { VNode, Slots } from './vdom'
index f84bbdb901315b00c5ad49e698e1e92035a5f123..1a60b49efcdabad16d6a6d40400e2503d4a4a4cd 100644 (file)
@@ -3,12 +3,12 @@ import { createComponentVNode, Slots } from '../vdom'
 import { Component, ComponentType, ComponentClass } from '../component'
 import { unwrap } from '@vue/observer'
 
-export interface AsyncComponentFactory {
+interface AsyncComponentFactory {
   (): Promise<ComponentType>
   resolved?: ComponentType
 }
 
-export interface AsyncComponentFullOptions {
+interface AsyncComponentFullOptions {
   factory: AsyncComponentFactory
   loading?: ComponentType
   error?: ComponentType
@@ -16,9 +16,7 @@ export interface AsyncComponentFullOptions {
   timeout?: number
 }
 
-export type AsyncComponentOptions =
-  | AsyncComponentFactory
-  | AsyncComponentFullOptions
+type AsyncComponentOptions = AsyncComponentFactory | AsyncComponentFullOptions
 
 interface AsyncContainerData {
   comp: ComponentType | null
index 72093caf44af42da601f05d01096d826c6fb3692..f8d688d5241e2b6ff19b44b77e12eadd704afe4a 100644 (file)
@@ -1,6 +1,5 @@
 import { observable } from '@vue/observer'
 import { Component } from '../component'
-import { Slots } from '../vdom'
 
 const contextStore = observable() as Record<string | symbol, any>
 
@@ -39,7 +38,7 @@ export class Provide extends Component<{}, ProviderProps> {
   beforeUpdate() {
     this.updateValue()
   }
-  render(props: ProviderProps, slots: Slots) {
+  render(props: any, slots: any) {
     return slots.default && slots.default()
   }
 }
@@ -57,7 +56,7 @@ Provide.options = {
 }
 
 export class Inject extends Component {
-  render(props: any, slots: Slots) {
+  render(props: any, slots: any) {
     return slots.default && slots.default(contextStore[props.id])
   }
 }
index 8867e44601d921e44bbdd00911282c4fda153a80..9d076b1b91c3a27b24955eff01088c134c7490f9 100644 (file)
@@ -1,7 +1,7 @@
 import { VNode } from '../vdom'
 import { MountedComponent } from '../component'
 
-export interface DirectiveBinding {
+interface DirectiveBinding {
   instance: MountedComponent
   value?: any
   oldValue?: any
@@ -9,14 +9,14 @@ export interface DirectiveBinding {
   modifiers?: DirectiveModifiers
 }
 
-export type DirectiveHook = (
+type DirectiveHook = (
   el: any,
   binding: DirectiveBinding,
   vnode: VNode,
   prevVNode: VNode | void
 ) => void
 
-export interface Directive {
+interface Directive {
   beforeMount: DirectiveHook
   mounted: DirectiveHook
   beforeUpdate: DirectiveHook
@@ -25,7 +25,7 @@ export interface Directive {
   unmounted: DirectiveHook
 }
 
-export type DirectiveModifiers = Record<string, boolean>
+type DirectiveModifiers = Record<string, boolean>
 
 const valueCache = new WeakMap<Directive, WeakMap<any, any>>()