UNPKG

2.69 kBTypeScriptView Raw
1import type { ParsedConfiguration } from '@angular/compiler-cli';
2import { InjectionToken, Provider } from 'injection-js';
3import { Observable } from 'rxjs';
4import { Transform } from './graph/transform';
5import { NgPackagrOptions } from './ng-package/options.di';
6/**
7 * The original ng-packagr implemented on top of a rxjs-ified and di-jectable transformation pipeline.
8 *
9 * See the `docs/transformations.md` for more prose description.
10 *
11 * @link https://github.com/ng-packagr/ng-packagr/pull/572
12 */
13export declare class NgPackagr {
14 private providers;
15 private buildTransform;
16 constructor(providers: Provider[]);
17 /**
18 * Adds options to ng-packagr
19 *
20 * @param options Ng Packagr Options
21 * @return Self instance for fluent API
22 * @deprecated use the options parameter in 'build' and 'watch' methods
23 */
24 withOptions(options: NgPackagrOptions): NgPackagr;
25 /**
26 * Sets the path to the user's "ng-package" file (either `package.json`, `ng-package.json`, or `ng-package.js`)
27 *
28 * @param project File path
29 * @return Self instance for fluent API
30 */
31 forProject(project: string): NgPackagr;
32 /**
33 * Adds dependency injection providers.
34 *
35 * @param providers
36 * @return Self instance for fluent API
37 * @link https://github.com/mgechev/injection-js
38 */
39 withProviders(providers: Provider[]): NgPackagr;
40 /**
41 * Overwrites the default TypeScript configuration.
42 *
43 * @param defaultValues A tsconfig providing default values to the compilation.
44 * @return Self instance for fluent API
45 */
46 withTsConfig(defaultValues: ParsedConfiguration | string): NgPackagr;
47 /**
48 * Overwrites the 'build' transform.
49 *
50 * @param transform
51 * @return Self instance for fluent API
52 */
53 withBuildTransform(transform: InjectionToken<Transform>): NgPackagr;
54 /**
55 * Builds the project by kick-starting the 'build' transform over an (initially) empty `BuildGraph``
56 *
57 * @return A promisified result of the transformation pipeline.
58 */
59 build(options?: NgPackagrOptions): Promise<void>;
60 /**
61 * Builds and watch for changes by kick-starting the 'watch' transform over an (initially) empty `BuildGraph``
62 *
63 * @return An observable result of the transformation pipeline.
64 */
65 watch(options?: NgPackagrOptions): Observable<void>;
66 /**
67 * Builds the project by kick-starting the 'build' transform over an (initially) empty `BuildGraph``
68 *
69 * @return An observable result of the transformation pipeline.
70 */
71 buildAsObservable(): Observable<void>;
72}
73export declare const ngPackagr: () => NgPackagr;