/* eslint-disable */

// This file is auto-generated by client/protocol/Makefile.
import {call, Effect} from 'redux-saga/effects'
import {getEngine as engine, getEngineSaga} from '../../engine/require'

export type Bool = boolean
export type Boolean = boolean
export type Bytes = Buffer
export type Double = number
export type Int = number
export type Int64 = number
export type Long = number
export type String = string
export type Uint = number
export type Uint64 = number
type WaitingKey = string | Array<string>
export type IncomingErrorCallback = (err?: {code?: number; desc?: string} | null) => void
type IncomingReturn = Effect | null | void | false | Array<Effect | null | void | false>

// Dummy calls to avoid undelcared warnings in TS strict mode
export const _doNotUse = (w: WaitingKey, i: IncomingReturn) =>
  console.log(
    'why did you call this function?',
    w,
    i,
    call(() => {}),
    engine(),
    getEngineSaga()
  )

export type MessageTypes = {}
export type AuthResult = {readonly uid: UID; readonly username: String; readonly sid: SessionID; readonly isAdmin: Boolean}
export type Body = Bytes
export type Category = String
export type ConnectedDevice = {readonly deviceID: DeviceID; readonly deviceType: String; readonly devicePlatform: String; readonly userAgent: String}
export type ConnectedUser = {readonly uid: UID; readonly devices?: Array<ConnectedDevice> | null}
export type DeviceID = Bytes
export type Dismissal = {readonly msgIDs?: Array<MsgID> | null; readonly ranges?: Array<MsgRange> | null}
export type DurationMsec = Int64
export type DurationSec = Int64
export type InBandMessage = {readonly stateUpdate?: StateUpdateMessage | null; readonly stateSync?: StateSyncMessage | null}
export type Item = {readonly category: Category; readonly dtime: TimeOrOffset; readonly remindTimes?: Array<TimeOrOffset> | null; readonly body: Body}
export type ItemAndMetadata = {readonly md?: Metadata | null; readonly item?: Item | null}
export type Message = {readonly oobm?: OutOfBandMessage | null; readonly ibm?: InBandMessage | null}
export type Metadata = {readonly uid: UID; readonly msgID: MsgID; readonly ctime: Time; readonly deviceID: DeviceID; readonly inBandMsgType: Int}
export type MsgID = Bytes
export type MsgRange = {readonly endTime: TimeOrOffset; readonly category: Category; readonly skipMsgIDs?: Array<MsgID> | null}
export type OutOfBandMessage = {readonly uid: UID; readonly system: System; readonly body: Body}
export type Reminder = {readonly item: ItemAndMetadata; readonly seqno: Int; readonly remindTime: Time}
export type ReminderID = {readonly uid: UID; readonly msgID: MsgID; readonly seqno: Int}
export type ReminderSet = {readonly reminders?: Array<Reminder> | null; readonly moreRemindersReady: Boolean}
export type SessionID = String
export type SessionToken = String
export type State = {readonly items?: Array<ItemAndMetadata> | null}
export type StateSyncMessage = {readonly md: Metadata}
export type StateUpdateMessage = {readonly md: Metadata; readonly creation?: Item | null; readonly dismissal?: Dismissal | null}
export type SyncResult = {readonly msgs?: Array<InBandMessage> | null; readonly hash: Bytes}
export type System = String
export type Time = Long
export type TimeOrOffset = {readonly time: Time; readonly offset: DurationMsec}
export type UID = Bytes

export type IncomingCallMapType = {}

export type CustomResponseIncomingCallMap = {}
// Not enabled calls. To enable add to enabled-calls.json:
// 'gregor.1.auth.authenticateSessionToken'
// 'gregor.1.authInternal.createGregorSuperUserSessionToken'
// 'gregor.1.authUpdate.revokeSessionIDs'
// 'gregor.1.incoming.sync'
// 'gregor.1.incoming.consumeMessage'
// 'gregor.1.incoming.consumePublishMessage'
// 'gregor.1.incoming.consumeMessageMulti'
// 'gregor.1.incoming.ping'
// 'gregor.1.incoming.version'
// 'gregor.1.incoming.state'
// 'gregor.1.incoming.stateByCategoryPrefix'
// 'gregor.1.incoming.describeConnectedUsers'
// 'gregor.1.incoming.describeConnectedUsersInternal'
// 'gregor.1.outgoing.broadcastMessage'
// 'gregor.1.remind.getReminders'
// 'gregor.1.remind.deleteReminders'
