interface LibRequestInstructionsOptions {

    loading?: string | InstructionsLoading,

    token?:boolean,

    page?: InstructionsPage,

    failMessage?:boolean,

    message?: InstructionsMessageType | boolean,

    successCode?:Array<number>,

    next?:(data:InstructionsNextObject)=>any,

    format?:InstructionsFormat,

    cache?: InstructionsCache | boolean,

    test?:boolean | InstructionsTest

}


interface InstructionsTest {
    (data:Record<string, any>):Record<string, any> | void
}

interface InstructionsCache {
    // 存储类型
    type?: InstructionsCacheType,
    // 过期时间
    expireTime?: number,
    // 什么时候去同步一次接口
    sync?:any | InstructionsCacheSyncWhere,
    // 存储的数据
    data?:LibRequestResponseData,
    // 是否属于第一次
    first?:boolean,
    // 存储的条件是什么
    where?: InstructionsCacheSyncWhere,
    // 是否为更新缓存
    updated?:boolean,
    // 唯一标识 用于特殊更新
    id?:string
}

interface InstructionsCacheSyncWhere {
    (data:InstructionsCache,useData:LibRequestContext):boolean
}


interface InstructionsFormat {
    (data:ResponseData): any
}

interface InstructionsNextObject {
    status:boolean,
    speed:LibRequestStatus,
    isSuccess: boolean
}


interface InstructionsPage {
    page:number,
    pageSize:number
}

interface InstructionsLoading {

    // 加载文本
    title:string,

    // 延迟显示的时间
    delay: number,

    // 默认的透明蒙层
    mask?:boolean,

    // 计时器
    _time?:number

}

