Comments (2)
yeaa, it's good idea, but i'm sorry i too busy at RL, any time at holiday i'll convert it to ts. also youu can add types, it make more easier to read
from wattpad.js.
here are the types I made so you can implement them into the program
interface User {
name: string;
avatar: string;
fullName: string;
}
interface Profile {
username:string;
avatar:string;
isPrivate:boolean;
backgroundUrl:string;
followerRequest:string;
followingRequest:string;
isBlockedbyCurrentUser:boolean;
name:string;
description:string;
genderCode:string;
language:number;
createDate:string;
location:string;
verified:boolean;
ambassador:boolean;
facebook:string;
twitter:string;
website:string;
votesReceved:number;
numStoriesPublished:number;
numFollowing:number;
numFollowers:number;
numLists:number;
verified_email:number;
is_staff:boolean;
highlight_color:string;
programs:{ [key:string]:boolean };
externalId:string;
showSocialNetwork:boolean;
}
interface Language {
id: number;
name: string;
}
interface Part {
id: number;
title: string;
modifyDate: string;
length: number;
videoId: string;
photoUrl: string;
commentCount: number;
voteCount: number;
readCount: number;
dedication: { [key: string]: string };
text_url: {
text: string;
}
}
interface ViewPart {
id: number;
title: string;
url: string;
rating: number;
modifyDate: string;
photoUrl: string;
commentCount: number;
voteCount: number;
readCount: number;
}
interface Error {
error_code: number;
error_typr: string;
message: string;
fields: string[];
}
export interface Details {
id: string;
title: string;
length: number;
createDate: string;
modifyDate: string;
voteCount: number;
readCount: number;
commentCount: number;
language: Language;
user: User;
description: string;
cover: string;
completed: boolean;
categories: number[];
tags: string[];
rating: number;
copyright: number;
url: string;
numParts: number;
lastPublishedPart: {
createDate: string;
};
parts: Part[];
}
interface Story {
text: string;
text_hash: string;
}
declare module "wattpad.js" {
export default class Wattpad {
constructor();
static Stories: {
detail(id: string | number): Promise<Details | Error>;
read(id: string | number): Promise<Story | Error>;
};
static User: {
lookup(username: string): Promise<Profile | Error>;
};
// Add other methods as needed
}
}
from wattpad.js.
Related Issues (1)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wattpad.js.