rule34js
Version:
simple javascript api for `rule34.xxx`
86 lines (85 loc) • 2.2 kB
TypeScript
declare type Rule34Options = {
/** Tags for find */
tags: String[];
/** tags_parsed depends on it */
parse_tags: boolean;
/** Removes empty tags ('')
* parse_tags is required
*/
remove_empty: boolean;
/** Page number */
pid: number;
/** Limit of posts
* 100 is max */
limit: number;
};
/** some options */
declare type Rule34OptionsOptional = Partial<Rule34Options>;
/** Definitions for available post's returning values */
declare type Post = {
/** File, { png, jpeg, webm} */
file_url: string;
/** file_url height */
height: number;
/** file_url width */
width: number;
/** Sampled file url (same as file_url if video) */
sample_url: string;
/** Sampled file width */
sample_width: number;
/** Sampled file height */
sample_height: number;
/** Preview file url */
preview_url: string;
/** Preview file width */
preview_width: number;
/** Preview file height */
preview_height: number;
/** Score of post */
score: number;
/** Parent id */
parent_id: number;
/** Rating */
rating: string;
/** Raw tags string */
tags: string;
/** Tags, but its massive */
tags_parsed: string[];
/** ID of post */
id: number;
/** Change of post */
change: number;
/** MD5 */
md5: string;
/** Creator ID */
creator_id: number;
/** Has children ? */
has_children: boolean;
/** Create date */
created_at: string;
/** Status */
status: string;
/** Source */
source: string;
/** Has Notes */
has_notes: boolean;
/** Has Comments */
has_comments: boolean;
};
declare type Rule34jsOutput = {
/** Count of all posts founded by required tags */
count: number;
/** Offset from start
* offset = pid * limit
*/
offset: number;
/** Received posts */
posts: Post[];
};
/**
* Returns massive of posts
* @param {Rule34OptionsOptional} options
* @returns {Post[]}
*/
export declare function posts(options: Rule34OptionsOptional): Promise<Rule34jsOutput>;
export {};