Hierarchy

Constructors

  • Parameters

    • __namedParameters: Partial<ApiConfigResolved> & Pick<ApiConfigResolved,
          | "endpointId"
          | "endpointUrl"
          | "bundleId"
          | "appVersion"
          | "buildNo"
          | "userAgent"> & {
          refreshToken?: string;
      }

    Returns JikeClient

Properties

prefixed: string | boolean

Accessors

  • get accessToken(): string
  • Returns string

  • set accessToken(token): void
  • Parameters

    • token: string

    Returns void

  • get refreshToken(): string
  • Returns string

Methods

  • Type Parameters

    • T extends "renewToken"

    Parameters

    • event: T
    • fn: ((...args: ArgumentMap<EventMap>[Extract<T, "renewToken">]) => void)
        • (...args): void
        • Parameters

          • Rest...args: ArgumentMap<EventMap>[Extract<T, "renewToken">]

          Returns void

    • Optionalcontext: any

    Returns this

  • Parameters

    Returns Promise<{
        post: JikePostWithDetail;
        toast: string;
    }>

  • Calls each of the listeners registered for a given event.

    Type Parameters

    • T extends "renewToken"

    Parameters

    • event: T
    • Rest...args: ArgumentMap<EventMap>[Extract<T, "renewToken">]

    Returns boolean

  • Return an array listing the events for which the emitter has registered listeners.

    Returns "renewToken"[]

  • 获取用户

    Type Parameters

    • M extends boolean = boolean

      是否为自己

      • true: 是
      • false: 否
      • boolean: 未知 (默认)

    Parameters

    • username: string

      用户名

    Returns JikeUser<boolean>

    JikeUser 实例

  • Return the number of listeners listening to a given event.

    Parameters

    • event: "renewToken"

    Returns number

  • Return the listeners registered for a given event.

    Type Parameters

    • T extends "renewToken"

    Parameters

    • event: T

    Returns ((...args: ArgumentMap<EventMap>[Extract<T, "renewToken">]) => void)[]

  • 密码登录

    Parameters

    • areaCode: string | number

      区号,如 +86

    • mobile: string

      手机号

    • password: string

      密码

    Returns Promise<void>

    RequestFailureError 请求失败错误

  • 短信登录

    Parameters

    • areaCode: string | number

      区号,如 +86

    • mobile: string

      手机号

    • smsCode: string | number

      短信验证码

    Returns Promise<void>

    RequestFailureError 请求失败错误

  • Type Parameters

    • T extends "renewToken"

    Parameters

    • event: T
    • Optionalfn: ((...args: ArgumentMap<EventMap>[Extract<T, "renewToken">]) => void)
        • (...args): void
        • Parameters

          • Rest...args: ArgumentMap<EventMap>[Extract<T, "renewToken">]

          Returns void

    • Optionalcontext: any
    • Optionalonce: boolean

    Returns this

  • Add a listener for a given event.

    Type Parameters

    • T extends "renewToken"

    Parameters

    • event: T
    • fn: ((...args: ArgumentMap<EventMap>[Extract<T, "renewToken">]) => void)
        • (...args): void
        • Parameters

          • Rest...args: ArgumentMap<EventMap>[Extract<T, "renewToken">]

          Returns void

    • Optionalcontext: any

    Returns this

  • Add a one-time listener for a given event.

    Type Parameters

    • T extends "renewToken"

    Parameters

    • event: T
    • fn: ((...args: ArgumentMap<EventMap>[Extract<T, "renewToken">]) => void)
        • (...args): void
        • Parameters

          • Rest...args: ArgumentMap<EventMap>[Extract<T, "renewToken">]

          Returns void

    • Optionalcontext: any

    Returns this

  • 查询通知

    Parameters

    Returns Promise<Notification[]>

  • Remove all listeners, or those of the specified event.

    Parameters

    • Optionalevent: "renewToken"

    Returns this

  • Remove the listeners of a given event.

    Type Parameters

    • T extends "renewToken"

    Parameters

    • event: T
    • Optionalfn: ((...args: ArgumentMap<EventMap>[Extract<T, "renewToken">]) => void)
        • (...args): void
        • Parameters

          • Rest...args: ArgumentMap<EventMap>[Extract<T, "renewToken">]

          Returns void

    • Optionalcontext: any
    • Optionalonce: boolean

    Returns this

  • 刷新 access token

    Returns Promise<void>

  • 发送短信验证码

    Parameters

    • areaCode: string | number

      区号,如 +86

    • mobile: string

      手机号

    Returns Promise<void>

    RequestFailureError 请求失败错误

  • 序列化

    Parameters

    • space: number = 0

      缩进空格数

    Returns Promise<string>

  • 反序列化

    Parameters

    • data: string

      数据

    Returns JikeClient