# calendarSyncStore

Source: https://developer.nylas.com/docs/v3/components/notetaker-api/calendarsync-store/

## `calendarSyncStore`

> **Info:** 
> **This interface describes a [**Zustand**](https://zustand.docs.pmnd.rs/getting-started/introduction) store, an advanced state management React solution**. This is intended for advanced use only – the Notetaker components will work without using this store directly.

The interface for the `CalendarSync` component state store. `calendarSyncStore` manages all form data and UI state information for the component.

```tsx


export default function App() {
  const store = calendarSyncStore();
  useEffect(() => {
    store.setName("ExampleName");
  }, []);

  return (
    <div>
      
    </div>
  );
}
```

### `calendarSyncStore` properties

#### `advancedSettings`

|                 |                                        |
| --------------- | -------------------------------------- |
| **Description** | Display the Advanced Settings section. |
| **Type**        | `boolean`                              |
| **Default**     | `false`                                |

<br />

#### `calendar`

|                 |                      |
| --------------- | -------------------- |
| **Description** | The synced calendar. |
| **Type**        | `null` \| `Calendar` |

<br />

#### `getCalendar`

|                 |                                                                                          |
| --------------- | ---------------------------------------------------------------------------------------- |
| **Description** | Fetches calendar data from the Nylas Calendar API.                                       |
| **Type**        | `(calendarId: string, grantId: string, fallbackNotetakerName?: string) => Promise<void>` |

<br />

#### `handleCancel`

|                 |                                                                  |
| --------------- | ---------------------------------------------------------------- |
| **Description** | Cancels changes and resets to original values.                   |
| **Type**        | `(notetakerName?: string, onCancelCallback?: () => ...) => void` |

<br />

#### `handleDisable`

|                 |                                                                                                                                                                                          |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Description** | Disables Notetaker for the synced calendar.                                                                                                                                              |
| **Type**        | `(calendarId: string, grantId: string, fallbackNotetakerName?: string,`<br/>`onUpdate?: (data: ...) => ..., onError?: (error: ...) => ...,`<br/>`onCancel?: () => ...) => Promise<void>` |

<br />

#### `handleSave`

|                 |                                                                                                                              |
| --------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **Description** | Saves Notetaker settings for the synced calendar.                                                                            |
| **Type**        | `(calendarId: string, grantId: string, onUpdate?: (data: ...) => ...,`<br/>`onError?: (error: ...) => ...) => Promise<void>` |

<br />

#### `hasChanges`

|                 |                                       |
| --------------- | ------------------------------------- |
| **Description** | Indicates that the user made changes. |
| **Type**        | `boolean`                             |
| **Default**     | `false`                               |

<br />

#### `isLoading`

|                 |                                          |
| --------------- | ---------------------------------------- |
| **Description** | Indicates that the component is loading. |
| **Type**        | `boolean`                                |
| **Default**     | `false`                                  |

<br />

#### `name`

|                 |                                 |
| --------------- | ------------------------------- |
| **Description** | The name for the calendar sync. |
| **Type**        | `string`                        |

<br />

#### `reset`

|                 |                                                               |
| --------------- | ------------------------------------------------------------- |
| **Description** | Resets the store and all form fields to their default values. |
| **Type**        | `() => void`                                                  |

<br />

#### `selectedFilters`

|                 |                                     |
| --------------- | ----------------------------------- |
| **Description** | A list of selected meeting filters. |
| **Type**        | `MeetingFilter[]`                   |

<br />

#### `selectedRecordingTypes`

|                 |                                                                   |
| --------------- | ----------------------------------------------------------------- |
| **Description** | A list of selected recording types (video, audio, or transcript). |
| **Type**        | `RecordingType[]`                                                 |

<br />

#### `setAdvancedSettings`

|                 |                                                       |
| --------------- | ----------------------------------------------------- |
| **Description** | Sets the visibility of the Advanced Settings section. |
| **Type**        | `(show: boolean) => void`                             |

<br />

#### `setCalendar`

|                 |                                        |
| --------------- | -------------------------------------- |
| **Description** | Sets the calendar.                     |
| **Type**        | `(calendar: null \| Calendar) => void` |

<br />

#### `setHasChanges`

|                 |                                     |
| --------------- | ----------------------------------- |
| **Description** | Sets whether the user made changes. |
| **Type**        | `(hasChanges: boolean) => void`     |

<br />

#### `setIsLoading`

|                 |                                |
| --------------- | ------------------------------ |
| **Description** | Sets the loading state.        |
| **Type**        | `(isLoading: boolean) => void` |

<br />

#### `setName`

|                 |                                      |
| --------------- | ------------------------------------ |
| **Description** | Sets the name for the calendar sync. |
| **Type**        | `(name: string) => void`             |

<br />

#### `setSelectedFilters`

|                 |                                      |
| --------------- | ------------------------------------ |
| **Description** | Sets the selected meeting filters.   |
| **Type**        | `(filters: MeetingFilter[]) => void` |

<br />

#### `setSelectedRecordingTypes`

|                 |                                    |
| --------------- | ---------------------------------- |
| **Description** | Sets the selected recording types. |
| **Type**        | `(types: RecordingType[]) => void` |

<br />

#### `toggleMeetingFilter`

|                 |                                                 |
| --------------- | ----------------------------------------------- |
| **Description** | Toggles the specified meeting filter on or off. |
| **Type**        | `(filter: MeetingFilter) => void`               |

<br />

#### `toggleRecordingType`

|                 |                                                 |
| --------------- | ----------------------------------------------- |
| **Description** | Toggles the specified recording type on or off. |
| **Type**        | `(type: RecordingType) => void`                 |