source: trip-planner-front/node_modules/@angular-devkit/architect/src/internal.d.ts@ 188ee53

Last change on this file since 188ee53 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 3.0 KB
Line 
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 */
8import { experimental, json } from '@angular-devkit/core';
9import { BuilderInfo, BuilderInput, BuilderOutput, Target } from './api';
10/**
11 * BuilderSymbol used for knowing if a function was created using createBuilder(). This is a
12 * property set on the function that should be `true`.
13 * Using Symbol.for() as it's a global registry that's the same for all installations of
14 * Architect (if some libraries depends directly on architect instead of sharing the files).
15 */
16export declare const BuilderSymbol: unique symbol;
17/**
18 * BuilderVersionSymbol used for knowing which version of the library createBuilder() came from.
19 * This is to make sure we don't try to use an incompatible builder.
20 * Using Symbol.for() as it's a global registry that's the same for all installations of
21 * Architect (if some libraries depends directly on architect instead of sharing the files).
22 */
23export declare const BuilderVersionSymbol: unique symbol;
24/**
25 * A Specialization of the JobHandler type. This exposes BuilderDescription as the job description
26 * type.
27 */
28export declare type BuilderJobHandler<A extends json.JsonObject = json.JsonObject, I extends BuilderInput = BuilderInput, O extends BuilderOutput = BuilderOutput> = experimental.jobs.JobHandler<A, I, O> & {
29 jobDescription: BuilderDescription;
30};
31/**
32 * A Builder description, which is used internally. Adds the builder info which is the
33 * metadata attached to a builder in Architect.
34 */
35export interface BuilderDescription extends experimental.jobs.JobDescription {
36 info: BuilderInfo;
37}
38/**
39 * A Builder instance. Use createBuilder() to create one of these.
40 */
41export interface Builder<OptionT extends json.JsonObject = json.JsonObject> {
42 handler: experimental.jobs.JobHandler<json.JsonObject, BuilderInput, BuilderOutput>;
43 [BuilderSymbol]: true;
44 [BuilderVersionSymbol]: string;
45}
46export interface ArchitectHost<BuilderInfoT extends BuilderInfo = BuilderInfo> {
47 /**
48 * Get the builder name for a target.
49 * @param target The target to inspect.
50 */
51 getBuilderNameForTarget(target: Target): Promise<string | null>;
52 /**
53 * Resolve a builder. This needs to return a string which will be used in a dynamic `import()`
54 * clause. This should throw if no builder can be found. The dynamic import will throw if
55 * it is unsupported.
56 * @param builderName The name of the builder to be used.
57 * @returns All the info needed for the builder itself.
58 */
59 resolveBuilder(builderName: string): Promise<BuilderInfoT | null>;
60 loadBuilder(info: BuilderInfoT): Promise<Builder | null>;
61 getCurrentDirectory(): Promise<string>;
62 getWorkspaceRoot(): Promise<string>;
63 getOptionsForTarget(target: Target): Promise<json.JsonObject | null>;
64 getProjectMetadata(projectName: string): Promise<json.JsonObject | null>;
65 getProjectMetadata(target: Target): Promise<json.JsonObject | null>;
66}
Note: See TracBrowser for help on using the repository browser.