UNPKG

839 BTypeScriptView 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 { JsonValue } from '@angular-devkit/core';
9export declare type InsertionIndex = (properties: string[]) => number;
10export declare type JSONPath = (string | number)[];
11/** @internal */
12export declare class JSONFile {
13 private readonly path;
14 content: string;
15 constructor(path: string);
16 private _jsonAst;
17 private get JsonAst();
18 get(jsonPath: JSONPath): unknown;
19 modify(jsonPath: JSONPath, value: JsonValue | undefined, insertInOrder?: InsertionIndex | false): boolean;
20 save(): void;
21}
22export declare function readAndParseJson(path: string): any;
23export declare function parseJson(content: string): any;