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 { JsonAstArray, JsonAstKeyValue, JsonAstNode, JsonAstObject, JsonValue } from '../../json';
|
---|
9 | import { ProjectDefinition, TargetDefinition, WorkspaceDefinition } from '../definitions';
|
---|
10 | export declare const JsonWorkspaceSymbol: unique symbol;
|
---|
11 | export interface JsonWorkspaceDefinition extends WorkspaceDefinition {
|
---|
12 | [JsonWorkspaceSymbol]: JsonWorkspaceMetadata;
|
---|
13 | }
|
---|
14 | interface ChangeValues {
|
---|
15 | json: JsonValue;
|
---|
16 | project: ProjectDefinition;
|
---|
17 | target: TargetDefinition;
|
---|
18 | projectcollection: Iterable<[string, ProjectDefinition]>;
|
---|
19 | targetcollection: Iterable<[string, TargetDefinition]>;
|
---|
20 | }
|
---|
21 | export interface JsonChange<T extends keyof ChangeValues = keyof ChangeValues> {
|
---|
22 | op: T extends 'json' | 'project' | 'target' ? 'add' | 'remove' | 'replace' : 'add';
|
---|
23 | path: string;
|
---|
24 | node: JsonAstNode | JsonAstKeyValue;
|
---|
25 | value?: ChangeValues[T];
|
---|
26 | type: T;
|
---|
27 | }
|
---|
28 | export declare class JsonWorkspaceMetadata {
|
---|
29 | readonly filePath: string;
|
---|
30 | readonly ast: JsonAstObject;
|
---|
31 | readonly raw: string;
|
---|
32 | readonly changes: JsonChange[];
|
---|
33 | constructor(filePath: string, ast: JsonAstObject, raw: string);
|
---|
34 | get hasChanges(): boolean;
|
---|
35 | get changeCount(): number;
|
---|
36 | findChangesForPath(path: string): JsonChange[];
|
---|
37 | addChange<T extends keyof ChangeValues = keyof ChangeValues>(op: 'add' | 'remove' | 'replace', path: string, node: JsonAstArray | JsonAstObject | JsonAstKeyValue, value?: ChangeValues[T], type?: T): void;
|
---|
38 | reset(): void;
|
---|
39 | }
|
---|
40 | export {};
|
---|