UNPKG

line-api

Version:

Simple LINE api client for Node.js written in TypeScript

80 lines 1.91 kB
import { STICKER } from './consts'; export declare type NotifyOption = { token: string; }; export declare type RateLimit = { request: { limit: number; remaining: number; }; image: { limit: number; remaining: number; }; reset: Date; }; export declare type StatusResponse = { status: 200; message: 'ok'; targetType: string; target: string; }; export declare type RevokeResponse = { staus: 200; message: 'OK'; }; export declare type SendResponse = { staus: 200; message: 'OK'; }; export declare type TokenResponse = { access_token: string; }; export declare type SendOption = { message: string; image?: string | { fullsize: string; thumbnail: string; }; sticker?: keyof typeof STICKER | { packageId: number; id: number; }; notificationDisabled?: boolean; }; export declare type AuthorizeOption = { response_type: 'code'; scope: 'notify'; client_id: string; redirect_uri: string; state: string; response_mode?: 'form_post'; }; export declare type TokenOption = { grant_type: 'authorization_code'; code: string; redirect_uri: string; client_id: string; client_secret: string; }; export declare class NotifyError extends Error { status: number; constructor(param: { status: number; message?: string; }); } export declare class Notify { accessToken: string; ratelimit?: RateLimit; constructor({ token }: NotifyOption); private req; private get; private post; status(): Promise<StatusResponse>; revoke(): Promise<RevokeResponse>; send({ message, image, sticker, notificationDisabled }: SendOption): Promise<SendResponse>; authorize(opt: AuthorizeOption): Promise<void>; token(opt: TokenOption): Promise<TokenResponse>; } //# sourceMappingURL=notify.d.ts.map