UNPKG

2.06 kBTypeScriptView Raw
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 { json, workspaces } from '@angular-devkit/core';
9import { PackageManager } from '../../lib/config/workspace-schema';
10import { JSONFile } from './json-file';
11export declare const workspaceSchemaPath: string;
12export declare class AngularWorkspace {
13 private readonly workspace;
14 readonly filePath: string;
15 readonly basePath: string;
16 constructor(workspace: workspaces.WorkspaceDefinition, filePath: string);
17 get extensions(): Record<string, json.JsonValue | undefined>;
18 get projects(): workspaces.ProjectDefinitionCollection;
19 getCli(): Record<string, any> | undefined;
20 getProjectCli(projectName: string): Record<string, any> | undefined;
21 save(): Promise<void>;
22 static load(workspaceFilePath: string): Promise<AngularWorkspace>;
23}
24export declare function getWorkspace(level: 'global'): Promise<AngularWorkspace>;
25export declare function getWorkspace(level: 'local'): Promise<AngularWorkspace | undefined>;
26export declare function getWorkspace(level: 'local' | 'global'): Promise<AngularWorkspace | undefined>;
27/**
28 * This method will load the workspace configuration in raw JSON format.
29 * When `level` is `global` and file doesn't exists, it will be created.
30 *
31 * NB: This method is intended to be used only for `ng config`.
32 */
33export declare function getWorkspaceRaw(level?: 'local' | 'global'): Promise<[JSONFile | null, string | null]>;
34export declare function validateWorkspace(data: json.JsonObject, isGlobal: boolean): Promise<void>;
35export declare function getProjectByCwd(workspace: AngularWorkspace): string | null;
36export declare function getConfiguredPackageManager(): Promise<PackageManager | null>;
37export declare function getSchematicDefaults(collection: string, schematic: string, project?: string | null): Promise<{}>;
38export declare function isWarningEnabled(warning: string): Promise<boolean>;