API Class for manipulating config layers.

### Hierarchy

- ConfigApi
  - ConfigLayers

## Index

### Constructors

- constructor

### Properties

- mConfig

### Methods

- activate
- find
- get
- merge
- read
- set
- write

## Constructors

### constructor

- new ConfigLayers(mConfig: Config): ConfigLayers

- Inherited from ConfigApi.constructor

  - Defined in @zowe/imperative/src/config/src/api/ConfigApi.ts:17

  #### Parameters

  - ##### mConfig: Config

  #### Returns ConfigLayers

## Properties

### Protected mConfig

mConfig: Config

Inherited from ConfigApi.mConfig

- Defined in @zowe/imperative/src/config/src/api/ConfigApi.ts:18

## Methods

### activate

- activate(user: boolean, global: boolean, inDir?: string): void

- - Defined in @zowe/imperative/src/config/src/api/ConfigLayers.ts:110

  Select which layer is the currently active layer.

  #### Parameters

  - ##### user: boolean

    True if you want the user layer.

  - ##### global: boolean

    True if you want the global layer.

  - ##### Optional inDir: string

    The directory to which you want to set the file path for this layer.

  #### Returns void

### find

- find(profileName: string): { global: boolean; user: boolean }

- - Defined in @zowe/imperative/src/config/src/api/ConfigLayers.ts:209

  Finds the highest priority layer where a profile is stored.

  #### Parameters

  - ##### profileName: string

    Profile name to search for

  #### Returns { global: boolean; user: boolean }

  User and global properties, or undefined if profile does not exist

  - ##### global: boolean

  - ##### user: boolean

### get

- get(): IConfigLayer

- - Defined in @zowe/imperative/src/config/src/api/ConfigLayers.ts:131

  Gets a json object that represents the currently active layer.

  #### Returns IConfigLayer

  The json object

### merge

- merge(cnfg: IConfig, dryRun?: boolean): void | IConfigLayer

- - Defined in @zowe/imperative/src/config/src/api/ConfigLayers.ts:164

  Merge properties from the supplied Config object into the active layer. If dryRun is specified, merge is applied to a copy of the layer and returned. If dryRun is not specified, merge is applied directly to the layer and nothing is returned.

  #### Parameters

  - ##### cnfg: IConfig

    The Config object to merge.

  - ##### Default value dryRun: boolean = false

  #### Returns void | IConfigLayer

  The merged config layer or void

### read

- read(opts?: { global: boolean; ignoreErrors?: boolean; user: boolean }): void

- - Defined in @zowe/imperative/src/config/src/api/ConfigLayers.ts:35

  Read a config layer from disk into memory for application use.

  #### Parameters

  - ##### Optional opts: { global: boolean; ignoreErrors?: boolean; user: boolean }

    The user and global flags that indicate which of the four config files (aka layers) is to be read.

    - ##### global: boolean

    - ##### Optional ignoreErrors?: boolean

    - ##### user: boolean

  #### Returns void

### set

- set(cnfg: IConfig): void

- - Defined in @zowe/imperative/src/config/src/api/ConfigLayers.ts:144

  Set the the currently active layer to the supplied json object.

  #### Parameters

  - ##### cnfg: IConfig

  #### Returns void

### write

- write(opts?: { global: boolean; user: boolean }): void

- - Defined in @zowe/imperative/src/config/src/api/ConfigLayers.ts:82

  Write a config layer to disk.

  #### Parameters

  - ##### Optional opts: { global: boolean; user: boolean }

    The user and global flags that indicate which of the four config files (aka layers) is to be written.

    - ##### global: boolean

    - ##### user: boolean

  #### Returns void

Generated using TypeDoc