1.7.4 • Published 6 months ago
@types/twitter v1.7.4
Installation
npm install --save @types/twitter
Summary
This package contains type definitions for twitter (https://github.com/desmondmorris/node-twitter).
Details
Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/twitter.
index.d.ts
// Type definitions for twitter 1.7
// Project: https://github.com/desmondmorris/node-twitter
// Definitions by: BendingBender <https://github.com/BendingBender>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.3
/// <reference types="node" />
import request = require('request');
import { EventEmitter } from 'events';
export = Twitter;
declare class Twitter {
readonly VERSION: string;
readonly allow_promise: boolean;
readonly request: typeof request;
constructor(options: Twitter.AccessTokenOptions | Twitter.BearerTokenOptions);
get(path: string, params: Twitter.RequestParams, callback: Twitter.Callback): void;
get(path: string, callback: Twitter.Callback): void;
get(path: string, params?: Twitter.RequestParams): Promise<Twitter.ResponseData>;
post(path: string, params: Twitter.RequestParams, callback: Twitter.Callback): void;
post(path: string, callback: Twitter.Callback): void;
post(path: string, params?: Twitter.RequestParams): Promise<Twitter.ResponseData>;
stream(
method: 'user' | 'site' | string,
params: { [key: string]: any },
callback: (stream: EventEmitter) => void
): void;
stream(method: 'user' | 'site' | string, callback: (stream: EventEmitter) => void): void;
stream(method: 'user' | 'site' | string, params?: { [key: string]: any }): EventEmitter;
}
declare namespace Twitter {
interface Options {
consumer_key: string;
consumer_secret: string;
rest_base?: string | undefined;
stream_base?: string | undefined;
user_stream_base?: string | undefined;
site_stream_base?: string | undefined;
media_base?: string | undefined;
request_options?: request.CoreOptions | undefined;
}
interface AccessTokenOptions extends Options {
access_token_key: string;
access_token_secret: string;
}
interface BearerTokenOptions extends Options {
bearer_token: string;
}
type Callback = (error: any, data: ResponseData, response: request.Response) => void;
interface RequestParams {
[key: string]: any;
base?: string | undefined;
}
interface ResponseData {
[key: string]: any;
}
}
Additional Details
- Last updated: Fri, 02 Jul 2021 19:37:27 GMT
- Dependencies: @types/request, @types/node
- Global values: none
Credits
These definitions were written by BendingBender.
1.7.3
7 months ago
1.7.2
8 months ago
1.7.4
6 months ago
1.7.1
3 years ago
1.7.0
5 years ago
0.0.28
8 years ago
0.0.27
8 years ago
0.0.26
8 years ago
0.0.25-alpha
8 years ago
0.0.24-alpha
8 years ago
0.0.23-alpha
8 years ago
0.0.22-alpha
8 years ago
0.0.21-alpha
8 years ago
0.0.20-alpha
8 years ago
0.0.19-alpha
8 years ago
0.0.14-alpha
8 years ago
0.0.13-alpha
8 years ago