UNPKG

2.56 kBTypeScriptView Raw
1import { InjectionToken, Provider } from 'injection-js';
2import { ParsedConfiguration } from '@angular/compiler-cli';
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 */
23 withOptions(options: NgPackagrOptions): NgPackagr;
24 /**
25 * Sets the path to the user's "ng-package" file (either `package.json`, `ng-package.json`, or `ng-package.js`)
26 *
27 * @param project File path
28 * @return Self instance for fluent API
29 */
30 forProject(project: string): NgPackagr;
31 /**
32 * Adds dependency injection providers.
33 *
34 * @param providers
35 * @return Self instance for fluent API
36 * @link https://github.com/mgechev/injection-js
37 */
38 withProviders(providers: Provider[]): NgPackagr;
39 /**
40 * Overwrites the default TypeScript configuration.
41 *
42 * @param defaultValues A tsconfig providing default values to the compilation.
43 * @return Self instance for fluent API
44 */
45 withTsConfig(defaultValues: ParsedConfiguration | string): NgPackagr;
46 /**
47 * Overwrites the 'build' transform.
48 *
49 * @param transform
50 * @return Self instance for fluent API
51 */
52 withBuildTransform(transform: InjectionToken<Transform>): NgPackagr;
53 /**
54 * Builds the project by kick-starting the 'build' transform over an (initially) empty `BuildGraph``
55 *
56 * @return A promisified result of the transformation pipeline.
57 */
58 build(): Promise<void>;
59 /**
60 * Builds and watch for changes by kick-starting the 'watch' transform over an (initially) empty `BuildGraph``
61 *
62 * @return An observable result of the transformation pipeline.
63 */
64 watch(): Observable<void>;
65 /**
66 * Builds the project by kick-starting the 'build' transform over an (initially) empty `BuildGraph``
67 *
68 * @return An observable result of the transformation pipeline.
69 */
70 buildAsObservable(): Observable<void>;
71}
72export declare const ngPackagr: () => NgPackagr;