UNPKG

2.32 kBTypeScriptView Raw
1import { AppEnvironments } from '@ioc:Adonis/Core/Application';
2import { JsonFile } from '../Formats/Json';
3/**
4 * Exposes API to mutate the contents of `.adonisrc.json` file.
5 */
6export declare class AdonisRcFile extends JsonFile {
7 /**
8 * Storing a local copy of preloads for concatenating
9 * new entries.
10 */
11 private preloads;
12 /**
13 * Storing a local copy of metaFiles for concatenating
14 * new entries.
15 */
16 private metaFiles;
17 /**
18 * Storing a local copy of commands for concatenating
19 * new entries.
20 */
21 private commands;
22 /**
23 * Storing a local copy of providers for concatenating
24 * new entries.
25 */
26 private providers;
27 /**
28 * Storing a local copy of aceProviders for concatenating
29 * new entries.
30 */
31 private aceProviders;
32 /**
33 * Storing a local copy of testProviders for concatenating
34 * new entries.
35 */
36 private testProviders;
37 constructor(basePath: string);
38 /**
39 * Handle `preloads` in a custom way on rollback, since the `mrm-core` uses
40 * `lodash.unset` which replaces the array index value with `null` and
41 * we instead want to remove the index value completely.
42 */
43 onset(lifecycle: string, body: any): true | undefined;
44 /**
45 * Set the exception handler namespace.
46 */
47 setExceptionHandler(namespace: string): this;
48 /**
49 * Set the preload file to the `.adonisrc.json` file.
50 */
51 setPreload(filePath: string, environment?: AppEnvironments[], optional?: boolean): this;
52 /**
53 * Set IoC container aliases
54 */
55 setAlias(namespace: string, autoloadPath: string): this;
56 /**
57 * Set custom directory
58 */
59 setDirectory(key: string, value: string): this;
60 /**
61 * Add custom file to `metaFiles` array.
62 */
63 addMetaFile(filePath: string, reloadServer?: boolean): void;
64 /**
65 * Add new commands to the commands array
66 */
67 addCommand(commandPath: string): void;
68 /**
69 * Add new providers to the providers array
70 */
71 addProvider(provider: string): void;
72 /**
73 * Add new providers to the ace providers array
74 */
75 addAceProvider(provider: string): void;
76 /**
77 * Add new providers to the test providers array
78 */
79 addTestProvider(provider: string): void;
80}