[6a3a178] | 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 | import { JsonValue } from '../json';
|
---|
| 9 | export interface WorkspaceDefinition {
|
---|
| 10 | readonly extensions: Record<string, JsonValue | undefined>;
|
---|
| 11 | readonly projects: ProjectDefinitionCollection;
|
---|
| 12 | }
|
---|
| 13 | export interface ProjectDefinition {
|
---|
| 14 | readonly extensions: Record<string, JsonValue | undefined>;
|
---|
| 15 | readonly targets: TargetDefinitionCollection;
|
---|
| 16 | root: string;
|
---|
| 17 | prefix?: string;
|
---|
| 18 | sourceRoot?: string;
|
---|
| 19 | }
|
---|
| 20 | export interface TargetDefinition {
|
---|
| 21 | options?: Record<string, JsonValue | undefined>;
|
---|
| 22 | configurations?: Record<string, Record<string, JsonValue | undefined> | undefined>;
|
---|
| 23 | defaultConfiguration?: string;
|
---|
| 24 | builder: string;
|
---|
| 25 | }
|
---|
| 26 | export declare type DefinitionCollectionListener<V extends object> = (name: string, action: 'add' | 'remove' | 'replace', newValue: V | undefined, oldValue: V | undefined, collection: DefinitionCollection<V>) => void;
|
---|
| 27 | declare class DefinitionCollection<V extends object> implements ReadonlyMap<string, V> {
|
---|
| 28 | private _listener?;
|
---|
| 29 | private _map;
|
---|
| 30 | constructor(initial?: Record<string, V>, _listener?: DefinitionCollectionListener<V> | undefined);
|
---|
| 31 | delete(key: string): boolean;
|
---|
| 32 | set(key: string, value: V): this;
|
---|
| 33 | forEach<T>(callbackfn: (value: V, key: string, map: DefinitionCollection<V>) => void, thisArg?: T): void;
|
---|
| 34 | get(key: string): V | undefined;
|
---|
| 35 | has(key: string): boolean;
|
---|
| 36 | get size(): number;
|
---|
| 37 | [Symbol.iterator](): IterableIterator<[string, V]>;
|
---|
| 38 | entries(): IterableIterator<[string, V]>;
|
---|
| 39 | keys(): IterableIterator<string>;
|
---|
| 40 | values(): IterableIterator<V>;
|
---|
| 41 | }
|
---|
| 42 | export declare class ProjectDefinitionCollection extends DefinitionCollection<ProjectDefinition> {
|
---|
| 43 | constructor(initial?: Record<string, ProjectDefinition>, listener?: DefinitionCollectionListener<ProjectDefinition>);
|
---|
| 44 | add(definition: {
|
---|
| 45 | name: string;
|
---|
| 46 | root: string;
|
---|
| 47 | sourceRoot?: string;
|
---|
| 48 | prefix?: string;
|
---|
| 49 | targets?: Record<string, TargetDefinition | undefined>;
|
---|
| 50 | [key: string]: unknown;
|
---|
| 51 | }): ProjectDefinition;
|
---|
| 52 | set(name: string, value: ProjectDefinition): this;
|
---|
| 53 | private _validateName;
|
---|
| 54 | }
|
---|
| 55 | export declare class TargetDefinitionCollection extends DefinitionCollection<TargetDefinition> {
|
---|
| 56 | constructor(initial?: Record<string, TargetDefinition>, listener?: DefinitionCollectionListener<TargetDefinition>);
|
---|
| 57 | add(definition: {
|
---|
| 58 | name: string;
|
---|
| 59 | } & TargetDefinition): TargetDefinition;
|
---|
| 60 | set(name: string, value: TargetDefinition): this;
|
---|
| 61 | private _validateName;
|
---|
| 62 | }
|
---|
| 63 | export {};
|
---|