text: // @flow
  /* eslint-disable */
  
  // This file is auto-generated by client/protocol/Makefile.
  import * as Gregor1 from './rpc-gregor-gen'
  import * as Keybase1 from './rpc-gen'
  import engine, {EngineChannel} from '../../engine'
  import type {Boolean, Bool, Bytes, Double, Int, Int64, Long, String, Uint, Uint64, WaitingHandlerType, RPCErrorHandler, CommonResponseHandler, RPCError} from '../../engine/types'
  
  export const chatUiMessageUnboxedState = {
    valid: 1,
    error: 2,
    outbox: 3,
    placeholder: 4,
  }
  
  export const commonConversationExistence = {
    active: 0,
    archived: 1,
    deleted: 2,
    abandoned: 3,
  }
  
  export const commonConversationMemberStatus = {
    active: 0,
    removed: 1,
    left: 2,
    preview: 3,
    reset: 4,
  }
  
  export const commonConversationMembersType = {
    kbfs: 0,
    team: 1,
    impteamnative: 2,
    impteamupgrade: 3,
  }
  
  export const commonConversationStatus = {
    unfiled: 0,
    favorite: 1,
    ignored: 2,
    blocked: 3,
    muted: 4,
    reported: 5,
  }
  
  export const commonGlobalAppNotificationSetting = {
    newmessages: 0,
    plaintextmobile: 1,
    plaintextdesktop: 2,
  }
  
  export const commonInboxResType = {
    versionhit: 0,
    full: 1,
  }
  
  export const commonMessageType = {
    none: 0,
    text: 1,
    attachment: 2,
    edit: 3,
    delete: 4,
    metadata: 5,
    tlfname: 6,
    headline: 7,
    attachmentuploaded: 8,
    join: 9,
    leave: 10,
    system: 11,
    deletehistory: 12,
  }
  
  export const commonNotificationKind = {
    generic: 0,
    atmention: 1,
  }
  
  export const commonRetentionPolicyType = {
    none: 0,
    retain: 1,
    expire: 2,
    inherit: 3,
  }
  
  export const commonSyncInboxResType = {
    current: 0,
    incremental: 1,
    clear: 2,
  }
  
  export const commonTeamType = {
    none: 0,
    simple: 1,
    complex: 2,
  }
  
  export const commonTopicType = {
    none: 0,
    chat: 1,
    dev: 2,
  }
  
  export const localAddTeamMemberAfterResetRpcChannelMap = (configKeys: Array<string>, request: LocalAddTeamMemberAfterResetRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.addTeamMemberAfterReset', request)
  
  export const localAddTeamMemberAfterResetRpcPromise = (request: LocalAddTeamMemberAfterResetRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.addTeamMemberAfterReset', request, (error: RPCError, result: void) => (error ? reject(error) : resolve())))
  
  export const localAssetMetadataType = {
    none: 0,
    image: 1,
    video: 2,
    audio: 3,
  }
  
  export const localAssetTag = {
    primary: 0,
  }
  
  export const localBodyPlaintextVersion = {
    v1: 1,
    v2: 2,
    v3: 3,
    v4: 4,
    v5: 5,
    v6: 6,
    v7: 7,
    v8: 8,
    v9: 9,
    v10: 10,
  }
  
  export const localCancelPostRpcChannelMap = (configKeys: Array<string>, request: LocalCancelPostRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.CancelPost', request)
  
  export const localCancelPostRpcPromise = (request: LocalCancelPostRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.CancelPost', request, (error: RPCError, result: void) => (error ? reject(error) : resolve())))
  
  export const localConversationErrorType = {
    permanent: 0,
    missinginfo: 1,
    selfrekeyneeded: 2,
    otherrekeyneeded: 3,
    identify: 4,
    transient: 5,
    none: 6,
  }
  
  export const localDeleteConversationLocalRpcChannelMap = (configKeys: Array<string>, request: LocalDeleteConversationLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.deleteConversationLocal', request)
  
  export const localDeleteConversationLocalRpcPromise = (request: LocalDeleteConversationLocalRpcParam): Promise<LocalDeleteConversationLocalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.deleteConversationLocal', request, (error: RPCError, result: LocalDeleteConversationLocalResult) => (error ? reject(error) : resolve(result))))
  
  export const localDownloadAttachmentLocalRpcChannelMap = (configKeys: Array<string>, request: LocalDownloadAttachmentLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.DownloadAttachmentLocal', request)
  
  export const localDownloadAttachmentLocalRpcPromise = (request: LocalDownloadAttachmentLocalRpcParam): Promise<LocalDownloadAttachmentLocalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.DownloadAttachmentLocal', request, (error: RPCError, result: LocalDownloadAttachmentLocalResult) => (error ? reject(error) : resolve(result))))
  
  export const localDownloadFileAttachmentLocalRpcChannelMap = (configKeys: Array<string>, request: LocalDownloadFileAttachmentLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.DownloadFileAttachmentLocal', request)
  
  export const localDownloadFileAttachmentLocalRpcPromise = (request: LocalDownloadFileAttachmentLocalRpcParam): Promise<LocalDownloadFileAttachmentLocalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.DownloadFileAttachmentLocal', request, (error: RPCError, result: LocalDownloadFileAttachmentLocalResult) => (error ? reject(error) : resolve(result))))
  
  export const localFindConversationsLocalRpcChannelMap = (configKeys: Array<string>, request: LocalFindConversationsLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.findConversationsLocal', request)
  
  export const localFindConversationsLocalRpcPromise = (request: LocalFindConversationsLocalRpcParam): Promise<LocalFindConversationsLocalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.findConversationsLocal', request, (error: RPCError, result: LocalFindConversationsLocalResult) => (error ? reject(error) : resolve(result))))
  
  export const localGenerateOutboxIDRpcChannelMap = (configKeys: Array<string>, request: LocalGenerateOutboxIDRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.generateOutboxID', request)
  
  export const localGenerateOutboxIDRpcPromise = (request: LocalGenerateOutboxIDRpcParam): Promise<LocalGenerateOutboxIDResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.generateOutboxID', request, (error: RPCError, result: LocalGenerateOutboxIDResult) => (error ? reject(error) : resolve(result))))
  
  export const localGetCachedThreadRpcChannelMap = (configKeys: Array<string>, request: LocalGetCachedThreadRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.getCachedThread', request)
  
  export const localGetCachedThreadRpcPromise = (request: LocalGetCachedThreadRpcParam): Promise<LocalGetCachedThreadResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.getCachedThread', request, (error: RPCError, result: LocalGetCachedThreadResult) => (error ? reject(error) : resolve(result))))
  
  export const localGetConversationForCLILocalRpcChannelMap = (configKeys: Array<string>, request: LocalGetConversationForCLILocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.getConversationForCLILocal', request)
  
  export const localGetConversationForCLILocalRpcPromise = (request: LocalGetConversationForCLILocalRpcParam): Promise<LocalGetConversationForCLILocalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.getConversationForCLILocal', request, (error: RPCError, result: LocalGetConversationForCLILocalResult) => (error ? reject(error) : resolve(result))))
  
  export const localGetGlobalAppNotificationSettingsLocalRpcChannelMap = (configKeys: Array<string>, request: LocalGetGlobalAppNotificationSettingsLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.getGlobalAppNotificationSettingsLocal', request)
  
  export const localGetGlobalAppNotificationSettingsLocalRpcPromise = (request: LocalGetGlobalAppNotificationSettingsLocalRpcParam): Promise<LocalGetGlobalAppNotificationSettingsLocalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.getGlobalAppNotificationSettingsLocal', request, (error: RPCError, result: LocalGetGlobalAppNotificationSettingsLocalResult) => (error ? reject(error) : resolve(result))))
  
  export const localGetInboxAndUnboxLocalRpcChannelMap = (configKeys: Array<string>, request: LocalGetInboxAndUnboxLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.getInboxAndUnboxLocal', request)
  
  export const localGetInboxAndUnboxLocalRpcPromise = (request: LocalGetInboxAndUnboxLocalRpcParam): Promise<LocalGetInboxAndUnboxLocalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.getInboxAndUnboxLocal', request, (error: RPCError, result: LocalGetInboxAndUnboxLocalResult) => (error ? reject(error) : resolve(result))))
  
  export const localGetInboxNonblockLocalRpcChannelMap = (configKeys: Array<string>, request: LocalGetInboxNonblockLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.getInboxNonblockLocal', request)
  
  export const localGetInboxNonblockLocalRpcPromise = (request: LocalGetInboxNonblockLocalRpcParam): Promise<LocalGetInboxNonblockLocalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.getInboxNonblockLocal', request, (error: RPCError, result: LocalGetInboxNonblockLocalResult) => (error ? reject(error) : resolve(result))))
  
  export const localGetInboxSummaryForCLILocalRpcChannelMap = (configKeys: Array<string>, request: LocalGetInboxSummaryForCLILocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.getInboxSummaryForCLILocal', request)
  
  export const localGetInboxSummaryForCLILocalRpcPromise = (request: LocalGetInboxSummaryForCLILocalRpcParam): Promise<LocalGetInboxSummaryForCLILocalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.getInboxSummaryForCLILocal', request, (error: RPCError, result: LocalGetInboxSummaryForCLILocalResult) => (error ? reject(error) : resolve(result))))
  
  export const localGetMessagesLocalRpcChannelMap = (configKeys: Array<string>, request: LocalGetMessagesLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.GetMessagesLocal', request)
  
  export const localGetMessagesLocalRpcPromise = (request: LocalGetMessagesLocalRpcParam): Promise<LocalGetMessagesLocalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.GetMessagesLocal', request, (error: RPCError, result: LocalGetMessagesLocalResult) => (error ? reject(error) : resolve(result))))
  
  export const localGetSearchRegexpRpcChannelMap = (configKeys: Array<string>, request: LocalGetSearchRegexpRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.getSearchRegexp', request)
  
  export const localGetSearchRegexpRpcPromise = (request: LocalGetSearchRegexpRpcParam): Promise<LocalGetSearchRegexpResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.getSearchRegexp', request, (error: RPCError, result: LocalGetSearchRegexpResult) => (error ? reject(error) : resolve(result))))
  
  export const localGetTLFConversationsLocalRpcChannelMap = (configKeys: Array<string>, request: LocalGetTLFConversationsLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.getTLFConversationsLocal', request)
  
  export const localGetTLFConversationsLocalRpcPromise = (request: LocalGetTLFConversationsLocalRpcParam): Promise<LocalGetTLFConversationsLocalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.getTLFConversationsLocal', request, (error: RPCError, result: LocalGetTLFConversationsLocalResult) => (error ? reject(error) : resolve(result))))
  
  export const localGetTeamRetentionLocalRpcChannelMap = (configKeys: Array<string>, request: LocalGetTeamRetentionLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.getTeamRetentionLocal', request)
  
  export const localGetTeamRetentionLocalRpcPromise = (request: LocalGetTeamRetentionLocalRpcParam): Promise<LocalGetTeamRetentionLocalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.getTeamRetentionLocal', request, (error: RPCError, result: LocalGetTeamRetentionLocalResult) => (error ? reject(error) : resolve(result))))
  
  export const localGetThreadLocalRpcChannelMap = (configKeys: Array<string>, request: LocalGetThreadLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.getThreadLocal', request)
  
  export const localGetThreadLocalRpcPromise = (request: LocalGetThreadLocalRpcParam): Promise<LocalGetThreadLocalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.getThreadLocal', request, (error: RPCError, result: LocalGetThreadLocalResult) => (error ? reject(error) : resolve(result))))
  
  export const localGetThreadNonblockCbMode = {
    full: 0,
    incremental: 1,
  }
  
  export const localGetThreadNonblockReason = {
    general: 0,
    push: 1,
  }
  
  export const localGetThreadNonblockRpcChannelMap = (configKeys: Array<string>, request: LocalGetThreadNonblockRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.getThreadNonblock', request)
  
  export const localGetThreadNonblockRpcPromise = (request: LocalGetThreadNonblockRpcParam): Promise<LocalGetThreadNonblockResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.getThreadNonblock', request, (error: RPCError, result: LocalGetThreadNonblockResult) => (error ? reject(error) : resolve(result))))
  
  export const localHeaderPlaintextVersion = {
    v1: 1,
    v2: 2,
    v3: 3,
    v4: 4,
    v5: 5,
    v6: 6,
    v7: 7,
    v8: 8,
    v9: 9,
    v10: 10,
  }
  
  export const localJoinConversationByIDLocalRpcChannelMap = (configKeys: Array<string>, request: LocalJoinConversationByIDLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.joinConversationByIDLocal', request)
  
  export const localJoinConversationByIDLocalRpcPromise = (request: LocalJoinConversationByIDLocalRpcParam): Promise<LocalJoinConversationByIDLocalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.joinConversationByIDLocal', request, (error: RPCError, result: LocalJoinConversationByIDLocalResult) => (error ? reject(error) : resolve(result))))
  
  export const localJoinConversationLocalRpcChannelMap = (configKeys: Array<string>, request: LocalJoinConversationLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.joinConversationLocal', request)
  
  export const localJoinConversationLocalRpcPromise = (request: LocalJoinConversationLocalRpcParam): Promise<LocalJoinConversationLocalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.joinConversationLocal', request, (error: RPCError, result: LocalJoinConversationLocalResult) => (error ? reject(error) : resolve(result))))
  
  export const localLeaveConversationLocalRpcChannelMap = (configKeys: Array<string>, request: LocalLeaveConversationLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.leaveConversationLocal', request)
  
  export const localLeaveConversationLocalRpcPromise = (request: LocalLeaveConversationLocalRpcParam): Promise<LocalLeaveConversationLocalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.leaveConversationLocal', request, (error: RPCError, result: LocalLeaveConversationLocalResult) => (error ? reject(error) : resolve(result))))
  
  export const localMakePreviewRpcChannelMap = (configKeys: Array<string>, request: LocalMakePreviewRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.makePreview', request)
  
  export const localMakePreviewRpcPromise = (request: LocalMakePreviewRpcParam): Promise<LocalMakePreviewResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.makePreview', request, (error: RPCError, result: LocalMakePreviewResult) => (error ? reject(error) : resolve(result))))
  
  export const localMarkAsReadLocalRpcChannelMap = (configKeys: Array<string>, request: LocalMarkAsReadLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.markAsReadLocal', request)
  
  export const localMarkAsReadLocalRpcPromise = (request: LocalMarkAsReadLocalRpcParam): Promise<LocalMarkAsReadLocalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.markAsReadLocal', request, (error: RPCError, result: LocalMarkAsReadLocalResult) => (error ? reject(error) : resolve(result))))
  
  export const localMessageSystemType = {
    addedtoteam: 0,
    inviteaddedtoteam: 1,
    complexteam: 2,
    createteam: 3,
    gitpush: 4,
  }
  
  export const localMessageUnboxedErrorType = {
    misc: 0,
    badversionCritical: 1,
    badversion: 2,
    identify: 3,
  }
  
  export const localNewConversationLocalRpcChannelMap = (configKeys: Array<string>, request: LocalNewConversationLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.newConversationLocal', request)
  
  export const localNewConversationLocalRpcPromise = (request: LocalNewConversationLocalRpcParam): Promise<LocalNewConversationLocalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.newConversationLocal', request, (error: RPCError, result: LocalNewConversationLocalResult) => (error ? reject(error) : resolve(result))))
  
  export const localOutboxErrorType = {
    misc: 0,
    offline: 1,
    identify: 2,
    toolong: 3,
    duplicate: 4,
    expired: 5,
  }
  
  export const localOutboxStateType = {
    sending: 0,
    error: 1,
  }
  
  export const localPostAttachmentLocalRpcChannelMap = (configKeys: Array<string>, request: LocalPostAttachmentLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.postAttachmentLocal', request)
  
  export const localPostAttachmentLocalRpcPromise = (request: LocalPostAttachmentLocalRpcParam): Promise<LocalPostAttachmentLocalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.postAttachmentLocal', request, (error: RPCError, result: LocalPostAttachmentLocalResult) => (error ? reject(error) : resolve(result))))
  
  export const localPostDeleteHistoryByAgeRpcChannelMap = (configKeys: Array<string>, request: LocalPostDeleteHistoryByAgeRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.postDeleteHistoryByAge', request)
  
  export const localPostDeleteHistoryByAgeRpcPromise = (request: LocalPostDeleteHistoryByAgeRpcParam): Promise<LocalPostDeleteHistoryByAgeResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.postDeleteHistoryByAge', request, (error: RPCError, result: LocalPostDeleteHistoryByAgeResult) => (error ? reject(error) : resolve(result))))
  
  export const localPostDeleteHistoryThroughRpcChannelMap = (configKeys: Array<string>, request: LocalPostDeleteHistoryThroughRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.postDeleteHistoryThrough', request)
  
  export const localPostDeleteHistoryThroughRpcPromise = (request: LocalPostDeleteHistoryThroughRpcParam): Promise<LocalPostDeleteHistoryThroughResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.postDeleteHistoryThrough', request, (error: RPCError, result: LocalPostDeleteHistoryThroughResult) => (error ? reject(error) : resolve(result))))
  
  export const localPostDeleteHistoryUptoRpcChannelMap = (configKeys: Array<string>, request: LocalPostDeleteHistoryUptoRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.postDeleteHistoryUpto', request)
  
  export const localPostDeleteHistoryUptoRpcPromise = (request: LocalPostDeleteHistoryUptoRpcParam): Promise<LocalPostDeleteHistoryUptoResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.postDeleteHistoryUpto', request, (error: RPCError, result: LocalPostDeleteHistoryUptoResult) => (error ? reject(error) : resolve(result))))
  
  export const localPostDeleteNonblockRpcChannelMap = (configKeys: Array<string>, request: LocalPostDeleteNonblockRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.postDeleteNonblock', request)
  
  export const localPostDeleteNonblockRpcPromise = (request: LocalPostDeleteNonblockRpcParam): Promise<LocalPostDeleteNonblockResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.postDeleteNonblock', request, (error: RPCError, result: LocalPostDeleteNonblockResult) => (error ? reject(error) : resolve(result))))
  
  export const localPostEditNonblockRpcChannelMap = (configKeys: Array<string>, request: LocalPostEditNonblockRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.postEditNonblock', request)
  
  export const localPostEditNonblockRpcPromise = (request: LocalPostEditNonblockRpcParam): Promise<LocalPostEditNonblockResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.postEditNonblock', request, (error: RPCError, result: LocalPostEditNonblockResult) => (error ? reject(error) : resolve(result))))
  
  export const localPostFileAttachmentLocalRpcChannelMap = (configKeys: Array<string>, request: LocalPostFileAttachmentLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.postFileAttachmentLocal', request)
  
  export const localPostFileAttachmentLocalRpcPromise = (request: LocalPostFileAttachmentLocalRpcParam): Promise<LocalPostFileAttachmentLocalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.postFileAttachmentLocal', request, (error: RPCError, result: LocalPostFileAttachmentLocalResult) => (error ? reject(error) : resolve(result))))
  
  export const localPostHeadlineNonblockRpcChannelMap = (configKeys: Array<string>, request: LocalPostHeadlineNonblockRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.postHeadlineNonblock', request)
  
  export const localPostHeadlineNonblockRpcPromise = (request: LocalPostHeadlineNonblockRpcParam): Promise<LocalPostHeadlineNonblockResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.postHeadlineNonblock', request, (error: RPCError, result: LocalPostHeadlineNonblockResult) => (error ? reject(error) : resolve(result))))
  
  export const localPostHeadlineRpcChannelMap = (configKeys: Array<string>, request: LocalPostHeadlineRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.postHeadline', request)
  
  export const localPostHeadlineRpcPromise = (request: LocalPostHeadlineRpcParam): Promise<LocalPostHeadlineResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.postHeadline', request, (error: RPCError, result: LocalPostHeadlineResult) => (error ? reject(error) : resolve(result))))
  
  export const localPostLocalNonblockRpcChannelMap = (configKeys: Array<string>, request: LocalPostLocalNonblockRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.postLocalNonblock', request)
  
  export const localPostLocalNonblockRpcPromise = (request: LocalPostLocalNonblockRpcParam): Promise<LocalPostLocalNonblockResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.postLocalNonblock', request, (error: RPCError, result: LocalPostLocalNonblockResult) => (error ? reject(error) : resolve(result))))
  
  export const localPostLocalRpcChannelMap = (configKeys: Array<string>, request: LocalPostLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.postLocal', request)
  
  export const localPostLocalRpcPromise = (request: LocalPostLocalRpcParam): Promise<LocalPostLocalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.postLocal', request, (error: RPCError, result: LocalPostLocalResult) => (error ? reject(error) : resolve(result))))
  
  export const localPostMetadataNonblockRpcChannelMap = (configKeys: Array<string>, request: LocalPostMetadataNonblockRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.postMetadataNonblock', request)
  
  export const localPostMetadataNonblockRpcPromise = (request: LocalPostMetadataNonblockRpcParam): Promise<LocalPostMetadataNonblockResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.postMetadataNonblock', request, (error: RPCError, result: LocalPostMetadataNonblockResult) => (error ? reject(error) : resolve(result))))
  
  export const localPostMetadataRpcChannelMap = (configKeys: Array<string>, request: LocalPostMetadataRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.postMetadata', request)
  
  export const localPostMetadataRpcPromise = (request: LocalPostMetadataRpcParam): Promise<LocalPostMetadataResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.postMetadata', request, (error: RPCError, result: LocalPostMetadataResult) => (error ? reject(error) : resolve(result))))
  
  export const localPostTextNonblockRpcChannelMap = (configKeys: Array<string>, request: LocalPostTextNonblockRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.postTextNonblock', request)
  
  export const localPostTextNonblockRpcPromise = (request: LocalPostTextNonblockRpcParam): Promise<LocalPostTextNonblockResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.postTextNonblock', request, (error: RPCError, result: LocalPostTextNonblockResult) => (error ? reject(error) : resolve(result))))
  
  export const localPreviewConversationByIDLocalRpcChannelMap = (configKeys: Array<string>, request: LocalPreviewConversationByIDLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.previewConversationByIDLocal', request)
  
  export const localPreviewConversationByIDLocalRpcPromise = (request: LocalPreviewConversationByIDLocalRpcParam): Promise<LocalPreviewConversationByIDLocalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.previewConversationByIDLocal', request, (error: RPCError, result: LocalPreviewConversationByIDLocalResult) => (error ? reject(error) : resolve(result))))
  
  export const localRetryPostRpcChannelMap = (configKeys: Array<string>, request: LocalRetryPostRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.RetryPost', request)
  
  export const localRetryPostRpcPromise = (request: LocalRetryPostRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.RetryPost', request, (error: RPCError, result: void) => (error ? reject(error) : resolve())))
  
  export const localSetAppNotificationSettingsLocalRpcChannelMap = (configKeys: Array<string>, request: LocalSetAppNotificationSettingsLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.setAppNotificationSettingsLocal', request)
  
  export const localSetAppNotificationSettingsLocalRpcPromise = (request: LocalSetAppNotificationSettingsLocalRpcParam): Promise<LocalSetAppNotificationSettingsLocalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.setAppNotificationSettingsLocal', request, (error: RPCError, result: LocalSetAppNotificationSettingsLocalResult) => (error ? reject(error) : resolve(result))))
  
  export const localSetConvRetentionLocalRpcChannelMap = (configKeys: Array<string>, request: LocalSetConvRetentionLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.setConvRetentionLocal', request)
  
  export const localSetConvRetentionLocalRpcPromise = (request: LocalSetConvRetentionLocalRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.setConvRetentionLocal', request, (error: RPCError, result: void) => (error ? reject(error) : resolve())))
  
  export const localSetConversationStatusLocalRpcChannelMap = (configKeys: Array<string>, request: LocalSetConversationStatusLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.SetConversationStatusLocal', request)
  
  export const localSetConversationStatusLocalRpcPromise = (request: LocalSetConversationStatusLocalRpcParam): Promise<LocalSetConversationStatusLocalResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.SetConversationStatusLocal', request, (error: RPCError, result: LocalSetConversationStatusLocalResult) => (error ? reject(error) : resolve(result))))
  
  export const localSetGlobalAppNotificationSettingsLocalRpcChannelMap = (configKeys: Array<string>, request: LocalSetGlobalAppNotificationSettingsLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.setGlobalAppNotificationSettingsLocal', request)
  
  export const localSetGlobalAppNotificationSettingsLocalRpcPromise = (request: LocalSetGlobalAppNotificationSettingsLocalRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.setGlobalAppNotificationSettingsLocal', request, (error: RPCError, result: void) => (error ? reject(error) : resolve())))
  
  export const localSetTeamRetentionLocalRpcChannelMap = (configKeys: Array<string>, request: LocalSetTeamRetentionLocalRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.setTeamRetentionLocal', request)
  
  export const localSetTeamRetentionLocalRpcPromise = (request: LocalSetTeamRetentionLocalRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.setTeamRetentionLocal', request, (error: RPCError, result: void) => (error ? reject(error) : resolve())))
  
  export const localUnboxMobilePushNotificationRpcChannelMap = (configKeys: Array<string>, request: LocalUnboxMobilePushNotificationRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.unboxMobilePushNotification', request)
  
  export const localUnboxMobilePushNotificationRpcPromise = (request: LocalUnboxMobilePushNotificationRpcParam): Promise<LocalUnboxMobilePushNotificationResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.unboxMobilePushNotification', request, (error: RPCError, result: LocalUnboxMobilePushNotificationResult) => (error ? reject(error) : resolve(result))))
  
  export const localUpdateTypingRpcChannelMap = (configKeys: Array<string>, request: LocalUpdateTypingRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.updateTyping', request)
  
  export const localUpdateTypingRpcPromise = (request: LocalUpdateTypingRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.updateTyping', request, (error: RPCError, result: void) => (error ? reject(error) : resolve())))
  
  export const localUpgradeKBFSConversationToImpteamRpcChannelMap = (configKeys: Array<string>, request: LocalUpgradeKBFSConversationToImpteamRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.local.upgradeKBFSConversationToImpteam', request)
  
  export const localUpgradeKBFSConversationToImpteamRpcPromise = (request: LocalUpgradeKBFSConversationToImpteamRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.local.upgradeKBFSConversationToImpteam', request, (error: RPCError, result: void) => (error ? reject(error) : resolve())))
  
  export const notifyChatChatActivityType = {
    reserved: 0,
    incomingMessage: 1,
    readMessage: 2,
    newConversation: 3,
    setStatus: 4,
    failedMessage: 5,
    membersUpdate: 6,
    setAppNotificationSettings: 7,
    teamtype: 8,
    expunge: 9,
  }
  
  export const notifyChatStaleUpdateType = {
    clear: 0,
    newactivity: 1,
  }
  
  export const remoteChannelMention = {
    none: 0,
    all: 1,
    here: 2,
  }
  
  export const remoteDeleteConversationRpcChannelMap = (configKeys: Array<string>, request: RemoteDeleteConversationRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.deleteConversation', request)
  
  export const remoteDeleteConversationRpcPromise = (request: RemoteDeleteConversationRpcParam): Promise<RemoteDeleteConversationResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.deleteConversation', request, (error: RPCError, result: RemoteDeleteConversationResult) => (error ? reject(error) : resolve(result))))
  
  export const remoteGetGlobalAppNotificationSettingsRpcChannelMap = (configKeys: Array<string>, request: RemoteGetGlobalAppNotificationSettingsRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.getGlobalAppNotificationSettings', request)
  
  export const remoteGetGlobalAppNotificationSettingsRpcPromise = (request: RemoteGetGlobalAppNotificationSettingsRpcParam): Promise<RemoteGetGlobalAppNotificationSettingsResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.getGlobalAppNotificationSettings', request, (error: RPCError, result: RemoteGetGlobalAppNotificationSettingsResult) => (error ? reject(error) : resolve(result))))
  
  export const remoteGetInboxRemoteRpcChannelMap = (configKeys: Array<string>, request: RemoteGetInboxRemoteRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.getInboxRemote', request)
  
  export const remoteGetInboxRemoteRpcPromise = (request: RemoteGetInboxRemoteRpcParam): Promise<RemoteGetInboxRemoteResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.getInboxRemote', request, (error: RPCError, result: RemoteGetInboxRemoteResult) => (error ? reject(error) : resolve(result))))
  
  export const remoteGetInboxVersionRpcChannelMap = (configKeys: Array<string>, request: RemoteGetInboxVersionRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.getInboxVersion', request)
  
  export const remoteGetInboxVersionRpcPromise = (request: RemoteGetInboxVersionRpcParam): Promise<RemoteGetInboxVersionResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.getInboxVersion', request, (error: RPCError, result: RemoteGetInboxVersionResult) => (error ? reject(error) : resolve(result))))
  
  export const remoteGetMessageBeforeRpcChannelMap = (configKeys: Array<string>, request: RemoteGetMessageBeforeRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.getMessageBefore', request)
  
  export const remoteGetMessageBeforeRpcPromise = (request: RemoteGetMessageBeforeRpcParam): Promise<RemoteGetMessageBeforeResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.getMessageBefore', request, (error: RPCError, result: RemoteGetMessageBeforeResult) => (error ? reject(error) : resolve(result))))
  
  export const remoteGetMessagesRemoteRpcChannelMap = (configKeys: Array<string>, request: RemoteGetMessagesRemoteRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.getMessagesRemote', request)
  
  export const remoteGetMessagesRemoteRpcPromise = (request: RemoteGetMessagesRemoteRpcParam): Promise<RemoteGetMessagesRemoteResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.getMessagesRemote', request, (error: RPCError, result: RemoteGetMessagesRemoteResult) => (error ? reject(error) : resolve(result))))
  
  export const remoteGetPublicConversationsRpcChannelMap = (configKeys: Array<string>, request: RemoteGetPublicConversationsRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.getPublicConversations', request)
  
  export const remoteGetPublicConversationsRpcPromise = (request: RemoteGetPublicConversationsRpcParam): Promise<RemoteGetPublicConversationsResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.getPublicConversations', request, (error: RPCError, result: RemoteGetPublicConversationsResult) => (error ? reject(error) : resolve(result))))
  
  export const remoteGetS3ParamsRpcChannelMap = (configKeys: Array<string>, request: RemoteGetS3ParamsRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.getS3Params', request)
  
  export const remoteGetS3ParamsRpcPromise = (request: RemoteGetS3ParamsRpcParam): Promise<RemoteGetS3ParamsResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.getS3Params', request, (error: RPCError, result: RemoteGetS3ParamsResult) => (error ? reject(error) : resolve(result))))
  
  export const remoteGetTLFConversationsRpcChannelMap = (configKeys: Array<string>, request: RemoteGetTLFConversationsRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.getTLFConversations', request)
  
  export const remoteGetTLFConversationsRpcPromise = (request: RemoteGetTLFConversationsRpcParam): Promise<RemoteGetTLFConversationsResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.getTLFConversations', request, (error: RPCError, result: RemoteGetTLFConversationsResult) => (error ? reject(error) : resolve(result))))
  
  export const remoteGetThreadRemoteRpcChannelMap = (configKeys: Array<string>, request: RemoteGetThreadRemoteRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.getThreadRemote', request)
  
  export const remoteGetThreadRemoteRpcPromise = (request: RemoteGetThreadRemoteRpcParam): Promise<RemoteGetThreadRemoteResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.getThreadRemote', request, (error: RPCError, result: RemoteGetThreadRemoteResult) => (error ? reject(error) : resolve(result))))
  
  export const remoteGetUnreadUpdateFullRpcChannelMap = (configKeys: Array<string>, request: RemoteGetUnreadUpdateFullRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.GetUnreadUpdateFull', request)
  
  export const remoteGetUnreadUpdateFullRpcPromise = (request: RemoteGetUnreadUpdateFullRpcParam): Promise<RemoteGetUnreadUpdateFullResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.GetUnreadUpdateFull', request, (error: RPCError, result: RemoteGetUnreadUpdateFullResult) => (error ? reject(error) : resolve(result))))
  
  export const remoteJoinConversationRpcChannelMap = (configKeys: Array<string>, request: RemoteJoinConversationRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.joinConversation', request)
  
  export const remoteJoinConversationRpcPromise = (request: RemoteJoinConversationRpcParam): Promise<RemoteJoinConversationResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.joinConversation', request, (error: RPCError, result: RemoteJoinConversationResult) => (error ? reject(error) : resolve(result))))
  
  export const remoteLeaveConversationRpcChannelMap = (configKeys: Array<string>, request: RemoteLeaveConversationRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.leaveConversation', request)
  
  export const remoteLeaveConversationRpcPromise = (request: RemoteLeaveConversationRpcParam): Promise<RemoteLeaveConversationResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.leaveConversation', request, (error: RPCError, result: RemoteLeaveConversationResult) => (error ? reject(error) : resolve(result))))
  
  export const remoteMarkAsReadRpcChannelMap = (configKeys: Array<string>, request: RemoteMarkAsReadRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.markAsRead', request)
  
  export const remoteMarkAsReadRpcPromise = (request: RemoteMarkAsReadRpcParam): Promise<RemoteMarkAsReadResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.markAsRead', request, (error: RPCError, result: RemoteMarkAsReadResult) => (error ? reject(error) : resolve(result))))
  
  export const remoteMessageBoxedVersion = {
    vnone: 0,
    v1: 1,
    v2: 2,
    v3: 3,
  }
  
  export const remoteNewConversationRemote2RpcChannelMap = (configKeys: Array<string>, request: RemoteNewConversationRemote2RpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.newConversationRemote2', request)
  
  export const remoteNewConversationRemote2RpcPromise = (request: RemoteNewConversationRemote2RpcParam): Promise<RemoteNewConversationRemote2Result> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.newConversationRemote2', request, (error: RPCError, result: RemoteNewConversationRemote2Result) => (error ? reject(error) : resolve(result))))
  
  export const remoteNewConversationRemoteRpcChannelMap = (configKeys: Array<string>, request: RemoteNewConversationRemoteRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.newConversationRemote', request)
  
  export const remoteNewConversationRemoteRpcPromise = (request: RemoteNewConversationRemoteRpcParam): Promise<RemoteNewConversationRemoteResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.newConversationRemote', request, (error: RPCError, result: RemoteNewConversationRemoteResult) => (error ? reject(error) : resolve(result))))
  
  export const remotePostRemoteRpcChannelMap = (configKeys: Array<string>, request: RemotePostRemoteRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.postRemote', request)
  
  export const remotePostRemoteRpcPromise = (request: RemotePostRemoteRpcParam): Promise<RemotePostRemoteResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.postRemote', request, (error: RPCError, result: RemotePostRemoteResult) => (error ? reject(error) : resolve(result))))
  
  export const remotePreviewConversationRpcChannelMap = (configKeys: Array<string>, request: RemotePreviewConversationRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.previewConversation', request)
  
  export const remotePreviewConversationRpcPromise = (request: RemotePreviewConversationRpcParam): Promise<RemotePreviewConversationResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.previewConversation', request, (error: RPCError, result: RemotePreviewConversationResult) => (error ? reject(error) : resolve(result))))
  
  export const remotePublishReadMessageRpcChannelMap = (configKeys: Array<string>, request: RemotePublishReadMessageRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.publishReadMessage', request)
  
  export const remotePublishReadMessageRpcPromise = (request: RemotePublishReadMessageRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.publishReadMessage', request, (error: RPCError, result: void) => (error ? reject(error) : resolve())))
  
  export const remotePublishSetConversationStatusRpcChannelMap = (configKeys: Array<string>, request: RemotePublishSetConversationStatusRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.publishSetConversationStatus', request)
  
  export const remotePublishSetConversationStatusRpcPromise = (request: RemotePublishSetConversationStatusRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.publishSetConversationStatus', request, (error: RPCError, result: void) => (error ? reject(error) : resolve())))
  
  export const remoteRemoteNotificationSuccessfulRpcChannelMap = (configKeys: Array<string>, request: RemoteRemoteNotificationSuccessfulRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.remoteNotificationSuccessful', request)
  
  export const remoteRemoteNotificationSuccessfulRpcPromise = (request: RemoteRemoteNotificationSuccessfulRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.remoteNotificationSuccessful', request, (error: RPCError, result: void) => (error ? reject(error) : resolve())))
  
  export const remoteRetentionSweepConvRpcChannelMap = (configKeys: Array<string>, request: RemoteRetentionSweepConvRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.retentionSweepConv', request)
  
  export const remoteRetentionSweepConvRpcPromise = (request: RemoteRetentionSweepConvRpcParam): Promise<RemoteRetentionSweepConvResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.retentionSweepConv', request, (error: RPCError, result: RemoteRetentionSweepConvResult) => (error ? reject(error) : resolve(result))))
  
  export const remoteS3SignRpcChannelMap = (configKeys: Array<string>, request: RemoteS3SignRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.s3Sign', request)
  
  export const remoteS3SignRpcPromise = (request: RemoteS3SignRpcParam): Promise<RemoteS3SignResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.s3Sign', request, (error: RPCError, result: RemoteS3SignResult) => (error ? reject(error) : resolve(result))))
  
  export const remoteSetAppNotificationSettingsRpcChannelMap = (configKeys: Array<string>, request: RemoteSetAppNotificationSettingsRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.setAppNotificationSettings', request)
  
  export const remoteSetAppNotificationSettingsRpcPromise = (request: RemoteSetAppNotificationSettingsRpcParam): Promise<RemoteSetAppNotificationSettingsResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.setAppNotificationSettings', request, (error: RPCError, result: RemoteSetAppNotificationSettingsResult) => (error ? reject(error) : resolve(result))))
  
  export const remoteSetConvRetentionRpcChannelMap = (configKeys: Array<string>, request: RemoteSetConvRetentionRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.setConvRetention', request)
  
  export const remoteSetConvRetentionRpcPromise = (request: RemoteSetConvRetentionRpcParam): Promise<RemoteSetConvRetentionResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.setConvRetention', request, (error: RPCError, result: RemoteSetConvRetentionResult) => (error ? reject(error) : resolve(result))))
  
  export const remoteSetConversationStatusRpcChannelMap = (configKeys: Array<string>, request: RemoteSetConversationStatusRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.SetConversationStatus', request)
  
  export const remoteSetConversationStatusRpcPromise = (request: RemoteSetConversationStatusRpcParam): Promise<RemoteSetConversationStatusResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.SetConversationStatus', request, (error: RPCError, result: RemoteSetConversationStatusResult) => (error ? reject(error) : resolve(result))))
  
  export const remoteSetGlobalAppNotificationSettingsRpcChannelMap = (configKeys: Array<string>, request: RemoteSetGlobalAppNotificationSettingsRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.setGlobalAppNotificationSettings', request)
  
  export const remoteSetGlobalAppNotificationSettingsRpcPromise = (request: RemoteSetGlobalAppNotificationSettingsRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.setGlobalAppNotificationSettings', request, (error: RPCError, result: void) => (error ? reject(error) : resolve())))
  
  export const remoteSetTeamRetentionRpcChannelMap = (configKeys: Array<string>, request: RemoteSetTeamRetentionRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.setTeamRetention', request)
  
  export const remoteSetTeamRetentionRpcPromise = (request: RemoteSetTeamRetentionRpcParam): Promise<RemoteSetTeamRetentionResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.setTeamRetention', request, (error: RPCError, result: RemoteSetTeamRetentionResult) => (error ? reject(error) : resolve(result))))
  
  export const remoteSyncAllNotificationType = {
    state: 0,
    incremental: 1,
  }
  
  export const remoteSyncAllProtVers = {
    v0: 0,
    v1: 1,
  }
  
  export const remoteSyncAllRpcChannelMap = (configKeys: Array<string>, request: RemoteSyncAllRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.syncAll', request)
  
  export const remoteSyncAllRpcPromise = (request: RemoteSyncAllRpcParam): Promise<RemoteSyncAllResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.syncAll', request, (error: RPCError, result: RemoteSyncAllResult) => (error ? reject(error) : resolve(result))))
  
  export const remoteSyncChatRpcChannelMap = (configKeys: Array<string>, request: RemoteSyncChatRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.syncChat', request)
  
  export const remoteSyncChatRpcPromise = (request: RemoteSyncChatRpcParam): Promise<RemoteSyncChatResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.syncChat', request, (error: RPCError, result: RemoteSyncChatResult) => (error ? reject(error) : resolve(result))))
  
  export const remoteSyncInboxRpcChannelMap = (configKeys: Array<string>, request: RemoteSyncInboxRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.syncInbox', request)
  
  export const remoteSyncInboxRpcPromise = (request: RemoteSyncInboxRpcParam): Promise<RemoteSyncInboxResult> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.syncInbox', request, (error: RPCError, result: RemoteSyncInboxResult) => (error ? reject(error) : resolve(result))))
  
  export const remoteTlfFinalizeRpcChannelMap = (configKeys: Array<string>, request: RemoteTlfFinalizeRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.tlfFinalize', request)
  
  export const remoteTlfFinalizeRpcPromise = (request: RemoteTlfFinalizeRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.tlfFinalize', request, (error: RPCError, result: void) => (error ? reject(error) : resolve())))
  
  export const remoteTlfResolveRpcChannelMap = (configKeys: Array<string>, request: RemoteTlfResolveRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.tlfResolve', request)
  
  export const remoteTlfResolveRpcPromise = (request: RemoteTlfResolveRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.tlfResolve', request, (error: RPCError, result: void) => (error ? reject(error) : resolve())))
  
  export const remoteUpdateTypingRemoteRpcChannelMap = (configKeys: Array<string>, request: RemoteUpdateTypingRemoteRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.updateTypingRemote', request)
  
  export const remoteUpdateTypingRemoteRpcPromise = (request: RemoteUpdateTypingRemoteRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.updateTypingRemote', request, (error: RPCError, result: void) => (error ? reject(error) : resolve())))
  
  export const remoteUpgradeKBFSToImpteamRpcChannelMap = (configKeys: Array<string>, request: RemoteUpgradeKBFSToImpteamRpcParam): EngineChannel => engine()._channelMapRpcHelper(configKeys, 'chat.1.remote.upgradeKBFSToImpteam', request)
  
  export const remoteUpgradeKBFSToImpteamRpcPromise = (request: RemoteUpgradeKBFSToImpteamRpcParam): Promise<void> => new Promise((resolve, reject) => engine()._rpcOutgoing('chat.1.remote.upgradeKBFSToImpteam', request, (error: RPCError, result: void) => (error ? reject(error) : resolve())))
  
  export type AppNotificationSettingLocal = $ReadOnly<{deviceType: Keybase1.DeviceType, kind: NotificationKind, enabled: Boolean}>
  
  export type Asset = $ReadOnly<{filename: String, region: String, endpoint: String, bucket: String, path: String, size: Long, mimeType: String, encHash: Hash, key: Bytes, verifyKey: Bytes, title: String, nonce: Bytes, metadata: AssetMetadata, tag: AssetTag}>
  
  export type AssetMetadata = {assetType: 1, image: ?AssetMetadataImage} | {assetType: 2, video: ?AssetMetadataVideo} | {assetType: 3, audio: ?AssetMetadataAudio}
  
  export type AssetMetadataAudio = $ReadOnly<{durationMs: Int}>
  
  export type AssetMetadataImage = $ReadOnly<{width: Int, height: Int}>
  
  export type AssetMetadataType =
    | 0 // NONE_0
    | 1 // IMAGE_1
    | 2 // VIDEO_2
    | 3 // AUDIO_3
  
  export type AssetMetadataVideo = $ReadOnly<{width: Int, height: Int, durationMs: Int}>
  
  export type AssetTag = 0 // PRIMARY_0
  
  export type BodyPlaintext = {version: 1, v1: ?BodyPlaintextV1} | {version: 2, v2: ?BodyPlaintextUnsupported} | {version: 3, v3: ?BodyPlaintextUnsupported} | {version: 4, v4: ?BodyPlaintextUnsupported} | {version: 5, v5: ?BodyPlaintextUnsupported} | {version: 6, v6: ?BodyPlaintextUnsupported} | {version: 7, v7: ?BodyPlaintextUnsupported} | {version: 8, v8: ?BodyPlaintextUnsupported} | {version: 9, v9: ?BodyPlaintextUnsupported} | {version: 10, v10: ?BodyPlaintextUnsupported}
  
  export type BodyPlaintextMetaInfo = $ReadOnly<{crit: Boolean}>
  
  export type BodyPlaintextUnsupported = $ReadOnly<{mi: BodyPlaintextMetaInfo}>
  
  export type BodyPlaintextV1 = $ReadOnly<{messageBody: MessageBody}>
  
  export type BodyPlaintextVersion =
    | 1 // V1_1
    | 2 // V2_2
    | 3 // V3_3
    | 4 // V4_4
    | 5 // V5_5
    | 6 // V6_6
    | 7 // V7_7
    | 8 // V8_8
    | 9 // V9_9
    | 10 // V10_10
  
  export type ChannelMention =
    | 0 // NONE_0
    | 1 // ALL_1
    | 2 // HERE_2
  
  export type ChannelNameMention = $ReadOnly<{convID: ConversationID, topicName: String}>
  
  export type ChatActivity = {activityType: 1, incomingMessage: ?IncomingMessage} | {activityType: 2, readMessage: ?ReadMessageInfo} | {activityType: 3, newConversation: ?NewConversationInfo} | {activityType: 4, setStatus: ?SetStatusInfo} | {activityType: 5, failedMessage: ?FailedMessageInfo} | {activityType: 6, membersUpdate: ?MembersUpdateInfo} | {activityType: 7, setAppNotificationSettings: ?SetAppNotificationSettingsInfo} | {activityType: 8, teamtype: ?TeamTypeInfo} | {activityType: 9, expunge: ?ExpungeInfo}
  
  export type ChatActivityType =
    | 0 // RESERVED_0
    | 1 // INCOMING_MESSAGE_1
    | 2 // READ_MESSAGE_2
    | 3 // NEW_CONVERSATION_3
    | 4 // SET_STATUS_4
    | 5 // FAILED_MESSAGE_5
    | 6 // MEMBERS_UPDATE_6
    | 7 // SET_APP_NOTIFICATION_SETTINGS_7
    | 8 // TEAMTYPE_8
    | 9 // EXPUNGE_9
  
  export type ChatSearchHit = $ReadOnly<{prevMessage?: ?UIMessage, hitMessage?: ?UIMessage, nextMessage?: ?UIMessage, matches?: ?Array<String>}>
  
  export type ChatSyncIncrementalInfo = $ReadOnly<{items?: ?Array<UnverifiedInboxUIItem>}>
  
  export type ChatSyncResult = {syncType: 0} | {syncType: 2} | {syncType: 1, incremental: ?ChatSyncIncrementalInfo}
  
  export type ChatUiChatAttachmentDownloadDoneRpcParam = ?$ReadOnly<{incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type ChatUiChatAttachmentDownloadProgressRpcParam = $ReadOnly<{bytesComplete: Long, bytesTotal: Long, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type ChatUiChatAttachmentDownloadStartRpcParam = ?$ReadOnly<{incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type ChatUiChatAttachmentPreviewUploadDoneRpcParam = ?$ReadOnly<{incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type ChatUiChatAttachmentPreviewUploadStartRpcParam = $ReadOnly<{metadata: AssetMetadata, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type ChatUiChatAttachmentUploadDoneRpcParam = ?$ReadOnly<{incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type ChatUiChatAttachmentUploadOutboxIDRpcParam = $ReadOnly<{outboxID: OutboxID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type ChatUiChatAttachmentUploadProgressRpcParam = $ReadOnly<{bytesComplete: Long, bytesTotal: Long, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type ChatUiChatAttachmentUploadStartRpcParam = $ReadOnly<{metadata: AssetMetadata, placeholderMsgID: MessageID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type ChatUiChatConfirmChannelDeleteRpcParam = $ReadOnly<{channel: String, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type ChatUiChatInboxConversationRpcParam = $ReadOnly<{conv: String, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type ChatUiChatInboxFailedRpcParam = $ReadOnly<{convID: ConversationID, error: InboxUIItemError, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type ChatUiChatInboxUnverifiedRpcParam = $ReadOnly<{inbox: String, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type ChatUiChatSearchDoneRpcParam = $ReadOnly<{numHits: Int, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type ChatUiChatSearchHitRpcParam = $ReadOnly<{searchHit: ChatSearchHit, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type ChatUiChatThreadCachedRpcParam = $ReadOnly<{thread?: ?String, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type ChatUiChatThreadFullRpcParam = $ReadOnly<{thread: String, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type ConvTypingUpdate = $ReadOnly<{convID: ConversationID, typers?: ?Array<TyperInfo>}>
  
  export type Conversation = $ReadOnly<{metadata: ConversationMetadata, readerInfo?: ?ConversationReaderInfo, notifications?: ?ConversationNotificationInfo, maxMsgs?: ?Array<MessageBoxed>, maxMsgSummaries?: ?Array<MessageSummary>, creatorInfo?: ?ConversationCreatorInfo, expunge: Expunge, convRetention?: ?RetentionPolicy, teamRetention?: ?RetentionPolicy}>
  
  export type ConversationCreatorInfo = $ReadOnly<{ctime: Gregor1.Time, uid: Gregor1.UID}>
  
  export type ConversationCreatorInfoLocal = $ReadOnly<{ctime: Gregor1.Time, username: String}>
  
  export type ConversationErrorLocal = $ReadOnly<{typ: ConversationErrorType, message: String, remoteConv: Conversation, unverifiedTLFName: String, rekeyInfo?: ?ConversationErrorRekey}>
  
  export type ConversationErrorRekey = $ReadOnly<{tlfName: String, tlfPublic: Boolean, rekeyers?: ?Array<String>, writerNames?: ?Array<String>, readerNames?: ?Array<String>}>
  
  export type ConversationErrorType =
    | 0 // PERMANENT_0
    | 1 // MISSINGINFO_1
    | 2 // SELFREKEYNEEDED_2
    | 3 // OTHERREKEYNEEDED_3
    | 4 // IDENTIFY_4
    | 5 // TRANSIENT_5
    | 6 // NONE_6
  
  export type ConversationExistence =
    | 0 // ACTIVE_0
    | 1 // ARCHIVED_1
    | 2 // DELETED_2
    | 3 // ABANDONED_3
  
  export type ConversationFinalizeInfo = $ReadOnly<{resetUser: String, resetDate: String, resetFull: String, resetTimestamp: Gregor1.Time}>
  
  export type ConversationID = Bytes
  
  export type ConversationIDMessageIDPair = $ReadOnly<{convID: ConversationID, msgID: MessageID}>
  
  export type ConversationIDMessageIDPairs = $ReadOnly<{pairs?: ?Array<ConversationIDMessageIDPair>}>
  
  export type ConversationIDTriple = $ReadOnly<{tlfid: TLFID, topicType: TopicType, topicID: TopicID}>
  
  export type ConversationInfoLocal = $ReadOnly<{id: ConversationID, triple: ConversationIDTriple, tlfName: String, topicName: String, visibility: Keybase1.TLFVisibility, status: ConversationStatus, membersType: ConversationMembersType, memberStatus: ConversationMemberStatus, teamType: TeamType, existence: ConversationExistence, version: ConversationVers, participants?: ?Array<ConversationLocalParticipant>, finalizeInfo?: ?ConversationFinalizeInfo, resetNames?: ?Array<String>}>
  
  export type ConversationLocal = $ReadOnly<{error?: ?ConversationErrorLocal, info: ConversationInfoLocal, readerInfo: ConversationReaderInfo, creatorInfo?: ?ConversationCreatorInfoLocal, notifications?: ?ConversationNotificationInfo, supersedes?: ?Array<ConversationMetadata>, supersededBy?: ?Array<ConversationMetadata>, maxMessages?: ?Array<MessageUnboxed>, isEmpty: Boolean, identifyFailures?: ?Array<Keybase1.TLFIdentifyFailure>, expunge: Expunge, convRetention?: ?RetentionPolicy, teamRetention?: ?RetentionPolicy}>
  
  export type ConversationLocalParticipant = $ReadOnly<{username: String, fullname?: ?String}>
  
  export type ConversationMember = $ReadOnly<{uid: Gregor1.UID, convID: ConversationID}>
  
  export type ConversationMemberStatus =
    | 0 // ACTIVE_0
    | 1 // REMOVED_1
    | 2 // LEFT_2
    | 3 // PREVIEW_3
    | 4 // RESET_4
  
  export type ConversationMembersType =
    | 0 // KBFS_0
    | 1 // TEAM_1
    | 2 // IMPTEAMNATIVE_2
    | 3 // IMPTEAMUPGRADE_3
  
  export type ConversationMetadata = $ReadOnly<{idTriple: ConversationIDTriple, conversationID: ConversationID, visibility: Keybase1.TLFVisibility, status: ConversationStatus, membersType: ConversationMembersType, teamType: TeamType, existence: ConversationExistence, version: ConversationVers, finalizeInfo?: ?ConversationFinalizeInfo, supersedes?: ?Array<ConversationMetadata>, supersededBy?: ?Array<ConversationMetadata>, activeList?: ?Array<Gregor1.UID>, allList?: ?Array<Gregor1.UID>, resetList?: ?Array<Gregor1.UID>}>
  
  export type ConversationNotificationInfo = $ReadOnly<{channelWide: Boolean, settings: {[key: string]: {[key: string]: Boolean}}}>
  
  export type ConversationReaderInfo = $ReadOnly<{mtime: Gregor1.Time, readMsgid: MessageID, maxMsgid: MessageID, status: ConversationMemberStatus}>
  
  export type ConversationResolveInfo = $ReadOnly<{newTLFName: String}>
  
  export type ConversationStaleUpdate = $ReadOnly<{convID: ConversationID, updateType: StaleUpdateType}>
  
  export type ConversationStatus =
    | 0 // UNFILED_0
    | 1 // FAVORITE_1
    | 2 // IGNORED_2
    | 3 // BLOCKED_3
    | 4 // MUTED_4
    | 5 // REPORTED_5
  
  export type ConversationVers = Uint64
  
  export type DeleteConversationLocalRes = $ReadOnly<{offline: Boolean, rateLimits?: ?Array<RateLimit>}>
  
  export type DeleteConversationRemoteRes = $ReadOnly<{rateLimit?: ?RateLimit}>
  
  export type DownloadAttachmentLocalRes = $ReadOnly<{offline: Boolean, rateLimits?: ?Array<RateLimit>, identifyFailures?: ?Array<Keybase1.TLFIdentifyFailure>}>
  
  export type EncryptedData = $ReadOnly<{v: Int, e: Bytes, n: Bytes}>
  
  export type EphemeralPurgeInfo = $ReadOnly<{isActive: Boolean, nextPurgeTime: Gregor1.Time, minUnexplodedID: MessageID}>
  
  export type Expunge = $ReadOnly<{upto: MessageID, basis: MessageID}>
  
  export type ExpungeInfo = $ReadOnly<{convID: ConversationID, expunge: Expunge}>
  
  export type ExpungePayload = $ReadOnly<{Action: String, convID: ConversationID, inboxVers: InboxVers, expunge: Expunge, maxMsgs?: ?Array<MessageSummary>, unreadUpdate?: ?UnreadUpdate}>
  
  export type FailedMessageInfo = $ReadOnly<{outboxRecords?: ?Array<OutboxRecord>, isEphemeralPurge: Boolean}>
  
  export type FindConversationsLocalRes = $ReadOnly<{conversations?: ?Array<ConversationLocal>, offline: Boolean, rateLimits?: ?Array<RateLimit>, identifyFailures?: ?Array<Keybase1.TLFIdentifyFailure>}>
  
  export type GenericPayload = $ReadOnly<{Action: String, inboxVers: InboxVers, convID: ConversationID, unreadUpdate?: ?UnreadUpdate}>
  
  export type GetConversationForCLILocalQuery = $ReadOnly<{markAsRead: Boolean, MessageTypes?: ?Array<MessageType>, Since?: ?String, limit: UnreadFirstNumLimit, conv: ConversationLocal}>
  
  export type GetConversationForCLILocalRes = $ReadOnly<{conversation: ConversationLocal, messages?: ?Array<MessageUnboxed>, offline: Boolean, rateLimits?: ?Array<RateLimit>}>
  
  export type GetConversationMetadataRemoteRes = $ReadOnly<{conv: Conversation, rateLimit?: ?RateLimit}>
  
  export type GetInboxAndUnboxLocalRes = $ReadOnly<{conversations?: ?Array<ConversationLocal>, pagination?: ?Pagination, offline: Boolean, rateLimits?: ?Array<RateLimit>, identifyFailures?: ?Array<Keybase1.TLFIdentifyFailure>}>
  
  export type GetInboxByTLFIDRemoteRes = $ReadOnly<{convs?: ?Array<Conversation>, rateLimit?: ?RateLimit}>
  
  export type GetInboxLocalQuery = $ReadOnly<{name?: ?NameQuery, topicName?: ?String, convIDs?: ?Array<ConversationID>, topicType?: ?TopicType, tlfVisibility?: ?Keybase1.TLFVisibility, before?: ?Gregor1.Time, after?: ?Gregor1.Time, oneChatTypePerTLF?: ?Boolean, status?: ?Array<ConversationStatus>, unreadOnly: Boolean, readOnly: Boolean, computeActiveList: Boolean}>
  
  export type GetInboxLocalRes = $ReadOnly<{conversationsUnverified?: ?Array<Conversation>, pagination?: ?Pagination, offline: Boolean, rateLimits?: ?Array<RateLimit>, identifyFailures?: ?Array<Keybase1.TLFIdentifyFailure>}>
  
  export type GetInboxQuery = $ReadOnly<{convID?: ?ConversationID, topicType?: ?TopicType, tlfID?: ?TLFID, tlfVisibility?: ?Keybase1.TLFVisibility, before?: ?Gregor1.Time, after?: ?Gregor1.Time, oneChatTypePerTLF?: ?Boolean, status?: ?Array<ConversationStatus>, memberStatus?: ?Array<ConversationMemberStatus>, existences?: ?Array<ConversationExistence>, membersTypes?: ?Array<ConversationMembersType>, convIDs?: ?Array<ConversationID>, unreadOnly: Boolean, readOnly: Boolean, computeActiveList: Boolean, summarizeMaxMsgs: Boolean}>
  
  export type GetInboxRemoteRes = $ReadOnly<{inbox: InboxView, rateLimit?: ?RateLimit}>
  
  export type GetInboxSummaryForCLILocalQuery = $ReadOnly<{topicType: TopicType, after: String, before: String, visibility: Keybase1.TLFVisibility, status?: ?Array<ConversationStatus>, unreadFirst: Boolean, unreadFirstLimit: UnreadFirstNumLimit, activitySortedLimit: Int}>
  
  export type GetInboxSummaryForCLILocalRes = $ReadOnly<{conversations?: ?Array<ConversationLocal>, offline: Boolean, rateLimits?: ?Array<RateLimit>}>
  
  export type GetMessageBeforeRes = $ReadOnly<{msgID: MessageID, rateLimit?: ?RateLimit}>
  
  export type GetMessagesLocalRes = $ReadOnly<{messages?: ?Array<MessageUnboxed>, offline: Boolean, rateLimits?: ?Array<RateLimit>, identifyFailures?: ?Array<Keybase1.TLFIdentifyFailure>}>
  
  export type GetMessagesRemoteRes = $ReadOnly<{msgs?: ?Array<MessageBoxed>, rateLimit?: ?RateLimit}>
  
  export type GetPublicConversationsRes = $ReadOnly<{conversations?: ?Array<Conversation>, rateLimit?: ?RateLimit}>
  
  export type GetSearchRegexpRes = $ReadOnly<{hits?: ?Array<ChatSearchHit>, rateLimits?: ?Array<RateLimit>, identifyFailures?: ?Array<Keybase1.TLFIdentifyFailure>}>
  
  export type GetTLFConversationsLocalRes = $ReadOnly<{convs?: ?Array<InboxUIItem>, offline: Boolean, rateLimits?: ?Array<RateLimit>}>
  
  export type GetTLFConversationsRes = $ReadOnly<{conversations?: ?Array<Conversation>, rateLimit?: ?RateLimit}>
  
  export type GetThreadLocalRes = $ReadOnly<{thread: ThreadView, offline: Boolean, rateLimits?: ?Array<RateLimit>, identifyFailures?: ?Array<Keybase1.TLFIdentifyFailure>}>
  
  export type GetThreadNonblockCbMode =
    | 0 // FULL_0
    | 1 // INCREMENTAL_1
  
  export type GetThreadNonblockReason =
    | 0 // GENERAL_0
    | 1 // PUSH_1
  
  export type GetThreadQuery = $ReadOnly<{markAsRead: Boolean, messageTypes?: ?Array<MessageType>, disableResolveSupersedes: Boolean, before?: ?Gregor1.Time, after?: ?Gregor1.Time, messageIDControl?: ?MessageIDControl}>
  
  export type GetThreadRemoteRes = $ReadOnly<{thread: ThreadViewBoxed, membersType: ConversationMembersType, visibility: Keybase1.TLFVisibility, rateLimit?: ?RateLimit}>
  
  export type GlobalAppNotificationSetting =
    | 0 // NEWMESSAGES_0
    | 1 // PLAINTEXTMOBILE_1
    | 2 // PLAINTEXTDESKTOP_2
  
  export type GlobalAppNotificationSettings = $ReadOnly<{settings: {[key: string]: Bool}}>
  
  export type Hash = Bytes
  
  export type HeaderPlaintext = {version: 1, v1: ?HeaderPlaintextV1} | {version: 2, v2: ?HeaderPlaintextUnsupported} | {version: 3, v3: ?HeaderPlaintextUnsupported} | {version: 4, v4: ?HeaderPlaintextUnsupported} | {version: 5, v5: ?HeaderPlaintextUnsupported} | {version: 6, v6: ?HeaderPlaintextUnsupported} | {version: 7, v7: ?HeaderPlaintextUnsupported} | {version: 8, v8: ?HeaderPlaintextUnsupported} | {version: 9, v9: ?HeaderPlaintextUnsupported} | {version: 10, v10: ?HeaderPlaintextUnsupported}
  
  export type HeaderPlaintextMetaInfo = $ReadOnly<{crit: Boolean}>
  
  export type HeaderPlaintextUnsupported = $ReadOnly<{mi: HeaderPlaintextMetaInfo}>
  
  export type HeaderPlaintextV1 = $ReadOnly<{conv: ConversationIDTriple, tlfName: String, tlfPublic: Boolean, messageType: MessageType, prev?: ?Array<MessagePreviousPointer>, sender: Gregor1.UID, senderDevice: Gregor1.DeviceID, kbfsCryptKeysUsed?: ?Boolean, bodyHash: Hash, outboxInfo?: ?OutboxInfo, outboxID?: ?OutboxID, headerSignature?: ?SignatureInfo, merkleRoot?: ?MerkleRoot, ephemeralMetadata?: ?MsgEphemeralMetadata}>
  
  export type HeaderPlaintextVersion =
    | 1 // V1_1
    | 2 // V2_2
    | 3 // V3_3
    | 4 // V4_4
    | 5 // V5_5
    | 6 // V6_6
    | 7 // V7_7
    | 8 // V8_8
    | 9 // V9_9
    | 10 // V10_10
  
  export type InboxResType =
    | 0 // VERSIONHIT_0
    | 1 // FULL_1
  
  export type InboxUIItem = $ReadOnly<{convID: String, isEmpty: Boolean, name: String, snippet: String, channel: String, headline: String, visibility: Keybase1.TLFVisibility, participants?: ?Array<String>, fullNames: {[key: string]: String}, resetParticipants?: ?Array<String>, status: ConversationStatus, membersType: ConversationMembersType, memberStatus: ConversationMemberStatus, teamType: TeamType, time: Gregor1.Time, notifications?: ?ConversationNotificationInfo, creatorInfo?: ?ConversationCreatorInfoLocal, version: ConversationVers, maxMsgID: MessageID, convRetention?: ?RetentionPolicy, teamRetention?: ?RetentionPolicy, finalizeInfo?: ?ConversationFinalizeInfo, supersedes?: ?Array<ConversationMetadata>, supersededBy?: ?Array<ConversationMetadata>}>
  
  export type InboxUIItemError = $ReadOnly<{typ: ConversationErrorType, message: String, unverifiedTLFName: String, rekeyInfo?: ?ConversationErrorRekey, remoteConv: UnverifiedInboxUIItem}>
  
  export type InboxUIItems = $ReadOnly<{items?: ?Array<InboxUIItem>, pagination?: ?UIPagination, offline: Boolean}>
  
  export type InboxVers = Uint64
  
  export type InboxVersInfo = $ReadOnly<{uid: Gregor1.UID, vers: InboxVers}>
  
  export type InboxView = {rtype: 0} | {rtype: 1, full: ?InboxViewFull}
  
  export type InboxViewFull = $ReadOnly<{vers: InboxVers, conversations?: ?Array<Conversation>, pagination?: ?Pagination}>
  
  export type IncomingMessage = $ReadOnly<{message: UIMessage, convID: ConversationID, displayDesktopNotification: Boolean, conv?: ?InboxUIItem, pagination?: ?UIPagination}>
  
  export type JoinLeaveConversationLocalRes = $ReadOnly<{offline: Boolean, rateLimits?: ?Array<RateLimit>}>
  
  export type JoinLeaveConversationRemoteRes = $ReadOnly<{rateLimit?: ?RateLimit}>
  
  export type KBFSImpteamUpgradeUpdate = $ReadOnly<{convID: ConversationID, inboxVers: InboxVers}>
  
  export type LocalAddTeamMemberAfterResetRpcParam = $ReadOnly<{username: String, convID: ConversationID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalCancelPostRpcParam = $ReadOnly<{outboxID: OutboxID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalDeleteConversationLocalRpcParam = $ReadOnly<{convID: ConversationID, channelName: String, confirmed: Boolean, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalDownloadAttachmentLocalRpcParam = $ReadOnly<{conversationID: ConversationID, messageID: MessageID, sink: Keybase1.Stream, preview: Boolean, identifyBehavior: Keybase1.TLFIdentifyBehavior, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalDownloadFileAttachmentLocalRpcParam = $ReadOnly<{conversationID: ConversationID, messageID: MessageID, filename: String, preview: Boolean, identifyBehavior: Keybase1.TLFIdentifyBehavior, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalFileSource = $ReadOnly<{filename: String}>
  
  export type LocalFindConversationsLocalRpcParam = $ReadOnly<{tlfName: String, membersType: ConversationMembersType, visibility: Keybase1.TLFVisibility, topicType: TopicType, topicName: String, oneChatPerTLF?: ?Boolean, identifyBehavior: Keybase1.TLFIdentifyBehavior, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalGenerateOutboxIDRpcParam = ?$ReadOnly<{incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalGetCachedThreadRpcParam = $ReadOnly<{conversationID: ConversationID, query?: ?GetThreadQuery, pagination?: ?Pagination, identifyBehavior: Keybase1.TLFIdentifyBehavior, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalGetConversationForCLILocalRpcParam = $ReadOnly<{query: GetConversationForCLILocalQuery, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalGetGlobalAppNotificationSettingsLocalRpcParam = ?$ReadOnly<{incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalGetInboxAndUnboxLocalRpcParam = $ReadOnly<{query?: ?GetInboxLocalQuery, pagination?: ?Pagination, identifyBehavior: Keybase1.TLFIdentifyBehavior, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalGetInboxNonblockLocalRpcParam = $ReadOnly<{maxUnbox?: ?Int, skipUnverified: Boolean, query?: ?GetInboxLocalQuery, pagination?: ?Pagination, identifyBehavior: Keybase1.TLFIdentifyBehavior, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalGetInboxSummaryForCLILocalRpcParam = $ReadOnly<{query: GetInboxSummaryForCLILocalQuery, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalGetMessagesLocalRpcParam = $ReadOnly<{conversationID: ConversationID, messageIDs?: ?Array<MessageID>, disableResolveSupersedes: Boolean, identifyBehavior: Keybase1.TLFIdentifyBehavior, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalGetSearchRegexpRpcParam = $ReadOnly<{conversationID: ConversationID, query: String, isRegex: Boolean, maxHits: Int, maxMessages: Int, identifyBehavior: Keybase1.TLFIdentifyBehavior, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalGetTLFConversationsLocalRpcParam = $ReadOnly<{tlfName: String, topicType: TopicType, membersType: ConversationMembersType, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalGetTeamRetentionLocalRpcParam = $ReadOnly<{teamID: Keybase1.TeamID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalGetThreadLocalRpcParam = $ReadOnly<{conversationID: ConversationID, query?: ?GetThreadQuery, pagination?: ?Pagination, identifyBehavior: Keybase1.TLFIdentifyBehavior, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalGetThreadNonblockRpcParam = $ReadOnly<{conversationID: ConversationID, cbMode: GetThreadNonblockCbMode, reason: GetThreadNonblockReason, query?: ?GetThreadQuery, pagination?: ?UIPagination, identifyBehavior: Keybase1.TLFIdentifyBehavior, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalJoinConversationByIDLocalRpcParam = $ReadOnly<{convID: ConversationID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalJoinConversationLocalRpcParam = $ReadOnly<{tlfName: String, topicType: TopicType, visibility: Keybase1.TLFVisibility, topicName: String, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalLeaveConversationLocalRpcParam = $ReadOnly<{convID: ConversationID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalMakePreviewRpcParam = $ReadOnly<{attachment: LocalFileSource, outputDir: String, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalMarkAsReadLocalRpcParam = $ReadOnly<{conversationID: ConversationID, msgID: MessageID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalNewConversationLocalRpcParam = $ReadOnly<{tlfName: String, topicType: TopicType, tlfVisibility: Keybase1.TLFVisibility, topicName?: ?String, membersType: ConversationMembersType, identifyBehavior: Keybase1.TLFIdentifyBehavior, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalPostAttachmentLocalRpcParam = $ReadOnly<{conversationID: ConversationID, tlfName: String, visibility: Keybase1.TLFVisibility, attachment: LocalSource, preview?: ?MakePreviewRes, title: String, metadata: Bytes, identifyBehavior: Keybase1.TLFIdentifyBehavior, outboxID?: ?OutboxID, ephemeralLifetime?: ?Gregor1.DurationSec, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalPostDeleteHistoryByAgeRpcParam = $ReadOnly<{conversationID: ConversationID, tlfName: String, tlfPublic: Boolean, identifyBehavior: Keybase1.TLFIdentifyBehavior, age: Gregor1.DurationSec, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalPostDeleteHistoryThroughRpcParam = $ReadOnly<{conversationID: ConversationID, tlfName: String, tlfPublic: Boolean, identifyBehavior: Keybase1.TLFIdentifyBehavior, through: MessageID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalPostDeleteHistoryUptoRpcParam = $ReadOnly<{conversationID: ConversationID, tlfName: String, tlfPublic: Boolean, identifyBehavior: Keybase1.TLFIdentifyBehavior, upto: MessageID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalPostDeleteNonblockRpcParam = $ReadOnly<{conversationID: ConversationID, tlfName: String, tlfPublic: Boolean, supersedes: MessageID, clientPrev: MessageID, outboxID?: ?OutboxID, identifyBehavior: Keybase1.TLFIdentifyBehavior, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalPostEditNonblockRpcParam = $ReadOnly<{conversationID: ConversationID, tlfName: String, tlfPublic: Boolean, supersedes: MessageID, body: String, outboxID?: ?OutboxID, clientPrev: MessageID, identifyBehavior: Keybase1.TLFIdentifyBehavior, ephemeralLifetime?: ?Gregor1.DurationSec, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalPostFileAttachmentLocalRpcParam = $ReadOnly<{conversationID: ConversationID, tlfName: String, visibility: Keybase1.TLFVisibility, attachment: LocalFileSource, preview?: ?MakePreviewRes, title: String, metadata: Bytes, identifyBehavior: Keybase1.TLFIdentifyBehavior, outboxID?: ?OutboxID, ephemeralLifetime?: ?Gregor1.DurationSec, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalPostHeadlineNonblockRpcParam = $ReadOnly<{conversationID: ConversationID, tlfName: String, tlfPublic: Boolean, headline: String, outboxID?: ?OutboxID, clientPrev: MessageID, identifyBehavior: Keybase1.TLFIdentifyBehavior, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalPostHeadlineRpcParam = $ReadOnly<{conversationID: ConversationID, tlfName: String, tlfPublic: Boolean, headline: String, identifyBehavior: Keybase1.TLFIdentifyBehavior, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalPostLocalNonblockRpcParam = $ReadOnly<{conversationID: ConversationID, msg: MessagePlaintext, clientPrev: MessageID, outboxID?: ?OutboxID, identifyBehavior: Keybase1.TLFIdentifyBehavior, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalPostLocalRpcParam = $ReadOnly<{conversationID: ConversationID, msg: MessagePlaintext, identifyBehavior: Keybase1.TLFIdentifyBehavior, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalPostMetadataNonblockRpcParam = $ReadOnly<{conversationID: ConversationID, tlfName: String, tlfPublic: Boolean, channelName: String, outboxID?: ?OutboxID, clientPrev: MessageID, identifyBehavior: Keybase1.TLFIdentifyBehavior, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalPostMetadataRpcParam = $ReadOnly<{conversationID: ConversationID, tlfName: String, tlfPublic: Boolean, channelName: String, identifyBehavior: Keybase1.TLFIdentifyBehavior, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalPostTextNonblockRpcParam = $ReadOnly<{conversationID: ConversationID, tlfName: String, tlfPublic: Boolean, body: String, clientPrev: MessageID, outboxID?: ?OutboxID, identifyBehavior: Keybase1.TLFIdentifyBehavior, ephemeralLifetime?: ?Gregor1.DurationSec, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalPreviewConversationByIDLocalRpcParam = $ReadOnly<{convID: ConversationID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalRetryPostRpcParam = $ReadOnly<{outboxID: OutboxID, identifyBehavior?: ?Keybase1.TLFIdentifyBehavior, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalSetAppNotificationSettingsLocalRpcParam = $ReadOnly<{convID: ConversationID, channelWide: Boolean, settings?: ?Array<AppNotificationSettingLocal>, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalSetConvRetentionLocalRpcParam = $ReadOnly<{convID: ConversationID, policy: RetentionPolicy, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalSetConversationStatusLocalRpcParam = $ReadOnly<{conversationID: ConversationID, status: ConversationStatus, identifyBehavior: Keybase1.TLFIdentifyBehavior, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalSetGlobalAppNotificationSettingsLocalRpcParam = $ReadOnly<{settings: {[key: string]: Bool}, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalSetTeamRetentionLocalRpcParam = $ReadOnly<{teamID: Keybase1.TeamID, policy: RetentionPolicy, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalSource = $ReadOnly<{source: Keybase1.Stream, filename: String, size: Int}>
  
  export type LocalUnboxMobilePushNotificationRpcParam = $ReadOnly<{payload: String, convID: String, membersType: ConversationMembersType, pushIDs?: ?Array<String>, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalUpdateTypingRpcParam = $ReadOnly<{conversationID: ConversationID, typing: Boolean, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type LocalUpgradeKBFSConversationToImpteamRpcParam = $ReadOnly<{convID: ConversationID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type MakePreviewRes = $ReadOnly<{mimeType: String, filename?: ?String, metadata?: ?AssetMetadata, baseMetadata?: ?AssetMetadata}>
  
  export type MarkAsReadLocalRes = $ReadOnly<{offline: Boolean, rateLimits?: ?Array<RateLimit>}>
  
  export type MarkAsReadRes = $ReadOnly<{rateLimit?: ?RateLimit}>
  
  export type MembersUpdateInfo = $ReadOnly<{convID: ConversationID, member: String, status: ConversationMemberStatus}>
  
  export type MerkleRoot = $ReadOnly<{seqno: Long, hash: Bytes}>
  
  export type MessageAttachment = $ReadOnly<{object: Asset, preview?: ?Asset, previews?: ?Array<Asset>, metadata: Bytes, uploaded: Boolean}>
  
  export type MessageAttachmentUploaded = $ReadOnly<{messageID: MessageID, object: Asset, previews?: ?Array<Asset>, metadata: Bytes}>
  
  export type MessageBody = {messageType: 1, text: ?MessageText} | {messageType: 2, attachment: ?MessageAttachment} | {messageType: 3, edit: ?MessageEdit} | {messageType: 4, delete: ?MessageDelete} | {messageType: 5, metadata: ?MessageConversationMetadata} | {messageType: 7, headline: ?MessageHeadline} | {messageType: 8, attachmentuploaded: ?MessageAttachmentUploaded} | {messageType: 9, join: ?MessageJoin} | {messageType: 10, leave: ?MessageLeave} | {messageType: 11, system: ?MessageSystem} | {messageType: 12, deletehistory: ?MessageDeleteHistory}
  
  export type MessageBoxed = $ReadOnly<{version: MessageBoxedVersion, serverHeader?: ?MessageServerHeader, clientHeader: MessageClientHeader, headerCiphertext: SealedData, bodyCiphertext: EncryptedData, verifyKey: Bytes, keyGeneration: Int}>
  
  export type MessageBoxedVersion =
    | 0 // VNONE_0
    | 1 // V1_1
    | 2 // V2_2
    | 3 // V3_3
  
  export type MessageClientHeader = $ReadOnly<{conv: ConversationIDTriple, tlfName: String, tlfPublic: Boolean, messageType: MessageType, supersedes: MessageID, kbfsCryptKeysUsed?: ?Boolean, deletes?: ?Array<MessageID>, prev?: ?Array<MessagePreviousPointer>, deleteHistory?: ?MessageDeleteHistory, sender: Gregor1.UID, senderDevice: Gregor1.DeviceID, merkleRoot?: ?MerkleRoot, outboxID?: ?OutboxID, outboxInfo?: ?OutboxInfo, ephemeralMetadata?: ?MsgEphemeralMetadata}>
  
  export type MessageClientHeaderVerified = $ReadOnly<{conv: ConversationIDTriple, tlfName: String, tlfPublic: Boolean, messageType: MessageType, prev?: ?Array<MessagePreviousPointer>, sender: Gregor1.UID, senderDevice: Gregor1.DeviceID, kbfsCryptKeysUsed?: ?Boolean, merkleRoot?: ?MerkleRoot, outboxID?: ?OutboxID, outboxInfo?: ?OutboxInfo, ephemeralMetadata?: ?MsgEphemeralMetadata, rtime: Gregor1.Time}>
  
  export type MessageConversationMetadata = $ReadOnly<{conversationTitle: String}>
  
  export type MessageDelete = $ReadOnly<{messageIDs?: ?Array<MessageID>}>
  
  export type MessageDeleteHistory = $ReadOnly<{upto: MessageID}>
  
  export type MessageEdit = $ReadOnly<{messageID: MessageID, body: String}>
  
  export type MessageHeadline = $ReadOnly<{headline: String}>
  
  export type MessageID = Uint
  
  export type MessageIDControl = $ReadOnly<{pivot?: ?MessageID, recent: Boolean, num: Int}>
  
  export type MessageJoin = $ReadOnly<{}>
  
  export type MessageLeave = $ReadOnly<{}>
  
  export type MessagePlaintext = $ReadOnly<{clientHeader: MessageClientHeader, messageBody: MessageBody}>
  
  export type MessagePreviousPointer = $ReadOnly<{id: MessageID, hash: Hash}>
  
  export type MessageServerHeader = $ReadOnly<{messageID: MessageID, supersededBy: MessageID, ctime: Gregor1.Time, now: Gregor1.Time}>
  
  export type MessageSummary = $ReadOnly<{msgID: MessageID, messageType: MessageType, tlfName: String, tlfPublic: Boolean, ctime: Gregor1.Time}>
  
  export type MessageSystem = {systemType: 0, addedtoteam: ?MessageSystemAddedToTeam} | {systemType: 1, inviteaddedtoteam: ?MessageSystemInviteAddedToTeam} | {systemType: 2, complexteam: ?MessageSystemComplexTeam} | {systemType: 3, createteam: ?MessageSystemCreateTeam} | {systemType: 4, gitpush: ?MessageSystemGitPush}
  
  export type MessageSystemAddedToTeam = $ReadOnly<{team: String, adder: String, addee: String, owners?: ?Array<String>, admins?: ?Array<String>, writers?: ?Array<String>, readers?: ?Array<String>}>
  
  export type MessageSystemComplexTeam = $ReadOnly<{team: String}>
  
  export type MessageSystemCreateTeam = $ReadOnly<{team: String, creator: String}>
  
  export type MessageSystemGitPush = $ReadOnly<{team: String, pusher: String, repoName: String, repoID: Keybase1.RepoID, refs?: ?Array<Keybase1.GitRefMetadata>, pushType: Keybase1.GitPushType, previousRepoName: String}>
  
  export type MessageSystemInviteAddedToTeam = $ReadOnly<{team: String, inviter: String, invitee: String, adder: String, inviteType: Keybase1.TeamInviteCategory}>
  
  export type MessageSystemType =
    | 0 // ADDEDTOTEAM_0
    | 1 // INVITEADDEDTOTEAM_1
    | 2 // COMPLEXTEAM_2
    | 3 // CREATETEAM_3
    | 4 // GITPUSH_4
  
  export type MessageText = $ReadOnly<{body: String}>
  
  export type MessageType =
    | 0 // NONE_0
    | 1 // TEXT_1
    | 2 // ATTACHMENT_2
    | 3 // EDIT_3
    | 4 // DELETE_4
    | 5 // METADATA_5
    | 6 // TLFNAME_6
    | 7 // HEADLINE_7
    | 8 // ATTACHMENTUPLOADED_8
    | 9 // JOIN_9
    | 10 // LEAVE_10
    | 11 // SYSTEM_11
    | 12 // DELETEHISTORY_12
  
  export type MessageUnboxed = {state: 1, valid: ?MessageUnboxedValid} | {state: 2, error: ?MessageUnboxedError} | {state: 3, outbox: ?OutboxRecord} | {state: 4, placeholder: ?MessageUnboxedPlaceholder}
  
  export type MessageUnboxedError = $ReadOnly<{errType: MessageUnboxedErrorType, errMsg: String, messageID: MessageID, messageType: MessageType, ctime: Gregor1.Time}>
  
  export type MessageUnboxedErrorType =
    | 0 // MISC_0
    | 1 // BADVERSION_CRITICAL_1
    | 2 // BADVERSION_2
    | 3 // IDENTIFY_3
  
  export type MessageUnboxedPlaceholder = $ReadOnly<{messageID: MessageID}>
  
  export type MessageUnboxedState =
    | 1 // VALID_1
    | 2 // ERROR_2
    | 3 // OUTBOX_3
    | 4 // PLACEHOLDER_4
  
  export type MessageUnboxedValid = $ReadOnly<{clientHeader: MessageClientHeaderVerified, serverHeader: MessageServerHeader, messageBody: MessageBody, senderUsername: String, senderDeviceName: String, senderDeviceType: String, bodyHash: Hash, headerHash: Hash, headerSignature?: ?SignatureInfo, verificationKey?: ?Bytes, senderDeviceRevokedAt?: ?Gregor1.Time, atMentionUsernames?: ?Array<String>, atMentions?: ?Array<Gregor1.UID>, channelMention: ChannelMention, channelNameMentions?: ?Array<ChannelNameMention>}>
  
  export type MsgEphemeralMetadata = $ReadOnly<{lifetime: Gregor1.DurationSec, generation: Keybase1.EkGeneration}>
  
  export type NameQuery = $ReadOnly<{name: String, membersType: ConversationMembersType}>
  
  export type NewConversationInfo = $ReadOnly<{conv: InboxUIItem}>
  
  export type NewConversationLocalRes = $ReadOnly<{conv: ConversationLocal, rateLimits?: ?Array<RateLimit>, identifyFailures?: ?Array<Keybase1.TLFIdentifyFailure>}>
  
  export type NewConversationPayload = $ReadOnly<{Action: String, convID: ConversationID, inboxVers: InboxVers, unreadUpdate?: ?UnreadUpdate}>
  
  export type NewConversationRemoteRes = $ReadOnly<{convID: ConversationID, createdComplexTeam: Boolean, rateLimit?: ?RateLimit}>
  
  export type NewMessagePayload = $ReadOnly<{Action: String, convID: ConversationID, message: MessageBoxed, inboxVers: InboxVers, unreadUpdate?: ?UnreadUpdate, maxMsgs?: ?Array<MessageSummary>}>
  
  export type NonblockFetchRes = $ReadOnly<{offline: Boolean, rateLimits?: ?Array<RateLimit>, identifyFailures?: ?Array<Keybase1.TLFIdentifyFailure>}>
  
  export type NotificationKind =
    | 0 // GENERIC_0
    | 1 // ATMENTION_1
  
  export type NotifyChatChatIdentifyUpdateRpcParam = $ReadOnly<{update: Keybase1.CanonicalTLFNameAndIDWithBreaks, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type NotifyChatChatInboxStaleRpcParam = $ReadOnly<{uid: Keybase1.UID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type NotifyChatChatInboxSyncStartedRpcParam = $ReadOnly<{uid: Keybase1.UID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type NotifyChatChatInboxSyncedRpcParam = $ReadOnly<{uid: Keybase1.UID, syncRes: ChatSyncResult, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type NotifyChatChatJoinedConversationRpcParam = $ReadOnly<{uid: Keybase1.UID, conv: InboxUIItem, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type NotifyChatChatKBFSToImpteamUpgradeRpcParam = $ReadOnly<{uid: Keybase1.UID, convID: ConversationID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type NotifyChatChatLeftConversationRpcParam = $ReadOnly<{uid: Keybase1.UID, convID: ConversationID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type NotifyChatChatResetConversationRpcParam = $ReadOnly<{uid: Keybase1.UID, convID: ConversationID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type NotifyChatChatSetConvRetentionRpcParam = $ReadOnly<{uid: Keybase1.UID, convID: ConversationID, conv?: ?InboxUIItem, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type NotifyChatChatSetTeamRetentionRpcParam = $ReadOnly<{uid: Keybase1.UID, teamID: Keybase1.TeamID, convs?: ?Array<InboxUIItem>, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type NotifyChatChatTLFFinalizeRpcParam = $ReadOnly<{uid: Keybase1.UID, convID: ConversationID, finalizeInfo: ConversationFinalizeInfo, conv?: ?InboxUIItem, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type NotifyChatChatTLFResolveRpcParam = $ReadOnly<{uid: Keybase1.UID, convID: ConversationID, resolveInfo: ConversationResolveInfo, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type NotifyChatChatThreadsStaleRpcParam = $ReadOnly<{uid: Keybase1.UID, updates?: ?Array<ConversationStaleUpdate>, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type NotifyChatChatTypingUpdateRpcParam = $ReadOnly<{typingUpdates?: ?Array<ConvTypingUpdate>, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type NotifyChatNewChatActivityRpcParam = $ReadOnly<{uid: Keybase1.UID, activity: ChatActivity, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type OutboxErrorType =
    | 0 // MISC_0
    | 1 // OFFLINE_1
    | 2 // IDENTIFY_2
    | 3 // TOOLONG_3
    | 4 // DUPLICATE_4
    | 5 // EXPIRED_5
  
  export type OutboxID = Bytes
  
  export type OutboxInfo = $ReadOnly<{prev: MessageID, composeTime: Gregor1.Time}>
  
  export type OutboxRecord = $ReadOnly<{state: OutboxState, outboxID: OutboxID, convID: ConversationID, ctime: Gregor1.Time, Msg: MessagePlaintext, identifyBehavior: Keybase1.TLFIdentifyBehavior, ordinal: Int}>
  
  export type OutboxState = {state: 0, sending: ?Int} | {state: 1, error: ?OutboxStateError}
  
  export type OutboxStateError = $ReadOnly<{message: String, typ: OutboxErrorType}>
  
  export type OutboxStateType =
    | 0 // SENDING_0
    | 1 // ERROR_1
  
  export type Pagination = $ReadOnly<{next: Bytes, previous: Bytes, num: Int, last: Boolean}>
  
  export type PostLocalNonblockRes = $ReadOnly<{rateLimits?: ?Array<RateLimit>, outboxID: OutboxID, identifyFailures?: ?Array<Keybase1.TLFIdentifyFailure>}>
  
  export type PostLocalRes = $ReadOnly<{rateLimits?: ?Array<RateLimit>, messageID: MessageID, identifyFailures?: ?Array<Keybase1.TLFIdentifyFailure>}>
  
  export type PostRemoteRes = $ReadOnly<{msgHeader: MessageServerHeader, rateLimit?: ?RateLimit}>
  
  export type RateLimit = $ReadOnly<{name: String, callsRemaining: Int, windowReset: Int, maxCalls: Int}>
  
  export type ReadMessageInfo = $ReadOnly<{convID: ConversationID, msgID: MessageID, conv?: ?InboxUIItem}>
  
  export type ReadMessagePayload = $ReadOnly<{Action: String, convID: ConversationID, msgID: MessageID, inboxVers: InboxVers, unreadUpdate?: ?UnreadUpdate}>
  
  export type RemoteDeleteConversationRpcParam = $ReadOnly<{convID: ConversationID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteGetGlobalAppNotificationSettingsRpcParam = ?$ReadOnly<{incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteGetInboxRemoteRpcParam = $ReadOnly<{vers: InboxVers, query?: ?GetInboxQuery, pagination?: ?Pagination, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteGetInboxVersionRpcParam = $ReadOnly<{uid: Gregor1.UID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteGetMessageBeforeRpcParam = $ReadOnly<{convID: ConversationID, age: Gregor1.DurationSec, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteGetMessagesRemoteRpcParam = $ReadOnly<{conversationID: ConversationID, messageIDs?: ?Array<MessageID>, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteGetPublicConversationsRpcParam = $ReadOnly<{tlfID: TLFID, topicType: TopicType, summarizeMaxMsgs: Boolean, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteGetS3ParamsRpcParam = $ReadOnly<{conversationID: ConversationID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteGetTLFConversationsRpcParam = $ReadOnly<{tlfID: TLFID, topicType: TopicType, summarizeMaxMsgs: Boolean, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteGetThreadRemoteRpcParam = $ReadOnly<{conversationID: ConversationID, query?: ?GetThreadQuery, pagination?: ?Pagination, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteGetUnreadUpdateFullRpcParam = $ReadOnly<{inboxVers: InboxVers, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteJoinConversationRpcParam = $ReadOnly<{convID: ConversationID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteLeaveConversationRpcParam = $ReadOnly<{convID: ConversationID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteMarkAsReadRpcParam = $ReadOnly<{conversationID: ConversationID, msgID: MessageID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteNewConversationRemote2RpcParam = $ReadOnly<{idTriple: ConversationIDTriple, TLFMessage: MessageBoxed, membersType: ConversationMembersType, topicNameState?: ?TopicNameState, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteNewConversationRemoteRpcParam = $ReadOnly<{idTriple: ConversationIDTriple, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemotePostRemoteRpcParam = $ReadOnly<{conversationID: ConversationID, messageBoxed: MessageBoxed, atMentions?: ?Array<Gregor1.UID>, channelMention: ChannelMention, topicNameState?: ?TopicNameState, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemotePreviewConversationRpcParam = $ReadOnly<{convID: ConversationID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemotePublishReadMessageRpcParam = $ReadOnly<{uid: Gregor1.UID, convID: ConversationID, msgID: MessageID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemotePublishSetConversationStatusRpcParam = $ReadOnly<{uid: Gregor1.UID, convID: ConversationID, status: ConversationStatus, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteRemoteNotificationSuccessfulRpcParam = $ReadOnly<{authToken: Gregor1.SessionToken, companionPushIDs?: ?Array<String>, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteRetentionSweepConvRpcParam = $ReadOnly<{convID: ConversationID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteS3SignRpcParam = $ReadOnly<{version: Int, payload: Bytes, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteSetAppNotificationSettingsRpcParam = $ReadOnly<{convID: ConversationID, settings: ConversationNotificationInfo, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteSetConvRetentionRpcParam = $ReadOnly<{convID: ConversationID, policy: RetentionPolicy, sweepChannel: Uint64, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteSetConversationStatusRpcParam = $ReadOnly<{conversationID: ConversationID, status: ConversationStatus, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteSetGlobalAppNotificationSettingsRpcParam = $ReadOnly<{settings: GlobalAppNotificationSettings, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteSetTeamRetentionRpcParam = $ReadOnly<{teamID: Keybase1.TeamID, policy: RetentionPolicy, sweepChannel: Uint64, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteSyncAllRpcParam = $ReadOnly<{uid: Gregor1.UID, deviceID: Gregor1.DeviceID, session: Gregor1.SessionToken, inboxVers: InboxVers, ctime: Gregor1.Time, fresh: Boolean, protVers: SyncAllProtVers, hostName: String, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteSyncChatRpcParam = $ReadOnly<{vers: InboxVers, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteSyncInboxRpcParam = $ReadOnly<{vers: InboxVers, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteTlfFinalizeRpcParam = $ReadOnly<{tlfID: TLFID, resetUser: String, resetDate: String, resetTimestamp: Gregor1.Time, resetFull: String, resetUID?: ?Keybase1.UID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteTlfResolveRpcParam = $ReadOnly<{tlfID: TLFID, resolvedWriters?: ?Array<Gregor1.UID>, resolvedReaders?: ?Array<Gregor1.UID>, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteUpdateTypingRemoteRpcParam = $ReadOnly<{uid: Gregor1.UID, deviceID: Gregor1.DeviceID, convID: ConversationID, typing: Boolean, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteUpgradeKBFSToImpteamRpcParam = $ReadOnly<{tlfID: TLFID, incomingCallMap?: IncomingCallMapType, waitingHandler?: WaitingHandlerType}>
  
  export type RemoteUserTypingUpdate = $ReadOnly<{uid: Gregor1.UID, deviceID: Gregor1.DeviceID, convID: ConversationID, typing: Boolean}>
  
  export type RetentionPolicy = {typ: 1, retain: ?RpRetain} | {typ: 2, expire: ?RpExpire} | {typ: 3, inherit: ?RpInherit}
  
  export type RetentionPolicyType =
    | 0 // NONE_0
    | 1 // RETAIN_1
    | 2 // EXPIRE_2
    | 3 // INHERIT_3
  
  export type RpExpire = $ReadOnly<{age: Gregor1.DurationSec}>
  
  export type RpInherit = $ReadOnly<{}>
  
  export type RpRetain = $ReadOnly<{}>
  
  export type S3Params = $ReadOnly<{bucket: String, objectKey: String, accessKey: String, acl: String, regionName: String, regionEndpoint: String, regionBucketEndpoint: String}>
  
  export type SealedData = $ReadOnly<{v: Int, e: Bytes, n: Bytes}>
  
  export type ServerCacheVers = $ReadOnly<{inboxVers: Int, bodiesVers: Int}>
  
  export type SetAppNotificationSettingsInfo = $ReadOnly<{convID: ConversationID, settings: ConversationNotificationInfo}>
  
  export type SetAppNotificationSettingsLocalRes = $ReadOnly<{offline: Boolean, rateLimits?: ?Array<RateLimit>}>
  
  export type SetAppNotificationSettingsPayload = $ReadOnly<{Action: String, convID: ConversationID, inboxVers: InboxVers, settings: ConversationNotificationInfo, unreadUpdate?: ?UnreadUpdate}>
  
  export type SetAppNotificationSettingsRes = $ReadOnly<{rateLimit?: ?RateLimit}>
  
  export type SetConvRetentionUpdate = $ReadOnly<{inboxVers: InboxVers, convID: ConversationID, policy: RetentionPolicy}>
  
  export type SetConversationStatusLocalRes = $ReadOnly<{rateLimits?: ?Array<RateLimit>, identifyFailures?: ?Array<Keybase1.TLFIdentifyFailure>}>
  
  export type SetConversationStatusRes = $ReadOnly<{rateLimit?: ?RateLimit}>
  
  export type SetRetentionRes = $ReadOnly<{rateLimit?: ?RateLimit}>
  
  export type SetStatusInfo = $ReadOnly<{convID: ConversationID, status: ConversationStatus, conv?: ?InboxUIItem}>
  
  export type SetStatusPayload = $ReadOnly<{Action: String, convID: ConversationID, status: ConversationStatus, inboxVers: InboxVers, unreadUpdate?: ?UnreadUpdate}>
  
  export type SetTeamRetentionUpdate = $ReadOnly<{inboxVers: InboxVers, teamID: Keybase1.TeamID, policy: RetentionPolicy}>
  
  export type SignEncryptedData = $ReadOnly<{v: Int, e: Bytes, n: Bytes}>
  
  export type SignatureInfo = $ReadOnly<{v: Int, s: Bytes, k: Bytes}>
  
  export type StaleUpdateType =
    | 0 // CLEAR_0
    | 1 // NEWACTIVITY_1
  
  export type SweepRes = $ReadOnly<{foundTask: Boolean, deletedMessages: Boolean, expunge: Expunge}>
  
  export type SyncAllNotificationRes = {typ: 0, state: ?Gregor1.State} | {typ: 1, incremental: ?Gregor1.SyncResult}
  
  export type SyncAllNotificationType =
    | 0 // STATE_0
    | 1 // INCREMENTAL_1
  
  export type SyncAllProtVers =
    | 0 // V0_0
    | 1 // V1_1
  
  export type SyncAllResult = $ReadOnly<{auth: Gregor1.AuthResult, chat: SyncChatRes, notification: SyncAllNotificationRes, badge: UnreadUpdateFull}>
  
  export type SyncChatRes = $ReadOnly<{cacheVers: ServerCacheVers, inboxRes: SyncInboxRes}>
  
  export type SyncInboxRes = {typ: 0} | {typ: 1, incremental: ?SyncIncrementalRes} | {typ: 2}
  
  export type SyncInboxResType =
    | 0 // CURRENT_0
    | 1 // INCREMENTAL_1
    | 2 // CLEAR_2
  
  export type SyncIncrementalRes = $ReadOnly<{vers: InboxVers, convs?: ?Array<Conversation>}>
  
  export type TLFConvOrdinal = Uint
  
  export type TLFFinalizeUpdate = $ReadOnly<{finalizeInfo: ConversationFinalizeInfo, convIDs?: ?Array<ConversationID>, inboxVers: InboxVers}>
  
  export type TLFID = Bytes
  
  export type TLFResolveUpdate = $ReadOnly<{convID: ConversationID, inboxVers: InboxVers}>
  
  export type TeamChannelUpdate = $ReadOnly<{teamID: TLFID}>
  
  export type TeamType =
    | 0 // NONE_0
    | 1 // SIMPLE_1
    | 2 // COMPLEX_2
  
  export type TeamTypeInfo = $ReadOnly<{convID: ConversationID, teamType: TeamType, conv?: ?InboxUIItem}>
  
  export type TeamTypePayload = $ReadOnly<{Action: String, convID: ConversationID, teamType: TeamType, inboxVers: InboxVers, unreadUpdate?: ?UnreadUpdate}>
  
  export type ThreadID = Bytes
  
  export type ThreadView = $ReadOnly<{messages?: ?Array<MessageUnboxed>, pagination?: ?Pagination}>
  
  export type ThreadViewBoxed = $ReadOnly<{messages?: ?Array<MessageBoxed>, pagination?: ?Pagination}>
  
  export type TopicID = Bytes
  
  export type TopicNameState = Bytes
  
  export type TopicType =
    | 0 // NONE_0
    | 1 // CHAT_1
    | 2 // DEV_2
  
  export type TyperInfo = $ReadOnly<{uid: Keybase1.UID, username: String, deviceID: Keybase1.DeviceID, deviceName: String, deviceType: String}>
  
  export type UIAssetUrlInfo = $ReadOnly<{previewUrl: String, fullUrl: String, mimeType: String}>
  
  export type UIChannelNameMention = $ReadOnly<{name: String, convID: String}>
  
  export type UIMessage = {state: 1, valid: ?UIMessageValid} | {state: 2, error: ?MessageUnboxedError} | {state: 3, outbox: ?UIMessageOutbox} | {state: 4, placeholder: ?MessageUnboxedPlaceholder}
  
  export type UIMessageOutbox = $ReadOnly<{state: OutboxState, outboxID: String, messageType: MessageType, body: String, ctime: Gregor1.Time, ordinal: Double}>
  
  export type UIMessageValid = $ReadOnly<{messageID: MessageID, ctime: Gregor1.Time, outboxID?: ?String, messageBody: MessageBody, senderUsername: String, senderDeviceName: String, senderDeviceType: String, superseded: Boolean, assetUrlInfo?: ?UIAssetUrlInfo, senderDeviceRevokedAt?: ?Gregor1.Time, atMentions?: ?Array<String>, channelMention: ChannelMention, channelNameMentions?: ?Array<UIChannelNameMention>, ephemeralMetadata?: ?MsgEphemeralMetadata}>
  
  export type UIMessages = $ReadOnly<{messages?: ?Array<UIMessage>, pagination?: ?UIPagination}>
  
  export type UIPagination = $ReadOnly<{next: String, previous: String, num: Int, last: Boolean}>
  
  export type UnreadFirstNumLimit = $ReadOnly<{NumRead: Int, AtLeast: Int, AtMost: Int}>
  
  export type UnreadUpdate = $ReadOnly<{convID: ConversationID, unreadMessages: Int, unreadNotifyingMessages: {[key: string]: Int}, compatUnreadMessages: Int, diff: Boolean}>
  
  export type UnreadUpdateFull = $ReadOnly<{ignore: Boolean, inboxVers: InboxVers, inboxSyncStatus: SyncInboxResType, updates?: ?Array<UnreadUpdate>}>
  
  export type UnverifiedInboxUIItem = $ReadOnly<{convID: String, name: String, visibility: Keybase1.TLFVisibility, status: ConversationStatus, membersType: ConversationMembersType, memberStatus: ConversationMemberStatus, teamType: TeamType, notifications?: ?ConversationNotificationInfo, time: Gregor1.Time, version: ConversationVers, maxMsgID: MessageID, localMetadata?: ?UnverifiedInboxUIItemMetadata, finalizeInfo?: ?ConversationFinalizeInfo, supersedes?: ?Array<ConversationMetadata>, supersededBy?: ?Array<ConversationMetadata>}>
  
  export type UnverifiedInboxUIItemMetadata = $ReadOnly<{channelName: String, headline: String, snippet: String, writerNames?: ?Array<String>, resetParticipants?: ?Array<String>}>
  
  export type UnverifiedInboxUIItems = $ReadOnly<{items?: ?Array<UnverifiedInboxUIItem>, pagination?: ?UIPagination, offline: Boolean}>
  
  export type UpdateConversationMembership = $ReadOnly<{inboxVers: InboxVers, joined?: ?Array<ConversationMember>, removed?: ?Array<ConversationMember>, reset?: ?Array<ConversationMember>, previewed?: ?Array<ConversationID>, unreadUpdate?: ?UnreadUpdate, unreadUpdates?: ?Array<UnreadUpdate>}>
  type ChatUiChatConfirmChannelDeleteResult = Boolean
  type LocalDeleteConversationLocalResult = DeleteConversationLocalRes
  type LocalDownloadAttachmentLocalResult = DownloadAttachmentLocalRes
  type LocalDownloadFileAttachmentLocalResult = DownloadAttachmentLocalRes
  type LocalFindConversationsLocalResult = FindConversationsLocalRes
  type LocalGenerateOutboxIDResult = OutboxID
  type LocalGetCachedThreadResult = GetThreadLocalRes
  type LocalGetConversationForCLILocalResult = GetConversationForCLILocalRes
  type LocalGetGlobalAppNotificationSettingsLocalResult = GlobalAppNotificationSettings
  type LocalGetInboxAndUnboxLocalResult = GetInboxAndUnboxLocalRes
  type LocalGetInboxNonblockLocalResult = NonblockFetchRes
  type LocalGetInboxSummaryForCLILocalResult = GetInboxSummaryForCLILocalRes
  type LocalGetMessagesLocalResult = GetMessagesLocalRes
  type LocalGetSearchRegexpResult = GetSearchRegexpRes
  type LocalGetTLFConversationsLocalResult = GetTLFConversationsLocalRes
  type LocalGetTeamRetentionLocalResult = ?RetentionPolicy
  type LocalGetThreadLocalResult = GetThreadLocalRes
  type LocalGetThreadNonblockResult = NonblockFetchRes
  type LocalJoinConversationByIDLocalResult = JoinLeaveConversationLocalRes
  type LocalJoinConversationLocalResult = JoinLeaveConversationLocalRes
  type LocalLeaveConversationLocalResult = JoinLeaveConversationLocalRes
  type LocalMakePreviewResult = MakePreviewRes
  type LocalMarkAsReadLocalResult = MarkAsReadLocalRes
  type LocalNewConversationLocalResult = NewConversationLocalRes
  type LocalPostAttachmentLocalResult = PostLocalRes
  type LocalPostDeleteHistoryByAgeResult = PostLocalRes
  type LocalPostDeleteHistoryThroughResult = PostLocalRes
  type LocalPostDeleteHistoryUptoResult = PostLocalRes
  type LocalPostDeleteNonblockResult = PostLocalNonblockRes
  type LocalPostEditNonblockResult = PostLocalNonblockRes
  type LocalPostFileAttachmentLocalResult = PostLocalRes
  type LocalPostHeadlineNonblockResult = PostLocalNonblockRes
  type LocalPostHeadlineResult = PostLocalRes
  type LocalPostLocalNonblockResult = PostLocalNonblockRes
  type LocalPostLocalResult = PostLocalRes
  type LocalPostMetadataNonblockResult = PostLocalNonblockRes
  type LocalPostMetadataResult = PostLocalRes
  type LocalPostTextNonblockResult = PostLocalNonblockRes
  type LocalPreviewConversationByIDLocalResult = JoinLeaveConversationLocalRes
  type LocalSetAppNotificationSettingsLocalResult = SetAppNotificationSettingsLocalRes
  type LocalSetConversationStatusLocalResult = SetConversationStatusLocalRes
  type LocalUnboxMobilePushNotificationResult = String
  type RemoteDeleteConversationResult = DeleteConversationRemoteRes
  type RemoteGetGlobalAppNotificationSettingsResult = GlobalAppNotificationSettings
  type RemoteGetInboxRemoteResult = GetInboxRemoteRes
  type RemoteGetInboxVersionResult = InboxVers
  type RemoteGetMessageBeforeResult = GetMessageBeforeRes
  type RemoteGetMessagesRemoteResult = GetMessagesRemoteRes
  type RemoteGetPublicConversationsResult = GetPublicConversationsRes
  type RemoteGetS3ParamsResult = S3Params
  type RemoteGetTLFConversationsResult = GetTLFConversationsRes
  type RemoteGetThreadRemoteResult = GetThreadRemoteRes
  type RemoteGetUnreadUpdateFullResult = UnreadUpdateFull
  type RemoteJoinConversationResult = JoinLeaveConversationRemoteRes
  type RemoteLeaveConversationResult = JoinLeaveConversationRemoteRes
  type RemoteMarkAsReadResult = MarkAsReadRes
  type RemoteNewConversationRemote2Result = NewConversationRemoteRes
  type RemoteNewConversationRemoteResult = NewConversationRemoteRes
  type RemotePostRemoteResult = PostRemoteRes
  type RemotePreviewConversationResult = JoinLeaveConversationRemoteRes
  type RemoteRetentionSweepConvResult = SweepRes
  type RemoteS3SignResult = Bytes
  type RemoteSetAppNotificationSettingsResult = SetAppNotificationSettingsRes
  type RemoteSetConvRetentionResult = SetRetentionRes
  type RemoteSetConversationStatusResult = SetConversationStatusRes
  type RemoteSetTeamRetentionResult = SetRetentionRes
  type RemoteSyncAllResult = SyncAllResult
  type RemoteSyncChatResult = SyncChatRes
  type RemoteSyncInboxResult = SyncInboxRes
  
  export type IncomingCallMapType = {|'keybase.1.chatUi.chatAttachmentUploadOutboxID'?: (params: $ReadOnly<{sessionID: Int, outboxID: OutboxID}>, response: CommonResponseHandler) => void, 'keybase.1.chatUi.chatAttachmentUploadStart'?: (params: $ReadOnly<{sessionID: Int, metadata: AssetMetadata, placeholderMsgID: MessageID}>, response: CommonResponseHandler) => void, 'keybase.1.chatUi.chatAttachmentUploadProgress'?: (params: $ReadOnly<{sessionID: Int, bytesComplete: Long, bytesTotal: Long}>, response: CommonResponseHandler) => void, 'keybase.1.chatUi.chatAttachmentUploadDone'?: (params: $ReadOnly<{sessionID: Int}>, response: CommonResponseHandler) => void, 'keybase.1.chatUi.chatAttachmentPreviewUploadStart'?: (params: $ReadOnly<{sessionID: Int, metadata: AssetMetadata}>, response: CommonResponseHandler) => void, 'keybase.1.chatUi.chatAttachmentPreviewUploadDone'?: (params: $ReadOnly<{sessionID: Int}>, response: CommonResponseHandler) => void, 'keybase.1.chatUi.chatAttachmentDownloadStart'?: (params: $ReadOnly<{sessionID: Int}>, response: CommonResponseHandler) => void, 'keybase.1.chatUi.chatAttachmentDownloadProgress'?: (params: $ReadOnly<{sessionID: Int, bytesComplete: Long, bytesTotal: Long}>, response: CommonResponseHandler) => void, 'keybase.1.chatUi.chatAttachmentDownloadDone'?: (params: $ReadOnly<{sessionID: Int}>, response: CommonResponseHandler) => void, 'keybase.1.chatUi.chatInboxUnverified'?: (params: $ReadOnly<{sessionID: Int, inbox: String}>, response: CommonResponseHandler) => void, 'keybase.1.chatUi.chatInboxConversation'?: (params: $ReadOnly<{sessionID: Int, conv: String}>, response: CommonResponseHandler) => void, 'keybase.1.chatUi.chatInboxFailed'?: (params: $ReadOnly<{sessionID: Int, convID: ConversationID, error: InboxUIItemError}>, response: CommonResponseHandler) => void, 'keybase.1.chatUi.chatThreadCached'?: (params: $ReadOnly<{sessionID: Int, thread?: ?String}>, response: CommonResponseHandler) => void, 'keybase.1.chatUi.chatThreadFull'?: (params: $ReadOnly<{sessionID: Int, thread: String}>, response: CommonResponseHandler) => void, 'keybase.1.chatUi.chatSearchHit'?: (params: $ReadOnly<{sessionID: Int, searchHit: ChatSearchHit}>, response: CommonResponseHandler) => void, 'keybase.1.chatUi.chatSearchDone'?: (params: $ReadOnly<{sessionID: Int, numHits: Int}>, response: CommonResponseHandler) => void, 'keybase.1.chatUi.chatConfirmChannelDelete'?: (params: $ReadOnly<{sessionID: Int, channel: String}>, response: {error: RPCErrorHandler, result: (result: ChatUiChatConfirmChannelDeleteResult) => void}) => void, 'keybase.1.NotifyChat.NewChatActivity'?: (params: $ReadOnly<{uid: Keybase1.UID, activity: ChatActivity}>) => void, 'keybase.1.NotifyChat.ChatIdentifyUpdate'?: (params: $ReadOnly<{update: Keybase1.CanonicalTLFNameAndIDWithBreaks}>) => void, 'keybase.1.NotifyChat.ChatTLFFinalize'?: (params: $ReadOnly<{uid: Keybase1.UID, convID: ConversationID, finalizeInfo: ConversationFinalizeInfo, conv?: ?InboxUIItem}>) => void, 'keybase.1.NotifyChat.ChatTLFResolve'?: (params: $ReadOnly<{uid: Keybase1.UID, convID: ConversationID, resolveInfo: ConversationResolveInfo}>) => void, 'keybase.1.NotifyChat.ChatInboxStale'?: (params: $ReadOnly<{uid: Keybase1.UID}>) => void, 'keybase.1.NotifyChat.ChatThreadsStale'?: (params: $ReadOnly<{uid: Keybase1.UID, updates?: ?Array<ConversationStaleUpdate>}>) => void, 'keybase.1.NotifyChat.ChatTypingUpdate'?: (params: $ReadOnly<{typingUpdates?: ?Array<ConvTypingUpdate>}>) => void, 'keybase.1.NotifyChat.ChatJoinedConversation'?: (params: $ReadOnly<{uid: Keybase1.UID, conv: InboxUIItem}>) => void, 'keybase.1.NotifyChat.ChatLeftConversation'?: (params: $ReadOnly<{uid: Keybase1.UID, convID: ConversationID}>) => void, 'keybase.1.NotifyChat.ChatResetConversation'?: (params: $ReadOnly<{uid: Keybase1.UID, convID: ConversationID}>) => void, 'keybase.1.NotifyChat.ChatInboxSyncStarted'?: (params: $ReadOnly<{uid: Keybase1.UID}>) => void, 'keybase.1.NotifyChat.ChatInboxSynced'?: (params: $ReadOnly<{uid: Keybase1.UID, syncRes: ChatSyncResult}>) => void, 'keybase.1.NotifyChat.ChatSetConvRetention'?: (params: $ReadOnly<{uid: Keybase1.UID, convID: ConversationID, conv?: ?InboxUIItem}>) => void, 'keybase.1.NotifyChat.ChatSetTeamRetention'?: (params: $ReadOnly<{uid: Keybase1.UID, teamID: Keybase1.TeamID, convs?: ?Array<InboxUIItem>}>) => void, 'keybase.1.NotifyChat.ChatKBFSToImpteamUpgrade'?: (params: $ReadOnly<{uid: Keybase1.UID, convID: ConversationID}>) => void|}
  