<commit_before>//
//  ModelAdapter.swift
//  Pods-CoreDataExample
//
//  Created by <NAME> on 25/04/2019.
//

import Foundation
import CloudKit

/// The merge policy to resolve change conflicts. Default value is `server`
@objc public enum MergePolicy: Int {
    
    // Downloaded changes have preference.
    case server
    // Local changes have preference.
    case client
    // Delegate can resolve changes manually.
    case custom
}

public extension Notification.Name {
    
    /// Sent by the model adapter when it detects changes to some objects. The notification is sent only once, if there were no changes before and new changes were detected.
    static let ModelAdapterHasChangesNotification = Notification.Name("QSModelAdapterHasChangesNotification")
}

@objc public extension NSNotification {
    
    /// /// Sent by the model adapter when it detects changes to some objects. The notification is sent only once, if there were no changes before and new changes were detected.
    static let ModelAdapterHasChangesNotification: NSString = "QSModelAdapterHasChangesNotification"
}

/// An object conforming to `ModelAdapter` will track the local model, provide changes to upload to CloudKit and import downloaded changes.
@objc public protocol ModelAdapter: class {
    
    /// Whether the model has any changes
    var hasChanges: Bool { get }
    
    /// Tells the model adapter that an import operation will begin<commit_msg>ModelAdapter comment for doc generation<commit_after>//
//  ModelAdapter.swift
//  Pods-CoreDataExample
//
//  Created by <NAME> on 25/04/2019.
//

import Foundation
import CloudKit

/// The merge policy to resolve change conflicts. Default value is `server`
@objc public enum MergePolicy: Int {
    
    /// Downloaded changes have preference.
    case server
    /// Local changes have preference.
    case client
    /// Delegate can resolve changes manually.
    case custom
}

public extension Notification.Name {
    
    /// Sent by the model adapter when it detects changes to some objects. The notification is sent only once, if there were no changes before and new changes were detected.
    static let ModelAdapterHasChangesNotification = Notification.Name("QSModelAdapterHasChangesNotification")
}

@objc public extension NSNotification {
    
    /// /// Sent by the model adapter when it detects changes to some objects. The notification is sent only once, if there were no changes before and new changes were detected.
    static let ModelAdapterHasChangesNotification: NSString = "QSModelAdapterHasChangesNotification"
}

/// An object conforming to `ModelAdapter` will track the local model, provide changes to upload to CloudKit and import downloaded changes.
@objc public protocol ModelAdapter: class {
    
    /// Whether the model has any changes
    var hasChanges: Bool { get }
    
    /// Tells the model adapter that an import operation will begin
{'fraction_non_alphanumeric': 0.06337786913326482, 'fraction_numerical': 0.005481329222336417, 'mean_word_length': 3.3582089552238807, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2488075', 'n_tokens_mistral': 724, 'n_tokens_neox': 685, 'n_words': 335}