export type MemoryWarningCallbackResult = {
  level?: number | null
}

export type MemoryWarningCallback = (result: MemoryWarningCallbackResult) => void

export type OnMemoryWarning = (callback: MemoryWarningCallback) => void

export type OffMemoryWarning = (callback: MemoryWarningCallback | null) => void

export type MemoryWarningErrorCode = 1100601 | 1100602

export interface MemoryWarningFail extends IUniError {
  errCode: MemoryWarningErrorCode
}

export interface Uni {
  onMemoryWarning(callback: MemoryWarningCallback): void
  offMemoryWarning(callback: MemoryWarningCallback | null): void
}
