refactor: rewrite private export using the ɵ prefix

This commit is contained in:
Miško Hevery
2017-02-17 12:55:55 -08:00
committed by Igor Minar
parent bb0460b93b
commit 738d93caf7
111 changed files with 202 additions and 1070 deletions

View File

@ -6,180 +6,35 @@
* found in the LICENSE file at https://angular.io/license
*/
import {ANY_STATE as ANY_STATE_, DEFAULT_STATE as DEFAULT_STATE_, EMPTY_STATE as EMPTY_STATE_, FILL_STYLE_FLAG as FILL_STYLE_FLAG_} from './animation/animation_constants';
import {AnimationGroupPlayer as AnimationGroupPlayer_} from './animation/animation_group_player';
import {AnimationKeyframe as AnimationKeyframe_} from './animation/animation_keyframe';
import {AnimationPlayer as AnimationPlayer_, NoOpAnimationPlayer as NoOpAnimationPlayer_} from './animation/animation_player';
import {AnimationSequencePlayer as AnimationSequencePlayer_} from './animation/animation_sequence_player';
import * as animationUtils from './animation/animation_style_util';
import {AnimationStyles as AnimationStyles_} from './animation/animation_styles';
import {AnimationTransition} from './animation/animation_transition';
import {ALLOW_MULTIPLE_PLATFORMS} from './application_ref';
import * as application_tokens from './application_tokens';
import * as change_detection_util from './change_detection/change_detection_util';
import * as constants from './change_detection/constants';
import * as console from './console';
import * as debug from './debug/debug_renderer';
import * as reflective_provider from './di/reflective_provider';
import {ERROR_COMPONENT_TYPE} from './errors';
import * as component_factory from './linker/component_factory';
import * as component_factory_resolver from './linker/component_factory_resolver';
import * as debug_context from './linker/debug_context';
import * as ng_module_factory from './linker/ng_module_factory';
import * as ng_module_factory_loader from './linker/ng_module_factory_loader';
import * as template_ref from './linker/template_ref';
import * as view from './linker/view';
import * as view_container from './linker/view_container';
import * as view_type from './linker/view_type';
import * as view_utils from './linker/view_utils';
import * as lifecycle_hooks from './metadata/lifecycle_hooks';
import * as metadata_view from './metadata/view';
import * as reflection from './reflection/reflection';
export {ANY_STATE as ɵANY_STATE, DEFAULT_STATE as ɵDEFAULT_STATE, EMPTY_STATE as ɵEMPTY_STATE, FILL_STYLE_FLAG as ɵFILL_STYLE_FLAG} from './animation/animation_constants';
export {AnimationGroupPlayer as ɵAnimationGroupPlayer} from './animation/animation_group_player';
export {AnimationKeyframe as ɵAnimationKeyframe} from './animation/animation_keyframe';
export {AnimationPlayer as ɵAnimationPlayer, NoOpAnimationPlayer as ɵNoOpAnimationPlayer} from './animation/animation_player';
export {AnimationSequencePlayer as ɵAnimationSequencePlayer} from './animation/animation_sequence_player';
export {balanceAnimationKeyframes as ɵbalanceAnimationKeyframes, clearStyles as ɵclearStyles, collectAndResolveStyles as ɵcollectAndResolveStyles, flattenStyles as ɵflattenStyles, prepareFinalAnimationStyles as ɵprepareFinalAnimationStyles, renderStyles as ɵrenderStyles} from './animation/animation_style_util';
export {AnimationStyles as ɵAnimationStyles} from './animation/animation_styles';
export {AnimationTransition as ɵAnimationTransition} from './animation/animation_transition';
export {ALLOW_MULTIPLE_PLATFORMS as ɵALLOW_MULTIPLE_PLATFORMS} from './application_ref';
export {APP_ID_RANDOM_PROVIDER as ɵAPP_ID_RANDOM_PROVIDER} from './application_tokens';
export {ValueUnwrapper as ɵValueUnwrapper, devModeEqual as ɵdevModeEqual} from './change_detection/change_detection_util';
export {ChangeDetectorStatus as ɵChangeDetectorStatus, isDefaultChangeDetectionStrategy as ɵisDefaultChangeDetectionStrategy} from './change_detection/constants';
export {Console as ɵConsole} from './console';
export {DebugDomRootRenderer as ɵDebugDomRootRenderer} from './debug/debug_renderer';
export {ERROR_COMPONENT_TYPE as ɵERROR_COMPONENT_TYPE} from './errors';
export {ComponentFactory as ɵComponentFactory} from './linker/component_factory';
export {CodegenComponentFactoryResolver as ɵCodegenComponentFactoryResolver} from './linker/component_factory_resolver';
export {DebugContext as ɵDebugContext, StaticNodeDebugInfo as ɵStaticNodeDebugInfo} from './linker/debug_context';
export {AppView as ɵAppView, DebugAppView as ɵDebugAppView} from './linker/view';
export {ViewContainer as ɵViewContainer} from './linker/view_container';
export {ViewType as ɵViewType} from './linker/view_type';
export {LIFECYCLE_HOOKS_VALUES as ɵLIFECYCLE_HOOKS_VALUES, LifecycleHooks as ɵLifecycleHooks} from './metadata/lifecycle_hooks';
export {ViewMetadata as ɵViewMetadata} from './metadata/view';
export {Reflector as ɵReflector, reflector as ɵreflector} from './reflection/reflection';
// We need to import this name separately from the above wildcard, because this symbol is exposed.
import {Reflector} from './reflection/reflection'; // tslint:disable-line
import * as reflection_capabilities from './reflection/reflection_capabilities';
import * as reflector_reader from './reflection/reflector_reader';
import * as reflection_types from './reflection/types';
import * as api from './render/api';
import {TransitionEngine} from './transition/transition_engine';
import * as decorators from './util/decorators';
import {isObservable, isPromise} from './util/lang';
import * as viewEngine from './view/index';
export const __core_private__: {
isDefaultChangeDetectionStrategy: typeof constants.isDefaultChangeDetectionStrategy,
ChangeDetectorStatus: typeof constants.ChangeDetectorStatus,
_ChangeDetectorStatus: constants.ChangeDetectorStatus,
constructDependencies: typeof reflective_provider.constructDependencies,
LifecycleHooks: typeof lifecycle_hooks.LifecycleHooks,
_LifecycleHooks: lifecycle_hooks.LifecycleHooks,
LIFECYCLE_HOOKS_VALUES: typeof lifecycle_hooks.LIFECYCLE_HOOKS_VALUES,
ReflectorReader: typeof reflector_reader.ReflectorReader,
_ReflectorReader: reflector_reader.ReflectorReader,
_SetterFn: reflection_types.SetterFn;
_GetterFn: reflection_types.GetterFn;
_MethodFn: reflection_types.MethodFn;
CodegenComponentFactoryResolver:
typeof component_factory_resolver.CodegenComponentFactoryResolver,
ComponentRef_: typeof component_factory.ComponentRef_,
_CodegenComponentFactoryResolver: component_factory_resolver.CodegenComponentFactoryResolver,
ViewContainer: typeof view_container.ViewContainer,
_ViewContainer: view_container.ViewContainer,
AppView: typeof view.AppView,
_AppView: view.AppView<any>,
DebugAppView: typeof view.DebugAppView,
_DebugAppView: view.DebugAppView<any>,
NgModuleInjector: typeof ng_module_factory.NgModuleInjector,
_NgModuleInjector: ng_module_factory.NgModuleInjector<any>,
registerModuleFactory: typeof ng_module_factory_loader.registerModuleFactory,
ViewType: typeof view_type.ViewType,
_ViewType: view_type.ViewType,
ViewMetadata: typeof metadata_view.ViewMetadata,
_ViewMetadata: metadata_view.ViewMetadata,
DebugContext: typeof debug_context.DebugContext,
_DebugContext: debug_context.DebugContext,
StaticNodeDebugInfo: typeof debug_context.StaticNodeDebugInfo,
_StaticNodeDebugInfo: debug_context.StaticNodeDebugInfo,
devModeEqual: typeof change_detection_util.devModeEqual,
ValueUnwrapper: typeof change_detection_util.ValueUnwrapper,
_ValueUnwrapper: change_detection_util.ValueUnwrapper,
RenderDebugInfo: typeof api.RenderDebugInfo,
_RenderDebugInfo: api.RenderDebugInfo,
_DirectRenderer: api.DirectRenderer,
TemplateRef_: typeof template_ref.TemplateRef_,
_TemplateRef_: template_ref.TemplateRef_<any>,
ReflectionCapabilities: typeof reflection_capabilities.ReflectionCapabilities,
_ReflectionCapabilities: reflection_capabilities.ReflectionCapabilities,
makeDecorator: typeof decorators.makeDecorator,
DebugDomRootRenderer: typeof debug.DebugDomRootRenderer,
_DebugDomRootRenderer: debug.DebugDomRootRenderer,
Console: typeof console.Console,
_Console: console.Console,
reflector: typeof reflection.reflector,
Reflector: typeof reflection.Reflector,
_Reflector: reflection.Reflector,
NoOpAnimationPlayer: typeof NoOpAnimationPlayer_,
_NoOpAnimationPlayer: NoOpAnimationPlayer_,
AnimationPlayer: typeof AnimationPlayer_,
_AnimationPlayer: AnimationPlayer_,
AnimationSequencePlayer: typeof AnimationSequencePlayer_,
_AnimationSequencePlayer: AnimationSequencePlayer_,
AnimationGroupPlayer: typeof AnimationGroupPlayer_,
_AnimationGroupPlayer: AnimationGroupPlayer_,
AnimationKeyframe: typeof AnimationKeyframe_,
_AnimationKeyframe: AnimationKeyframe_,
prepareFinalAnimationStyles: typeof animationUtils.prepareFinalAnimationStyles,
balanceAnimationKeyframes: typeof animationUtils.balanceAnimationKeyframes,
flattenStyles: typeof animationUtils.flattenStyles,
clearStyles: typeof animationUtils.clearStyles,
renderStyles: typeof animationUtils.renderStyles,
collectAndResolveStyles: typeof animationUtils.collectAndResolveStyles,
APP_ID_RANDOM_PROVIDER: typeof application_tokens.APP_ID_RANDOM_PROVIDER,
AnimationStyles: typeof AnimationStyles_,
_AnimationStyles: AnimationStyles_,
ANY_STATE: typeof ANY_STATE_,
DEFAULT_STATE: typeof DEFAULT_STATE_,
EMPTY_STATE: typeof EMPTY_STATE_,
FILL_STYLE_FLAG: typeof FILL_STYLE_FLAG_,
isPromise: typeof isPromise,
isObservable: typeof isObservable,
AnimationTransition: typeof AnimationTransition,
ALLOW_MULTIPLE_PLATFORMS: typeof ALLOW_MULTIPLE_PLATFORMS,
view_utils: typeof view_utils,
ERROR_COMPONENT_TYPE: typeof ERROR_COMPONENT_TYPE,
viewEngine: typeof viewEngine,
TransitionEngine: typeof TransitionEngine
} = {
isDefaultChangeDetectionStrategy: constants.isDefaultChangeDetectionStrategy,
ChangeDetectorStatus: constants.ChangeDetectorStatus,
constructDependencies: reflective_provider.constructDependencies,
LifecycleHooks: lifecycle_hooks.LifecycleHooks,
LIFECYCLE_HOOKS_VALUES: lifecycle_hooks.LIFECYCLE_HOOKS_VALUES,
ReflectorReader: reflector_reader.ReflectorReader,
CodegenComponentFactoryResolver: component_factory_resolver.CodegenComponentFactoryResolver,
ComponentRef_: component_factory.ComponentRef_,
ViewContainer: view_container.ViewContainer,
AppView: view.AppView,
DebugAppView: view.DebugAppView,
NgModuleInjector: ng_module_factory.NgModuleInjector,
registerModuleFactory: ng_module_factory_loader.registerModuleFactory,
ViewType: view_type.ViewType,
view_utils: view_utils,
viewEngine: viewEngine,
ViewMetadata: metadata_view.ViewMetadata,
DebugContext: debug_context.DebugContext,
StaticNodeDebugInfo: debug_context.StaticNodeDebugInfo,
devModeEqual: change_detection_util.devModeEqual,
ValueUnwrapper: change_detection_util.ValueUnwrapper,
RenderDebugInfo: api.RenderDebugInfo,
TemplateRef_: template_ref.TemplateRef_,
ReflectionCapabilities: reflection_capabilities.ReflectionCapabilities,
makeDecorator: decorators.makeDecorator,
DebugDomRootRenderer: debug.DebugDomRootRenderer,
Console: console.Console,
reflector: reflection.reflector,
Reflector: reflection.Reflector,
NoOpAnimationPlayer: NoOpAnimationPlayer_,
AnimationPlayer: AnimationPlayer_,
AnimationSequencePlayer: AnimationSequencePlayer_,
AnimationGroupPlayer: AnimationGroupPlayer_,
AnimationKeyframe: AnimationKeyframe_,
prepareFinalAnimationStyles: animationUtils.prepareFinalAnimationStyles,
balanceAnimationKeyframes: animationUtils.balanceAnimationKeyframes,
flattenStyles: animationUtils.flattenStyles,
clearStyles: animationUtils.clearStyles,
renderStyles: animationUtils.renderStyles,
collectAndResolveStyles: animationUtils.collectAndResolveStyles,
APP_ID_RANDOM_PROVIDER: application_tokens.APP_ID_RANDOM_PROVIDER,
AnimationStyles: AnimationStyles_,
ANY_STATE: ANY_STATE_,
DEFAULT_STATE: DEFAULT_STATE_,
EMPTY_STATE: EMPTY_STATE_,
FILL_STYLE_FLAG: FILL_STYLE_FLAG_,
isPromise: isPromise,
isObservable: isObservable,
AnimationTransition: AnimationTransition,
ALLOW_MULTIPLE_PLATFORMS: ALLOW_MULTIPLE_PLATFORMS,
ERROR_COMPONENT_TYPE: ERROR_COMPONENT_TYPE,
TransitionEngine: TransitionEngine
} as any /* TODO(misko): export these using omega names instead */;
export {ReflectionCapabilities as ɵReflectionCapabilities} from './reflection/reflection_capabilities';
export {ReflectorReader as ɵReflectorReader} from './reflection/reflector_reader';
export {GetterFn as ɵGetterFn, MethodFn as ɵMethodFn, SetterFn as ɵSetterFn} from './reflection/types';
export {DirectRenderer as ɵDirectRenderer, RenderDebugInfo as ɵRenderDebugInfo} from './render/api';
export {TransitionEngine as ɵTransitionEngine} from './transition/transition_engine';
export {makeDecorator as ɵmakeDecorator} from './util/decorators';
export {isObservable as ɵisObservable, isPromise as ɵisPromise} from './util/lang';

View File

@ -6,18 +6,5 @@
* found in the LICENSE file at https://angular.io/license
*/
import * as mock_animation_player from './mock_animation_player';
import * as test_compiler from './test_compiler';
export const __core_private_testing__: {
TestingCompiler: typeof test_compiler.TestingCompiler,
_TestingCompiler: test_compiler.TestingCompiler,
TestingCompilerFactory: typeof test_compiler.TestingCompilerFactory,
_TestingCompilerFactory: test_compiler.TestingCompilerFactory,
MockAnimationPlayer: typeof mock_animation_player.MockAnimationPlayer
_MockAnimationPlayer: mock_animation_player.MockAnimationPlayer
} = {
TestingCompiler: test_compiler.TestingCompiler,
TestingCompilerFactory: test_compiler.TestingCompilerFactory,
MockAnimationPlayer: mock_animation_player.MockAnimationPlayer
} as any /* TODO(misko): export these using omega names instead */;
export {MockAnimationPlayer as ɵMockAnimationPlayer} from './mock_animation_player';
export {TestingCompiler as ɵTestingCompiler, TestingCompilerFactory as ɵTestingCompilerFactory} from './test_compiler';

View File

@ -1,11 +0,0 @@
/**
* @license
* Copyright Google Inc. All Rights Reserved.
*
* Use of this source code is governed by an MIT-style license that can be
* found in the LICENSE file at https://angular.io/license
*/
import {__core_private__ as r} from '@angular/core';
export const isPromise: typeof r.isPromise = r.isPromise;

View File

@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/
import {CompilerOptions, Component, Directive, InjectionToken, Injector, ModuleWithComponentFactories, NgModule, NgModuleRef, NgZone, Pipe, PlatformRef, Provider, ReflectiveInjector, SchemaMetadata, Type, __core_private__} from '@angular/core';
import {CompilerOptions, Component, Directive, InjectionToken, Injector, ModuleWithComponentFactories, NgModule, NgModuleRef, NgZone, Pipe, PlatformRef, Provider, ReflectiveInjector, SchemaMetadata, Type, ɵERROR_COMPONENT_TYPE} from '@angular/core';
import {AsyncTestCompleter} from './async_test_completer';
import {ComponentFixture} from './component_fixture';
import {stringify} from './facade/lang';
@ -472,5 +472,5 @@ export function withModule(moduleDef: TestModuleMetadata, fn: Function = null):
}
function getComponentType(error: Error): Function {
return (error as any)[__core_private__.ERROR_COMPONENT_TYPE];
return (error as any)[ɵERROR_COMPONENT_TYPE];
}

View File

@ -6,10 +6,11 @@
* found in the LICENSE file at https://angular.io/license
*/
import {ɵisPromise as isPromise} from '@angular/core';
import {AsyncTestCompleter} from './async_test_completer';
import {StringMapWrapper} from './facade/collection';
import {global} from './facade/lang';
import {isPromise} from './private_import_core';
import {getTestBed, inject} from './test_bed';
export {AsyncTestCompleter} from './async_test_completer';