json-file.d.ts 829 B

123456789101112131415161718192021222324
  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.dev/license
  7. */
  8. import { JsonValue } from '@angular-devkit/core';
  9. import { Tree } from '@angular-devkit/schematics';
  10. export type InsertionIndex = (properties: string[]) => number;
  11. export type JSONPath = (string | number)[];
  12. /** @private */
  13. export declare class JSONFile {
  14. private readonly host;
  15. private readonly path;
  16. content: string;
  17. private eol;
  18. constructor(host: Tree, path: string);
  19. private _jsonAst;
  20. private get JsonAst();
  21. get(jsonPath: JSONPath): unknown;
  22. modify(jsonPath: JSONPath, value: JsonValue | undefined, insertInOrder?: InsertionIndex | false): void;
  23. remove(jsonPath: JSONPath): void;
  24. }