elections-types 1.1.15 → 1.1.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/index.d.ts +2 -0
- package/dist/src/index.js +2 -0
- package/dist/src/types/TwitterTweet.d.ts +1 -10
- package/dist/src/types/TwitterTweet.js +31 -27
- package/dist/src/types/TwitterUser.d.ts +15 -0
- package/dist/src/types/TwitterUser.js +43 -0
- package/dist/src/types/TwitterUserTag.d.ts +13 -0
- package/dist/src/types/TwitterUserTag.js +31 -0
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/types/TwitterTweet.ts +32 -0
- package/src/types/TwitterUser.ts +47 -0
- package/src/types/TwitterUserTag.ts +42 -0
package/dist/src/index.d.ts
CHANGED
|
@@ -18,6 +18,8 @@ export * from "./types/FederalElectionF24File.js";
|
|
|
18
18
|
export * from "./types/FormTypeID.js";
|
|
19
19
|
export * from "./types/State.js";
|
|
20
20
|
export * from "./types/Tweet.js";
|
|
21
|
+
export * from "./types/TwitterUser.js";
|
|
22
|
+
export * from "./types/TwitterUserTag.js";
|
|
21
23
|
export * from "./types/User.js";
|
|
22
24
|
export * from "./types/UserFederalElection.js";
|
|
23
25
|
export * from "./types/Video.js";
|
package/dist/src/index.js
CHANGED
|
@@ -18,6 +18,8 @@ export * from "./types/FederalElectionF24File.js";
|
|
|
18
18
|
export * from "./types/FormTypeID.js";
|
|
19
19
|
export * from "./types/State.js";
|
|
20
20
|
export * from "./types/Tweet.js";
|
|
21
|
+
export * from "./types/TwitterUser.js";
|
|
22
|
+
export * from "./types/TwitterUserTag.js";
|
|
21
23
|
export * from "./types/User.js";
|
|
22
24
|
export * from "./types/UserFederalElection.js";
|
|
23
25
|
export * from "./types/Video.js";
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
export
|
|
2
|
-
readonly twitter_tweet_id: string;
|
|
3
|
-
readonly username: string;
|
|
4
|
-
readonly url: string;
|
|
5
|
-
readonly twitter_tweet_time: string;
|
|
6
|
-
readonly twitter_tweet_content?: string;
|
|
7
|
-
readonly html: string;
|
|
8
|
-
constructor(twitter_tweet: TwitterTweet);
|
|
9
|
-
static is(twitter_tweet: any): twitter_tweet is TwitterTweet;
|
|
10
|
-
}
|
|
1
|
+
export {};
|
|
@@ -1,27 +1,31 @@
|
|
|
1
|
-
export class TwitterTweet {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
// export class TwitterTweet {
|
|
2
|
+
// readonly twitter_tweet_id : string
|
|
3
|
+
// readonly twitter_user_id : string
|
|
4
|
+
// readonly supreme_twitter_tweet_id : string
|
|
5
|
+
// readonly super_reply_twitter_tweet_ids : string[]
|
|
6
|
+
// readonly super_quote_twitter_tweet_id? : string
|
|
7
|
+
// readonly super_retweet_twitter_tweet_id? : string
|
|
8
|
+
// readonly draft_twitter_tweet_ids : string[]
|
|
9
|
+
// readonly is_sensitive : boolean
|
|
10
|
+
// readonly is_sponsored : boolean
|
|
11
|
+
// readonly lang_id : string
|
|
12
|
+
// readonly text : string
|
|
13
|
+
// readonly content : string
|
|
14
|
+
// readonly entities : string
|
|
15
|
+
// readonly replies_type_id : string
|
|
16
|
+
export {};
|
|
17
|
+
// constructor(twitter_tweet : TwitterTweet) {
|
|
18
|
+
// if (!TwitterTweet.is(twitter_tweet)) {
|
|
19
|
+
// throw Error("Invalid input.")
|
|
20
|
+
// }
|
|
21
|
+
// this.twitter_tweet_id = twitter_tweet.twitter_tweet_id
|
|
22
|
+
// this.twitter_user_id = twitter_tweet.twitter_user_id
|
|
23
|
+
// }
|
|
24
|
+
// static is(twitter_tweet : any) : twitter_tweet is TwitterTweet {
|
|
25
|
+
// return (
|
|
26
|
+
// twitter_tweet !== undefined &&
|
|
27
|
+
// typeof twitter_tweet.twitter_tweet_id === "string" &&
|
|
28
|
+
// typeof twitter_tweet.twitter_user_id === "string"
|
|
29
|
+
// )
|
|
30
|
+
// }
|
|
31
|
+
// }
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare class TwitterUser {
|
|
2
|
+
readonly twitter_user_id: string;
|
|
3
|
+
readonly username: string;
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly url: string;
|
|
6
|
+
readonly description: string;
|
|
7
|
+
readonly location: string;
|
|
8
|
+
readonly create_time: string;
|
|
9
|
+
readonly is_protected: boolean;
|
|
10
|
+
readonly subscription_type_id: string;
|
|
11
|
+
readonly verification_type_id: string;
|
|
12
|
+
readonly entities: string;
|
|
13
|
+
constructor(twitter_user: TwitterUser);
|
|
14
|
+
static is(twitter_user: any): twitter_user is TwitterUser;
|
|
15
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
export class TwitterUser {
|
|
2
|
+
twitter_user_id;
|
|
3
|
+
username;
|
|
4
|
+
name;
|
|
5
|
+
url;
|
|
6
|
+
description;
|
|
7
|
+
location;
|
|
8
|
+
create_time;
|
|
9
|
+
is_protected;
|
|
10
|
+
subscription_type_id;
|
|
11
|
+
verification_type_id;
|
|
12
|
+
entities;
|
|
13
|
+
constructor(twitter_user) {
|
|
14
|
+
if (!TwitterUser.is(twitter_user)) {
|
|
15
|
+
throw Error("Invalid input.");
|
|
16
|
+
}
|
|
17
|
+
this.twitter_user_id = twitter_user.twitter_user_id;
|
|
18
|
+
this.username = twitter_user.username;
|
|
19
|
+
this.name = twitter_user.name;
|
|
20
|
+
this.url = twitter_user.url;
|
|
21
|
+
this.description = twitter_user.description;
|
|
22
|
+
this.location = twitter_user.location;
|
|
23
|
+
this.create_time = twitter_user.create_time;
|
|
24
|
+
this.is_protected = twitter_user.is_protected;
|
|
25
|
+
this.subscription_type_id = twitter_user.subscription_type_id;
|
|
26
|
+
this.verification_type_id = twitter_user.verification_type_id;
|
|
27
|
+
this.entities = twitter_user.entities;
|
|
28
|
+
}
|
|
29
|
+
static is(twitter_user) {
|
|
30
|
+
return (twitter_user !== undefined &&
|
|
31
|
+
typeof twitter_user.twitter_user_id === "string" &&
|
|
32
|
+
typeof twitter_user.username === "string" &&
|
|
33
|
+
typeof twitter_user.name === "string" &&
|
|
34
|
+
typeof twitter_user.url === "string" &&
|
|
35
|
+
typeof twitter_user.description === "string" &&
|
|
36
|
+
typeof twitter_user.location === "string" &&
|
|
37
|
+
typeof twitter_user.create_time === "string" &&
|
|
38
|
+
typeof twitter_user.is_protected === "boolean" &&
|
|
39
|
+
typeof twitter_user.subscription_type_id === "string" &&
|
|
40
|
+
typeof twitter_user.verification_type_id === "string" &&
|
|
41
|
+
typeof twitter_user.entities === "string");
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { TwitterUser } from "./TwitterUser.js";
|
|
2
|
+
export declare class TwitterUserTag {
|
|
3
|
+
readonly twitter_user_id: string;
|
|
4
|
+
readonly tag_id: string;
|
|
5
|
+
readonly [x: string]: any;
|
|
6
|
+
constructor(twitter_user_tag: TwitterUserTag);
|
|
7
|
+
static is(twitter_user_tag: any): twitter_user_tag is TwitterUserTag;
|
|
8
|
+
}
|
|
9
|
+
export declare class TwitterUserTagAux extends TwitterUserTag {
|
|
10
|
+
readonly twitter_user: TwitterUser;
|
|
11
|
+
constructor(twitter_user_tag: any);
|
|
12
|
+
static is(twitter_user_tag: any): twitter_user_tag is TwitterUserTagAux;
|
|
13
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { TwitterUser } from "./TwitterUser.js";
|
|
2
|
+
export class TwitterUserTag {
|
|
3
|
+
twitter_user_id;
|
|
4
|
+
tag_id;
|
|
5
|
+
constructor(twitter_user_tag) {
|
|
6
|
+
if (!TwitterUserTag.is(twitter_user_tag)) {
|
|
7
|
+
throw Error("Invalid input.");
|
|
8
|
+
}
|
|
9
|
+
this.twitter_user_id = twitter_user_tag.twitter_user_id;
|
|
10
|
+
this.tag_id = twitter_user_tag.tag_id;
|
|
11
|
+
}
|
|
12
|
+
static is(twitter_user_tag) {
|
|
13
|
+
return (twitter_user_tag !== undefined &&
|
|
14
|
+
typeof twitter_user_tag.twitter_user_id === "string" &&
|
|
15
|
+
typeof twitter_user_tag.tag_id === "string");
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export class TwitterUserTagAux extends TwitterUserTag {
|
|
19
|
+
twitter_user;
|
|
20
|
+
constructor(twitter_user_tag) {
|
|
21
|
+
if (!TwitterUserTagAux.is(twitter_user_tag)) {
|
|
22
|
+
throw Error("Invalid input.");
|
|
23
|
+
}
|
|
24
|
+
super(twitter_user_tag);
|
|
25
|
+
this.twitter_user = twitter_user_tag.twitter_user;
|
|
26
|
+
}
|
|
27
|
+
static is(twitter_user_tag) {
|
|
28
|
+
return (TwitterUserTag.is(twitter_user_tag) &&
|
|
29
|
+
TwitterUser.is(twitter_user_tag.twitter_user));
|
|
30
|
+
}
|
|
31
|
+
}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -18,6 +18,8 @@ export * from "./types/FederalElectionF24File"
|
|
|
18
18
|
export * from "./types/FormTypeID"
|
|
19
19
|
export * from "./types/State"
|
|
20
20
|
export * from "./types/Tweet"
|
|
21
|
+
export * from "./types/TwitterUser"
|
|
22
|
+
export * from "./types/TwitterUserTag"
|
|
21
23
|
export * from "./types/User"
|
|
22
24
|
export * from "./types/UserFederalElection"
|
|
23
25
|
export * from "./types/Video"
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// export class TwitterTweet {
|
|
2
|
+
// readonly twitter_tweet_id : string
|
|
3
|
+
// readonly twitter_user_id : string
|
|
4
|
+
// readonly supreme_twitter_tweet_id : string
|
|
5
|
+
// readonly super_reply_twitter_tweet_ids : string[]
|
|
6
|
+
// readonly super_quote_twitter_tweet_id? : string
|
|
7
|
+
// readonly super_retweet_twitter_tweet_id? : string
|
|
8
|
+
// readonly draft_twitter_tweet_ids : string[]
|
|
9
|
+
// readonly is_sensitive : boolean
|
|
10
|
+
// readonly is_sponsored : boolean
|
|
11
|
+
// readonly lang_id : string
|
|
12
|
+
// readonly text : string
|
|
13
|
+
// readonly content : string
|
|
14
|
+
// readonly entities : string
|
|
15
|
+
// readonly replies_type_id : string
|
|
16
|
+
|
|
17
|
+
// constructor(twitter_tweet : TwitterTweet) {
|
|
18
|
+
// if (!TwitterTweet.is(twitter_tweet)) {
|
|
19
|
+
// throw Error("Invalid input.")
|
|
20
|
+
// }
|
|
21
|
+
// this.twitter_tweet_id = twitter_tweet.twitter_tweet_id
|
|
22
|
+
// this.twitter_user_id = twitter_tweet.twitter_user_id
|
|
23
|
+
// }
|
|
24
|
+
|
|
25
|
+
// static is(twitter_tweet : any) : twitter_tweet is TwitterTweet {
|
|
26
|
+
// return (
|
|
27
|
+
// twitter_tweet !== undefined &&
|
|
28
|
+
// typeof twitter_tweet.twitter_tweet_id === "string" &&
|
|
29
|
+
// typeof twitter_tweet.twitter_user_id === "string"
|
|
30
|
+
// )
|
|
31
|
+
// }
|
|
32
|
+
// }
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
export class TwitterUser {
|
|
2
|
+
readonly twitter_user_id : string
|
|
3
|
+
readonly username : string
|
|
4
|
+
readonly name : string
|
|
5
|
+
readonly url : string
|
|
6
|
+
readonly description : string
|
|
7
|
+
readonly location : string
|
|
8
|
+
readonly create_time : string
|
|
9
|
+
readonly is_protected : boolean
|
|
10
|
+
readonly subscription_type_id : string
|
|
11
|
+
readonly verification_type_id : string
|
|
12
|
+
readonly entities : string
|
|
13
|
+
|
|
14
|
+
constructor(twitter_user : TwitterUser) {
|
|
15
|
+
if (!TwitterUser.is(twitter_user)) {
|
|
16
|
+
throw Error("Invalid input.")
|
|
17
|
+
}
|
|
18
|
+
this.twitter_user_id = twitter_user.twitter_user_id
|
|
19
|
+
this.username = twitter_user.username
|
|
20
|
+
this.name = twitter_user.name
|
|
21
|
+
this.url = twitter_user.url
|
|
22
|
+
this.description = twitter_user.description
|
|
23
|
+
this.location = twitter_user.location
|
|
24
|
+
this.create_time = twitter_user.create_time
|
|
25
|
+
this.is_protected = twitter_user.is_protected
|
|
26
|
+
this.subscription_type_id = twitter_user.subscription_type_id
|
|
27
|
+
this.verification_type_id = twitter_user.verification_type_id
|
|
28
|
+
this.entities = twitter_user.entities
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
static is(twitter_user : any) : twitter_user is TwitterUser {
|
|
32
|
+
return (
|
|
33
|
+
twitter_user !== undefined &&
|
|
34
|
+
typeof twitter_user.twitter_user_id === "string" &&
|
|
35
|
+
typeof twitter_user.username === "string" &&
|
|
36
|
+
typeof twitter_user.name === "string" &&
|
|
37
|
+
typeof twitter_user.url === "string" &&
|
|
38
|
+
typeof twitter_user.description === "string" &&
|
|
39
|
+
typeof twitter_user.location === "string" &&
|
|
40
|
+
typeof twitter_user.create_time === "string" &&
|
|
41
|
+
typeof twitter_user.is_protected === "boolean" &&
|
|
42
|
+
typeof twitter_user.subscription_type_id === "string" &&
|
|
43
|
+
typeof twitter_user.verification_type_id === "string" &&
|
|
44
|
+
typeof twitter_user.entities === "string"
|
|
45
|
+
)
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { TwitterUser } from "./TwitterUser"
|
|
2
|
+
|
|
3
|
+
export class TwitterUserTag {
|
|
4
|
+
readonly twitter_user_id : string
|
|
5
|
+
readonly tag_id : string
|
|
6
|
+
readonly [x : string] : any
|
|
7
|
+
|
|
8
|
+
constructor(twitter_user_tag : TwitterUserTag) {
|
|
9
|
+
if (!TwitterUserTag.is(twitter_user_tag)) {
|
|
10
|
+
throw Error("Invalid input.")
|
|
11
|
+
}
|
|
12
|
+
this.twitter_user_id = twitter_user_tag.twitter_user_id
|
|
13
|
+
this.tag_id = twitter_user_tag.tag_id
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
static is(twitter_user_tag : any) : twitter_user_tag is TwitterUserTag {
|
|
17
|
+
return (
|
|
18
|
+
twitter_user_tag !== undefined &&
|
|
19
|
+
typeof twitter_user_tag.twitter_user_id === "string" &&
|
|
20
|
+
typeof twitter_user_tag.tag_id === "string"
|
|
21
|
+
)
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export class TwitterUserTagAux extends TwitterUserTag {
|
|
26
|
+
readonly twitter_user : TwitterUser
|
|
27
|
+
|
|
28
|
+
constructor(twitter_user_tag : any) {
|
|
29
|
+
if (!TwitterUserTagAux.is(twitter_user_tag)) {
|
|
30
|
+
throw Error("Invalid input.")
|
|
31
|
+
}
|
|
32
|
+
super(twitter_user_tag)
|
|
33
|
+
this.twitter_user = twitter_user_tag.twitter_user
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
static is(twitter_user_tag : any) : twitter_user_tag is TwitterUserTagAux {
|
|
37
|
+
return (
|
|
38
|
+
TwitterUserTag.is(twitter_user_tag) &&
|
|
39
|
+
TwitterUser.is(twitter_user_tag.twitter_user)
|
|
40
|
+
)
|
|
41
|
+
}
|
|
42
|
+
}
|