# Type Aliases

The following type aliases are available globally.

### XcodeDataModelFileName

- `XcodeDataModelFileName`

  A `String` that pertains to the name of an *.xcdatamodeld file (without the file extension).

  #### Declaration

  Swift

      public typealias XcodeDataModelFileName = String

### ModelConfiguration

- `ModelConfiguration`

  An `Optional<String>` that pertains to the name of a “Configuration” which particular groups of entities may belong to. When `nil`, pertains to the default configuration which includes all entities.

  #### Declaration

  Swift

      public typealias ModelConfiguration = String?

### ModelVersion

- `ModelVersion`

  An `String` that pertains to the name of a versioned *.xcdatamodeld file (without the file extension). Model version strings don’t necessarily have to be numeric or ordered in any way. The migration sequence will always be decided by (or the lack of) the `MigrationChain`.

  #### Declaration

  Swift

      public typealias ModelVersion = String

### EntityName

- `EntityName`

  An `String` that pertains to an Entity name.

  #### Declaration

  Swift

      public typealias EntityName = String

### ClassName

- `ClassName`

  An `String` that pertains to a dynamically-accessable class name (usable with NSClassFromString(…)).

  #### Declaration

  Swift

      public typealias ClassName = String

### KeyPathString

- `KeyPathString`

  An `String` that pertains to a attribute keyPaths.

  #### Declaration

  Swift

      public typealias KeyPathString = String

### MigrationResult

- `MigrationResult`

  The `MigrationResult` indicates the result of a migration. `MigrationResult.success` indicates either the migration succeeded, or there were no migrations needed. The associated value is an array of `MigrationType`s reflecting the migration steps completed. `MigrationResult.failure` indicates that the migration failed. The associated object for this value is the a `CoreStoreError` enum value.

      dataStack.upgradeStorageIfNeeded(SQLiteStorage(fileName: "data.sqlite")) { (result) in
          switch result {
          case .success(let migrationSteps):
              // ...
          case .failure(let error):
              // ...
          }
      }

  #### Declaration

  Swift

      public typealias MigrationResult = Swift.Result<[MigrationType], CoreStoreError>

### SetupResult

- `SetupResult`

  The `SetupResult` indicates the result of an asynchronous initialization of a persistent store. `SetupResult.success` indicates that the storage setup succeeded. The associated object for this `enum` value is the related `StorageInterface` instance. `SetupResult.failure` indicates that the storage setup failed. The associated object for this value is the related `CoreStoreError` enum value.

      try! dataStack.addStorage(
          SQLiteStore(),
          completion: { (result: SetupResult) -> Void in
              switch result {
              case .success(let storage):
                  // storage is the related StorageInterface instance
              case .failure(let error):
                  // error is the CoreStoreError enum value for the failure
              }
          }
      )

  #### Declaration

  Swift

      public typealias SetupResult<StorageInterfaceType> = Swift.Result<StorageInterfaceType, CoreStoreError> where StorageInterfaceType : StorageInterface