apns-send
Version:
The apns-send npm package enables seamless integration of push notifications using the Apple Push Notification service (APNs) with the HTTP/2 protocol.
30 lines (29 loc) • 871 B
TypeScript
/// <reference types="node" />
/// <reference types="node" />
import http2 from 'http2';
interface IHttp2WrapperOptions {
url: string;
}
interface IRequestOptions {
headers?: Record<string, any>;
body?: any;
method: 'POST' | 'PUT' | 'DELETE' | 'GET';
timeout?: number;
}
export declare class Http2Wrapper {
private _http2Client;
constructor(options: IHttp2WrapperOptions);
request(path: string, options: IRequestOptions): Promise<{
status: number;
statusText: any;
headers: http2.IncomingHttpHeaders;
body: unknown;
}>;
_responseHeaders(req: http2.ClientHttp2Stream, timeout?: number): Promise<{
headers: http2.IncomingHttpHeaders;
status: number;
}>;
_responseJson(req: http2.ClientHttp2Stream): Promise<unknown>;
_convertBufferToJson(buffer: Buffer): any;
}
export {};