### Hierarchy

- AtomWindowViewModel
  - MockConfirmViewModel

## Index

### Constructors

- constructor

### Properties

- app
- closeWarning
- message
- postInit
- title
- windowName

### Accessors

- errors
- isReady
- isValid
- parent

### Methods

- bind
- cancel
- close
- dispose
- init
- onPropertyChanged
- onReady
- refresh
- registerDisposable
- resetValidations
- runAfterInit
- setupWatch

## Constructors

### constructor

- new MockConfirmViewModel(app: App): MockConfirmViewModel

- Inherited from AtomViewModel.constructor

  - Defined in view-model/AtomViewModel.ts:144

  #### Parameters

  - ##### app: App

  #### Returns MockConfirmViewModel

## Properties

### app

app: App

Inherited from AtomViewModel.app

- Defined in view-model/AtomViewModel.ts:146

### closeWarning

closeWarning: string

Inherited from AtomWindowViewModel.closeWarning

- Defined in view-model/AtomWindowViewModel.ts:50

### message

message: string

- Defined in services/MockNavigationService.ts:19

### postInit

postInit: Function[]

Inherited from AtomViewModel.postInit

- Defined in view-model/AtomViewModel.ts:72

### title

title: string

Overrides AtomWindowViewModel.title

- Defined in services/MockNavigationService.ts:20

### windowName

windowName: string

Inherited from AtomWindowViewModel.windowName

- Defined in view-model/AtomWindowViewModel.ts:64

windowName will be set to generated html tag id, you can use this to mock AtomWindowViewModel in testing.

When window is closed or cancelled, view model only broadcasts `atom-window-close:${this.windowName}`, you can listen for such message.

type

  {string}

memberof

  AtomWindowViewModel

## Accessors

### errors

- get errors(): Array<object>

- Inherited from AtomViewModel.errors

  - Defined in view-model/AtomViewModel.ts:84

  #### Returns Array<object>

### isReady

- get isReady(): boolean

- Inherited from AtomViewModel.isReady

  - Defined in view-model/AtomViewModel.ts:80

  #### Returns boolean

### isValid

- get isValid(): boolean

- Inherited from AtomViewModel.isValid

  - Defined in view-model/AtomViewModel.ts:123

  #### Returns boolean

### parent

- get parent(): AtomViewModel
- set parent(v: AtomViewModel): void

- Inherited from AtomViewModel.parent

  - Defined in view-model/AtomViewModel.ts:104

  #### Returns AtomViewModel

- Inherited from AtomViewModel.parent

  - Defined in view-model/AtomViewModel.ts:107

  #### Parameters

  - ##### v: AtomViewModel

  #### Returns void

## Methods

### bind

- bind(target: any, propertyName: string, source: any, path: string[][], twoWays?: IValueConverter | function): IDisposable

- Inherited from AtomViewModel.bind

  - Defined in view-model/AtomViewModel.ts:186

  Binds source property to target property with optional two ways

  #### Parameters

  - ##### target: any

    target whose property will be set

  - ##### propertyName: string

    name of target property

  - ##### source: any

    source to read property from

  - ##### path: string[][]

    property path of source

  - ##### Optional twoWays: IValueConverter | function

    optional, two ways IValueConverter

  #### Returns IDisposable

### cancel

- cancel(): Promise<boolean>

- Inherited from AtomWindowViewModel.cancel

  - Defined in view-model/AtomWindowViewModel.ts:83

  This will return true if this view model is safe to cancel and close

  #### Returns Promise<boolean>

### close

- close(result?: any): void

- Inherited from AtomWindowViewModel.close

  - Defined in view-model/AtomWindowViewModel.ts:76

  This will broadcast `atom-window-close:windowName`. WindowService will close the window on receipt of such message and it will resolve the promise with given result.

       this.close(someResult);

  memberof

    AtomWindowViewModel

  #### Parameters

  - ##### Optional result: any

  #### Returns void

### dispose

- dispose(): void

- Inherited from AtomViewModel.dispose

  - Defined in view-model/AtomViewModel.ts:225

  dispose method will be called when attached view will be disposed or when a new view model will be assigned to view, old view model will be disposed.

  memberof

    AtomViewModel

  #### Returns void

### init

- init(): Promise<any>

- Inherited from AtomViewModel.init

  - Defined in view-model/AtomViewModel.ts:216

  Put your asynchronous initialization here

  memberof

    AtomViewModel

  #### Returns Promise<any>

### Protected onPropertyChanged

- onPropertyChanged(name: string): void

- Inherited from AtomViewModel.onPropertyChanged

  - Defined in view-model/AtomViewModel.ts:293

  #### Parameters

  - ##### name: string

  #### Returns void

### Protected onReady

- onReady(): void

- Inherited from AtomViewModel.onReady

  - Defined in view-model/AtomViewModel.ts:255

  #### Returns void

### refresh

- refresh(name: string): void

- Inherited from AtomViewModel.refresh

  - Defined in view-model/AtomViewModel.ts:205

  Refreshes bindings associated with given property name

  #### Parameters

  - ##### name: string

    name of property

  #### Returns void

### Protected registerDisposable

- registerDisposable(d: IDisposable): IDisposable

- Inherited from AtomViewModel.registerDisposable

  - Defined in view-model/AtomViewModel.ts:249

  Register a disposable to be disposed when view model will be disposed.

  memberof

    AtomViewModel

  #### Parameters

  - ##### d: IDisposable

  #### Returns IDisposable

### resetValidations

- resetValidations(resetChildren?: boolean): void

- Inherited from AtomViewModel.resetValidations

  - Defined in view-model/AtomViewModel.ts:154

  Resets validations and all errors are removed.

  #### Parameters

  - ##### Default value resetChildren: boolean = true

    reset child view models as well. Default is true.

  #### Returns void

### runAfterInit

- runAfterInit(f: function): void

- Inherited from AtomViewModel.runAfterInit

  - Defined in view-model/AtomViewModel.ts:170

  Runs function after initialization is complete.

  #### Parameters

  - ##### f: function

    function to execute

    - - (): void

      - #### Returns void

### Protected setupWatch

- setupWatch(ft: string[][] | function, proxy?: function, forValidation?: boolean, name?: string): IDisposable

- Inherited from AtomViewModel.setupWatch

  - Defined in view-model/AtomViewModel.ts:275

  Execute given expression whenever any bindable expression changes in the expression.

  For correct generic type resolution, target must always be `this`.

       this.setupWatch(() => {
           if(!this.data.fullName){
               this.data.fullName = `${this.data.firstName} ${this.data.lastName}`;
           }
       });

  template

    T

  memberof

    AtomViewModel

  #### Parameters

  - ##### ft: string[][] | function

  - ##### Optional proxy: function

    - - (...v: any[]): void

      - #### Parameters

        - ##### Rest ...v: any[]

        #### Returns void

  - ##### Optional forValidation: boolean

  - ##### Optional name: string

  #### Returns IDisposable

Generated using TypeDoc