canny-api-js
Version:
Unofficial node API wrapper for Canny's API (https://canny.io/).
43 lines (42 loc) • 1.56 kB
TypeScript
import { AxiosInstance } from 'axios';
interface ICannyVotesListArgs {
/** The id of the board you'd like to fetch votes for. */
boardID?: string;
/** The number of votes you'd like to fetch. Defaults to 10 if not specified. */
limit?: number;
/** Specify a postID to only fetch votes for a specific post. */
postID?: string;
/** The number of votes you'd like to skip before starting to fetch. Defaults to 0 if not specified. */
skip?: number;
/** Specify a userID to only fetch votes for a specific user. */
userID?: string;
}
interface ICannyVotesListResponse {
hasMore: boolean;
votes: ICannyTag[];
}
interface ICannyVotesCreateArgs {
/** The unique identifier of the post to vote on. */
postID: string;
/** The unique identifier of the voter (The `id` of an `User`). */
voterID: string;
}
interface ICannyVotesDeleteArgs {
/** The unique identifier of the post to vote on. */
postID: string;
/** The unique identifier of the voter (The `id` of an `User`). */
voterID: string;
}
export default class Votes {
static VOTES_RETRIEVE_ROUTE: string;
static VOTES_LIST_ROUTE: string;
static VOTES_CREATE_ROUTE: string;
static VOTES_DELETE_ROUTE: string;
private axios;
constructor(axios: AxiosInstance);
retrieve(id: string): Promise<ICannyVote>;
list(args?: ICannyVotesListArgs): Promise<ICannyVotesListResponse>;
create(args: ICannyVotesCreateArgs): Promise<boolean>;
delete(args: ICannyVotesDeleteArgs): Promise<boolean>;
}
export {};