@angular/core 14.0.3 → 14.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2020/src/application_ref.mjs +23 -13
- package/esm2020/src/core.mjs +1 -1
- package/esm2020/src/core_render3_private_export.mjs +2 -2
- package/esm2020/src/debug/debug_node.mjs +2 -3
- package/esm2020/src/di/injector_compatibility.mjs +3 -8
- package/esm2020/src/di/jit/util.mjs +3 -2
- package/esm2020/src/di/reflective_key.mjs +3 -2
- package/esm2020/src/errors.mjs +1 -1
- package/esm2020/src/i18n/locale_data_api.mjs +3 -2
- package/esm2020/src/render/api.mjs +2 -11
- package/esm2020/src/render3/component.mjs +3 -57
- package/esm2020/src/render3/component_ref.mjs +9 -3
- package/esm2020/src/render3/index.mjs +4 -4
- package/esm2020/src/render3/instructions/change_detection.mjs +2 -20
- package/esm2020/src/render3/instructions/listener.mjs +34 -44
- package/esm2020/src/render3/instructions/lview_debug.mjs +1 -1
- package/esm2020/src/render3/instructions/shared.mjs +19 -57
- package/esm2020/src/render3/instructions/styling.mjs +2 -2
- package/esm2020/src/render3/interfaces/renderer.mjs +1 -17
- package/esm2020/src/render3/interfaces/view.mjs +1 -1
- package/esm2020/src/render3/node_manipulation.mjs +24 -87
- package/esm2020/src/render3/node_manipulation_i18n.mjs +1 -1
- package/esm2020/src/render3/util/attrs_utils.mjs +4 -12
- package/esm2020/src/render3/util/view_utils.mjs +3 -6
- package/esm2020/src/version.mjs +1 -1
- package/esm2020/src/zone/ng_zone.mjs +5 -4
- package/esm2020/testing/src/logger.mjs +3 -3
- package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
- package/fesm2015/core.mjs +1693 -1889
- package/fesm2015/core.mjs.map +1 -1
- package/fesm2015/testing.mjs +2473 -2772
- package/fesm2015/testing.mjs.map +1 -1
- package/fesm2020/core.mjs +1693 -1889
- package/fesm2020/core.mjs.map +1 -1
- package/fesm2020/testing.mjs +2473 -2772
- package/fesm2020/testing.mjs.map +1 -1
- package/index.d.ts +61 -134
- package/package.json +1 -1
- package/testing/index.d.ts +1 -1
- package/schematics/utils/schematics_prompt.d.ts +0 -17
- package/schematics/utils/schematics_prompt.js +0 -45
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @license Angular v14.0.
|
|
2
|
+
* @license Angular v14.0.6
|
|
3
3
|
* (c) 2010-2022 Google LLC. https://angular.io/
|
|
4
4
|
* License: MIT
|
|
5
5
|
*/
|
|
@@ -401,7 +401,6 @@ export declare class ApplicationRef {
|
|
|
401
401
|
private _zone;
|
|
402
402
|
private _injector;
|
|
403
403
|
private _exceptionHandler;
|
|
404
|
-
private _initStatus;
|
|
405
404
|
private _views;
|
|
406
405
|
private _runningTick;
|
|
407
406
|
private _stable;
|
|
@@ -530,7 +529,7 @@ export declare class ApplicationRef {
|
|
|
530
529
|
private _loadComponent;
|
|
531
530
|
/**
|
|
532
531
|
* Destroys an Angular application represented by this `ApplicationRef`. Calling this function
|
|
533
|
-
* will destroy the associated
|
|
532
|
+
* will destroy the associated environment injectors as well as all the bootstrapped components
|
|
534
533
|
* with their views.
|
|
535
534
|
*/
|
|
536
535
|
destroy(): void;
|
|
@@ -609,8 +608,10 @@ export declare interface AttributeDecorator {
|
|
|
609
608
|
|
|
610
609
|
/**
|
|
611
610
|
* Provides additional options to the bootstraping process.
|
|
611
|
+
*
|
|
612
|
+
* @publicApi
|
|
612
613
|
*/
|
|
613
|
-
declare interface BootstrapOptions {
|
|
614
|
+
export declare interface BootstrapOptions {
|
|
614
615
|
/**
|
|
615
616
|
* Optionally specify which `NgZone` should be used.
|
|
616
617
|
*
|
|
@@ -1600,49 +1601,6 @@ declare type ContentQueriesFunction<T> = <U extends T>(rf: ɵRenderFlags, ctx: U
|
|
|
1600
1601
|
|
|
1601
1602
|
declare const CONTEXT = 8;
|
|
1602
1603
|
|
|
1603
|
-
/** Options that control how the component should be bootstrapped. */
|
|
1604
|
-
declare interface CreateComponentOptions {
|
|
1605
|
-
/** Which renderer factory to use. */
|
|
1606
|
-
rendererFactory?: RendererFactory3;
|
|
1607
|
-
/** A custom sanitizer instance */
|
|
1608
|
-
sanitizer?: Sanitizer;
|
|
1609
|
-
/** A custom animation player handler */
|
|
1610
|
-
playerHandler?: ɵPlayerHandler;
|
|
1611
|
-
/**
|
|
1612
|
-
* Host element on which the component will be bootstrapped. If not specified,
|
|
1613
|
-
* the component definition's `tag` is used to query the existing DOM for the
|
|
1614
|
-
* element to bootstrap.
|
|
1615
|
-
*/
|
|
1616
|
-
host?: RElement | string;
|
|
1617
|
-
/** Module injector for the component. If unspecified, the injector will be NULL_INJECTOR. */
|
|
1618
|
-
injector?: Injector;
|
|
1619
|
-
/**
|
|
1620
|
-
* List of features to be applied to the created component. Features are simply
|
|
1621
|
-
* functions that decorate a component with a certain behavior.
|
|
1622
|
-
*
|
|
1623
|
-
* Typically, the features in this list are features that cannot be added to the
|
|
1624
|
-
* other features list in the component definition because they rely on other factors.
|
|
1625
|
-
*
|
|
1626
|
-
* Example: `LifecycleHooksFeature` is a function that adds lifecycle hook capabilities
|
|
1627
|
-
* to root components in a tree-shakable way. It cannot be added to the component
|
|
1628
|
-
* features list because there's no way of knowing when the component will be used as
|
|
1629
|
-
* a root component.
|
|
1630
|
-
*/
|
|
1631
|
-
hostFeatures?: HostFeature[];
|
|
1632
|
-
/**
|
|
1633
|
-
* A function which is used to schedule change detection work in the future.
|
|
1634
|
-
*
|
|
1635
|
-
* When marking components as dirty, it is necessary to schedule the work of
|
|
1636
|
-
* change detection in the future. This is done to coalesce multiple
|
|
1637
|
-
* {@link markDirty} calls into a single changed detection processing.
|
|
1638
|
-
*
|
|
1639
|
-
* The default value of the scheduler is the `requestAnimationFrame` function.
|
|
1640
|
-
*
|
|
1641
|
-
* It is also useful to override this function for testing purposes.
|
|
1642
|
-
*/
|
|
1643
|
-
scheduler?: (work: () => void) => void;
|
|
1644
|
-
}
|
|
1645
|
-
|
|
1646
1604
|
/**
|
|
1647
1605
|
* Create a new environment injector.
|
|
1648
1606
|
*
|
|
@@ -2937,6 +2895,14 @@ export declare interface GetTestability {
|
|
|
2937
2895
|
findTestabilityInTree(registry: TestabilityRegistry, elem: any, findInAncestors: boolean): Testability | null;
|
|
2938
2896
|
}
|
|
2939
2897
|
|
|
2898
|
+
/**
|
|
2899
|
+
* The goal here is to make sure that the browser DOM API is the Renderer.
|
|
2900
|
+
* We do this by defining a subset of DOM API to be the renderer and then
|
|
2901
|
+
* use that at runtime for rendering.
|
|
2902
|
+
*
|
|
2903
|
+
* At runtime we can then use the DOM api directly, in server or web-worker
|
|
2904
|
+
* it will be easy to implement such API.
|
|
2905
|
+
*/
|
|
2940
2906
|
declare type GlobalTargetName = 'document' | 'window' | 'body';
|
|
2941
2907
|
|
|
2942
2908
|
declare type GlobalTargetResolver = (element: any) => EventTarget;
|
|
@@ -3141,9 +3107,6 @@ export declare interface HostDecorator {
|
|
|
3141
3107
|
new (): Host;
|
|
3142
3108
|
}
|
|
3143
3109
|
|
|
3144
|
-
/** See CreateComponentOptions.hostFeatures */
|
|
3145
|
-
declare type HostFeature = (<T>(component: T, componentDef: ɵComponentDef<T>) => void);
|
|
3146
|
-
|
|
3147
3110
|
/**
|
|
3148
3111
|
* Type of the HostListener metadata.
|
|
3149
3112
|
*
|
|
@@ -4581,9 +4544,9 @@ declare interface LView<T = unknown> extends Array<any> {
|
|
|
4581
4544
|
/** An optional Module Injector to be used as fall back after Element Injectors are consulted. */
|
|
4582
4545
|
readonly [INJECTOR_2]: Injector | null;
|
|
4583
4546
|
/** Factory to be used for creating Renderer. */
|
|
4584
|
-
[RENDERER_FACTORY]:
|
|
4547
|
+
[RENDERER_FACTORY]: RendererFactory;
|
|
4585
4548
|
/** Renderer to be used for this view. */
|
|
4586
|
-
[RENDERER]:
|
|
4549
|
+
[RENDERER]: Renderer;
|
|
4587
4550
|
/** An optional custom sanitizer. */
|
|
4588
4551
|
[SANITIZER]: Sanitizer | null;
|
|
4589
4552
|
/**
|
|
@@ -5428,21 +5391,6 @@ declare interface NodeInjectorDebug {
|
|
|
5428
5391
|
parentInjectorIndex: number;
|
|
5429
5392
|
}
|
|
5430
5393
|
|
|
5431
|
-
/**
|
|
5432
|
-
* Object Oriented style of API needed to create elements and text nodes.
|
|
5433
|
-
*
|
|
5434
|
-
* This is the native browser API style, e.g. operations are methods on individual objects
|
|
5435
|
-
* like HTMLElement. With this style, no additional code is needed as a facade
|
|
5436
|
-
* (reducing payload size).
|
|
5437
|
-
* */
|
|
5438
|
-
declare interface ObjectOrientedRenderer3 {
|
|
5439
|
-
createComment(data: string): RComment;
|
|
5440
|
-
createElement(tagName: string): RElement;
|
|
5441
|
-
createElementNS(namespace: string, tagName: string): RElement;
|
|
5442
|
-
createTextNode(data: string): RText;
|
|
5443
|
-
querySelector(selectors: string): RElement | null;
|
|
5444
|
-
}
|
|
5445
|
-
|
|
5446
5394
|
/**
|
|
5447
5395
|
* @description
|
|
5448
5396
|
* A lifecycle hook that is called when any data-bound property of a directive changes.
|
|
@@ -5867,41 +5815,6 @@ declare const enum PreOrderHookFlags {
|
|
|
5867
5815
|
NumberOfInitHooksCalledMask = 4294901760
|
|
5868
5816
|
}
|
|
5869
5817
|
|
|
5870
|
-
/**
|
|
5871
|
-
* Procedural style of API needed to create elements and text nodes.
|
|
5872
|
-
*
|
|
5873
|
-
* In non-native browser environments (e.g. platforms such as web-workers), this is the
|
|
5874
|
-
* facade that enables element manipulation. This also facilitates backwards compatibility
|
|
5875
|
-
* with Renderer2.
|
|
5876
|
-
*/
|
|
5877
|
-
declare interface ProceduralRenderer3 {
|
|
5878
|
-
destroy(): void;
|
|
5879
|
-
createComment(value: string): RComment;
|
|
5880
|
-
createElement(name: string, namespace?: string | null): RElement;
|
|
5881
|
-
createText(value: string): RText;
|
|
5882
|
-
/**
|
|
5883
|
-
* This property is allowed to be null / undefined,
|
|
5884
|
-
* in which case the view engine won't call it.
|
|
5885
|
-
* This is used as a performance optimization for production mode.
|
|
5886
|
-
*/
|
|
5887
|
-
destroyNode?: ((node: RNode) => void) | null;
|
|
5888
|
-
appendChild(parent: RElement, newChild: RNode): void;
|
|
5889
|
-
insertBefore(parent: RNode, newChild: RNode, refChild: RNode | null, isMove?: boolean): void;
|
|
5890
|
-
removeChild(parent: RElement, oldChild: RNode, isHostElement?: boolean): void;
|
|
5891
|
-
selectRootElement(selectorOrNode: string | any, preserveContent?: boolean): RElement;
|
|
5892
|
-
parentNode(node: RNode): RElement | null;
|
|
5893
|
-
nextSibling(node: RNode): RNode | null;
|
|
5894
|
-
setAttribute(el: RElement, name: string, value: string | TrustedHTML | TrustedScript | TrustedScriptURL, namespace?: string | null): void;
|
|
5895
|
-
removeAttribute(el: RElement, name: string, namespace?: string | null): void;
|
|
5896
|
-
addClass(el: RElement, name: string): void;
|
|
5897
|
-
removeClass(el: RElement, name: string): void;
|
|
5898
|
-
setStyle(el: RElement, style: string, value: any, flags?: RendererStyleFlags2 | RendererStyleFlags3): void;
|
|
5899
|
-
removeStyle(el: RElement, style: string, flags?: RendererStyleFlags2 | RendererStyleFlags3): void;
|
|
5900
|
-
setProperty(el: RElement, name: string, value: any): void;
|
|
5901
|
-
setValue(node: RText | RComment, value: string): void;
|
|
5902
|
-
listen(target: GlobalTargetName | RNode, eventName: string, callback: (event: any) => boolean | void): () => void;
|
|
5903
|
-
}
|
|
5904
|
-
|
|
5905
5818
|
/**
|
|
5906
5819
|
* Describes a function that is used to process provider lists (such as provider
|
|
5907
5820
|
* overrides).
|
|
@@ -6630,6 +6543,40 @@ declare interface RElement extends RNode {
|
|
|
6630
6543
|
|
|
6631
6544
|
declare const RENDERER = 11;
|
|
6632
6545
|
|
|
6546
|
+
/**
|
|
6547
|
+
* Procedural style of API needed to create elements and text nodes.
|
|
6548
|
+
*
|
|
6549
|
+
* In non-native browser environments (e.g. platforms such as web-workers), this is the
|
|
6550
|
+
* facade that enables element manipulation. In practice, this is implemented by `Renderer2`.
|
|
6551
|
+
*/
|
|
6552
|
+
declare interface Renderer {
|
|
6553
|
+
destroy(): void;
|
|
6554
|
+
createComment(value: string): RComment;
|
|
6555
|
+
createElement(name: string, namespace?: string | null): RElement;
|
|
6556
|
+
createText(value: string): RText;
|
|
6557
|
+
/**
|
|
6558
|
+
* This property is allowed to be null / undefined,
|
|
6559
|
+
* in which case the view engine won't call it.
|
|
6560
|
+
* This is used as a performance optimization for production mode.
|
|
6561
|
+
*/
|
|
6562
|
+
destroyNode?: ((node: RNode) => void) | null;
|
|
6563
|
+
appendChild(parent: RElement, newChild: RNode): void;
|
|
6564
|
+
insertBefore(parent: RNode, newChild: RNode, refChild: RNode | null, isMove?: boolean): void;
|
|
6565
|
+
removeChild(parent: RElement, oldChild: RNode, isHostElement?: boolean): void;
|
|
6566
|
+
selectRootElement(selectorOrNode: string | any, preserveContent?: boolean): RElement;
|
|
6567
|
+
parentNode(node: RNode): RElement | null;
|
|
6568
|
+
nextSibling(node: RNode): RNode | null;
|
|
6569
|
+
setAttribute(el: RElement, name: string, value: string | TrustedHTML | TrustedScript | TrustedScriptURL, namespace?: string | null): void;
|
|
6570
|
+
removeAttribute(el: RElement, name: string, namespace?: string | null): void;
|
|
6571
|
+
addClass(el: RElement, name: string): void;
|
|
6572
|
+
removeClass(el: RElement, name: string): void;
|
|
6573
|
+
setStyle(el: RElement, style: string, value: any, flags?: RendererStyleFlags2): void;
|
|
6574
|
+
removeStyle(el: RElement, style: string, flags?: RendererStyleFlags2): void;
|
|
6575
|
+
setProperty(el: RElement, name: string, value: any): void;
|
|
6576
|
+
setValue(node: RText | RComment, value: string): void;
|
|
6577
|
+
listen(target: GlobalTargetName | RNode, eventName: string, callback: (event: any) => boolean | void): () => void;
|
|
6578
|
+
}
|
|
6579
|
+
|
|
6633
6580
|
/**
|
|
6634
6581
|
* Extend this base class to implement custom rendering. By default, Angular
|
|
6635
6582
|
* renders a template into DOM. You can use custom rendering to intercept
|
|
@@ -6806,10 +6753,14 @@ export declare abstract class Renderer2 {
|
|
|
6806
6753
|
abstract listen(target: 'window' | 'document' | 'body' | any, eventName: string, callback: (event: any) => boolean | void): () => void;
|
|
6807
6754
|
}
|
|
6808
6755
|
|
|
6809
|
-
declare type Renderer3 = ObjectOrientedRenderer3 | ProceduralRenderer3;
|
|
6810
|
-
|
|
6811
6756
|
declare const RENDERER_FACTORY = 10;
|
|
6812
6757
|
|
|
6758
|
+
declare interface RendererFactory {
|
|
6759
|
+
createRenderer(hostElement: RElement | null, rendererType: RendererType2 | null): Renderer;
|
|
6760
|
+
begin?(): void;
|
|
6761
|
+
end?(): void;
|
|
6762
|
+
}
|
|
6763
|
+
|
|
6813
6764
|
/**
|
|
6814
6765
|
* Creates and initializes a custom renderer that implements the `Renderer2` base class.
|
|
6815
6766
|
*
|
|
@@ -6838,12 +6789,6 @@ export declare abstract class RendererFactory2 {
|
|
|
6838
6789
|
abstract whenRenderingDone?(): Promise<any>;
|
|
6839
6790
|
}
|
|
6840
6791
|
|
|
6841
|
-
declare interface RendererFactory3 {
|
|
6842
|
-
createRenderer(hostElement: RElement | null, rendererType: RendererType2 | null): Renderer3;
|
|
6843
|
-
begin?(): void;
|
|
6844
|
-
end?(): void;
|
|
6845
|
-
}
|
|
6846
|
-
|
|
6847
6792
|
/**
|
|
6848
6793
|
* Flags for renderer-specific style modifiers.
|
|
6849
6794
|
* @publicApi
|
|
@@ -6859,11 +6804,6 @@ export declare enum RendererStyleFlags2 {
|
|
|
6859
6804
|
DashCase = 2
|
|
6860
6805
|
}
|
|
6861
6806
|
|
|
6862
|
-
declare enum RendererStyleFlags3 {
|
|
6863
|
-
Important = 1,
|
|
6864
|
-
DashCase = 2
|
|
6865
|
-
}
|
|
6866
|
-
|
|
6867
6807
|
/**
|
|
6868
6808
|
* Used by `RendererFactory2` to associate custom rendering data and styles
|
|
6869
6809
|
* with a rendering implementation.
|
|
@@ -7038,6 +6978,7 @@ declare const enum RuntimeErrorCode {
|
|
|
7038
6978
|
INVALID_INJECTION_TOKEN = 204,
|
|
7039
6979
|
INJECTOR_ALREADY_DESTROYED = 205,
|
|
7040
6980
|
PROVIDER_IN_WRONG_CONTEXT = 207,
|
|
6981
|
+
MISSING_INJECTION_TOKEN = 208,
|
|
7041
6982
|
MULTIPLE_COMPONENTS_MATCH = -300,
|
|
7042
6983
|
EXPORT_NOT_FOUND = -301,
|
|
7043
6984
|
PIPE_NOT_FOUND = -302,
|
|
@@ -7052,7 +6993,9 @@ declare const enum RuntimeErrorCode {
|
|
|
7052
6993
|
PLATFORM_ALREADY_DESTROYED = 404,
|
|
7053
6994
|
ASYNC_INITIALIZERS_STILL_RUNNING = 405,
|
|
7054
6995
|
APPLICATION_REF_ALREADY_DESTROYED = 406,
|
|
6996
|
+
RENDERER_NOT_FOUND = 407,
|
|
7055
6997
|
INVALID_I18N_STRUCTURE = 700,
|
|
6998
|
+
MISSING_LOCALE_DATA = 701,
|
|
7056
6999
|
IMPORT_PROVIDERS_FROM_STANDALONE = 800,
|
|
7057
7000
|
INVALID_DIFFER_INPUT = 900,
|
|
7058
7001
|
NO_SUPPORTING_DIFFER_FACTORY = 901,
|
|
@@ -7061,7 +7004,9 @@ declare const enum RuntimeErrorCode {
|
|
|
7061
7004
|
UNSAFE_VALUE_IN_RESOURCE_URL = 904,
|
|
7062
7005
|
UNSAFE_VALUE_IN_SCRIPT = 905,
|
|
7063
7006
|
MISSING_GENERATED_DEF = 906,
|
|
7064
|
-
TYPE_IS_NOT_STANDALONE = 907
|
|
7007
|
+
TYPE_IS_NOT_STANDALONE = 907,
|
|
7008
|
+
MISSING_ZONEJS = 908,
|
|
7009
|
+
UNEXPECTED_ZONE_STATE = 909
|
|
7065
7010
|
}
|
|
7066
7011
|
|
|
7067
7012
|
declare const SANITIZER = 12;
|
|
@@ -10686,21 +10631,6 @@ export declare class ɵRender3NgModuleRef<T> extends NgModuleRef<T> implements I
|
|
|
10686
10631
|
onDestroy(callback: () => void): void;
|
|
10687
10632
|
}
|
|
10688
10633
|
|
|
10689
|
-
/**
|
|
10690
|
-
* Bootstraps a Component into an existing host element and returns an instance
|
|
10691
|
-
* of the component.
|
|
10692
|
-
*
|
|
10693
|
-
* Use this function to bootstrap a component into the DOM tree. Each invocation
|
|
10694
|
-
* of this function will create a separate tree of components, injectors and
|
|
10695
|
-
* change detection cycles and lifetimes. To dynamically insert a new component
|
|
10696
|
-
* into an existing tree such that it shares the same injection, change detection
|
|
10697
|
-
* and object lifetime, use {@link ViewContainer#createComponent}.
|
|
10698
|
-
*
|
|
10699
|
-
* @param componentType Component to bootstrap
|
|
10700
|
-
* @param options Optional parameters which control bootstrapping
|
|
10701
|
-
*/
|
|
10702
|
-
export declare function ɵrenderComponent<T>(componentType: ɵComponentType<T> | Type<T>, opts?: CreateComponentOptions): T;
|
|
10703
|
-
|
|
10704
10634
|
/**
|
|
10705
10635
|
* Flags passed into template functions to determine which blocks (i.e. creation, update)
|
|
10706
10636
|
* should be executed.
|
|
@@ -12750,9 +12680,6 @@ export declare function ɵɵinvalidFactory(): never;
|
|
|
12750
12680
|
* Throws an error indicating that a factory function could not be generated by the compiler for a
|
|
12751
12681
|
* particular class.
|
|
12752
12682
|
*
|
|
12753
|
-
* This instruction allows the actual error message to be optimized away when ngDevMode is turned
|
|
12754
|
-
* off, saving bytes of generated code while still providing a good experience in dev mode.
|
|
12755
|
-
*
|
|
12756
12683
|
* The name of the class is not mentioned here, but will be in the generated factory function name
|
|
12757
12684
|
* and thus in the stack trace.
|
|
12758
12685
|
*
|
package/package.json
CHANGED
package/testing/index.d.ts
CHANGED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
/// <amd-module name="@angular/core/schematics/utils/schematics_prompt" />
|
|
9
|
-
declare type Inquirer = typeof import('inquirer');
|
|
10
|
-
/** Whether prompts are currently supported. */
|
|
11
|
-
export declare function supportsPrompt(): boolean;
|
|
12
|
-
/**
|
|
13
|
-
* Gets the resolved instance of "inquirer" which can be used to programmatically
|
|
14
|
-
* create prompts.
|
|
15
|
-
*/
|
|
16
|
-
export declare function getInquirer(): Inquirer;
|
|
17
|
-
export {};
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @license
|
|
3
|
-
* Copyright Google LLC All Rights Reserved.
|
|
4
|
-
*
|
|
5
|
-
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
-
* found in the LICENSE file at https://angular.io/license
|
|
7
|
-
*/
|
|
8
|
-
(function (factory) {
|
|
9
|
-
if (typeof module === "object" && typeof module.exports === "object") {
|
|
10
|
-
var v = factory(require, exports);
|
|
11
|
-
if (v !== undefined) module.exports = v;
|
|
12
|
-
}
|
|
13
|
-
else if (typeof define === "function" && define.amd) {
|
|
14
|
-
define("@angular/core/schematics/utils/schematics_prompt", ["require", "exports"], factory);
|
|
15
|
-
}
|
|
16
|
-
})(function (require, exports) {
|
|
17
|
-
"use strict";
|
|
18
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.getInquirer = exports.supportsPrompt = void 0;
|
|
20
|
-
let resolvedInquirerModule;
|
|
21
|
-
try {
|
|
22
|
-
// "inquirer" is the prompt module also used by the devkit schematics CLI
|
|
23
|
-
// in order to show prompts for schematics. We transitively depend on this
|
|
24
|
-
// module, but don't want to throw an exception if the module is not
|
|
25
|
-
// installed for some reason. In that case prompts are just not supported.
|
|
26
|
-
resolvedInquirerModule = require('inquirer');
|
|
27
|
-
}
|
|
28
|
-
catch (e) {
|
|
29
|
-
resolvedInquirerModule = null;
|
|
30
|
-
}
|
|
31
|
-
/** Whether prompts are currently supported. */
|
|
32
|
-
function supportsPrompt() {
|
|
33
|
-
return !!resolvedInquirerModule && !!process.stdin.isTTY;
|
|
34
|
-
}
|
|
35
|
-
exports.supportsPrompt = supportsPrompt;
|
|
36
|
-
/**
|
|
37
|
-
* Gets the resolved instance of "inquirer" which can be used to programmatically
|
|
38
|
-
* create prompts.
|
|
39
|
-
*/
|
|
40
|
-
function getInquirer() {
|
|
41
|
-
return resolvedInquirerModule;
|
|
42
|
-
}
|
|
43
|
-
exports.getInquirer = getInquirer;
|
|
44
|
-
});
|
|
45
|
-
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2NoZW1hdGljc19wcm9tcHQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb3JlL3NjaGVtYXRpY3MvdXRpbHMvc2NoZW1hdGljc19wcm9tcHQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HOzs7Ozs7Ozs7Ozs7O0lBSUgsSUFBSSxzQkFBcUMsQ0FBQztJQUUxQyxJQUFJO1FBQ0YseUVBQXlFO1FBQ3pFLDBFQUEwRTtRQUMxRSxvRUFBb0U7UUFDcEUsMEVBQTBFO1FBQzFFLHNCQUFzQixHQUFHLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQztLQUM5QztJQUFDLE9BQU8sQ0FBQyxFQUFFO1FBQ1Ysc0JBQXNCLEdBQUcsSUFBSSxDQUFDO0tBQy9CO0lBRUQsK0NBQStDO0lBQy9DLFNBQWdCLGNBQWM7UUFDNUIsT0FBTyxDQUFDLENBQUMsc0JBQXNCLElBQUksQ0FBQyxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsS0FBSyxDQUFDO0lBQzNELENBQUM7SUFGRCx3Q0FFQztJQUVEOzs7T0FHRztJQUNILFNBQWdCLFdBQVc7UUFDekIsT0FBTyxzQkFBdUIsQ0FBQztJQUNqQyxDQUFDO0lBRkQsa0NBRUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEBsaWNlbnNlXG4gKiBDb3B5cmlnaHQgR29vZ2xlIExMQyBBbGwgUmlnaHRzIFJlc2VydmVkLlxuICpcbiAqIFVzZSBvZiB0aGlzIHNvdXJjZSBjb2RlIGlzIGdvdmVybmVkIGJ5IGFuIE1JVC1zdHlsZSBsaWNlbnNlIHRoYXQgY2FuIGJlXG4gKiBmb3VuZCBpbiB0aGUgTElDRU5TRSBmaWxlIGF0IGh0dHBzOi8vYW5ndWxhci5pby9saWNlbnNlXG4gKi9cblxudHlwZSBJbnF1aXJlciA9IHR5cGVvZiBpbXBvcnQoJ2lucXVpcmVyJyk7XG5cbmxldCByZXNvbHZlZElucXVpcmVyTW9kdWxlOiBJbnF1aXJlcnxudWxsO1xuXG50cnkge1xuICAvLyBcImlucXVpcmVyXCIgaXMgdGhlIHByb21wdCBtb2R1bGUgYWxzbyB1c2VkIGJ5IHRoZSBkZXZraXQgc2NoZW1hdGljcyBDTElcbiAgLy8gaW4gb3JkZXIgdG8gc2hvdyBwcm9tcHRzIGZvciBzY2hlbWF0aWNzLiBXZSB0cmFuc2l0aXZlbHkgZGVwZW5kIG9uIHRoaXNcbiAgLy8gbW9kdWxlLCBidXQgZG9uJ3Qgd2FudCB0byB0aHJvdyBhbiBleGNlcHRpb24gaWYgdGhlIG1vZHVsZSBpcyBub3RcbiAgLy8gaW5zdGFsbGVkIGZvciBzb21lIHJlYXNvbi4gSW4gdGhhdCBjYXNlIHByb21wdHMgYXJlIGp1c3Qgbm90IHN1cHBvcnRlZC5cbiAgcmVzb2x2ZWRJbnF1aXJlck1vZHVsZSA9IHJlcXVpcmUoJ2lucXVpcmVyJyk7XG59IGNhdGNoIChlKSB7XG4gIHJlc29sdmVkSW5xdWlyZXJNb2R1bGUgPSBudWxsO1xufVxuXG4vKiogV2hldGhlciBwcm9tcHRzIGFyZSBjdXJyZW50bHkgc3VwcG9ydGVkLiAqL1xuZXhwb3J0IGZ1bmN0aW9uIHN1cHBvcnRzUHJvbXB0KCk6IGJvb2xlYW4ge1xuICByZXR1cm4gISFyZXNvbHZlZElucXVpcmVyTW9kdWxlICYmICEhcHJvY2Vzcy5zdGRpbi5pc1RUWTtcbn1cblxuLyoqXG4gKiBHZXRzIHRoZSByZXNvbHZlZCBpbnN0YW5jZSBvZiBcImlucXVpcmVyXCIgd2hpY2ggY2FuIGJlIHVzZWQgdG8gcHJvZ3JhbW1hdGljYWxseVxuICogY3JlYXRlIHByb21wdHMuXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiBnZXRJbnF1aXJlcigpOiBJbnF1aXJlciB7XG4gIHJldHVybiByZXNvbHZlZElucXVpcmVyTW9kdWxlITtcbn1cbiJdfQ==
|