elections-types 1.1.14 → 1.1.16
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 +14 -0
- package/dist/src/types/TwitterUser.js +40 -0
- package/dist/src/types/TwitterUserTag.d.ts +13 -0
- package/dist/src/types/TwitterUserTag.js +31 -0
- package/dist/src/types/YoutubeVideoTag.d.ts +2 -2
- package/dist/src/types/YoutubeVideoTag.js +2 -2
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/types/TwitterTweet.ts +32 -0
- package/src/types/TwitterUser.ts +44 -0
- package/src/types/TwitterUserTag.ts +42 -0
- package/src/types/YoutubeVideoTag.ts +3 -3
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,14 @@
|
|
|
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 subscription_type_id: string;
|
|
10
|
+
readonly verification_type_id: string;
|
|
11
|
+
readonly entities: string;
|
|
12
|
+
constructor(twitter_user: TwitterUser);
|
|
13
|
+
static is(twitter_user: any): twitter_user is TwitterUser;
|
|
14
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
export class TwitterUser {
|
|
2
|
+
twitter_user_id;
|
|
3
|
+
username;
|
|
4
|
+
name;
|
|
5
|
+
url;
|
|
6
|
+
description;
|
|
7
|
+
location;
|
|
8
|
+
create_time;
|
|
9
|
+
subscription_type_id;
|
|
10
|
+
verification_type_id;
|
|
11
|
+
entities;
|
|
12
|
+
constructor(twitter_user) {
|
|
13
|
+
if (!TwitterUser.is(twitter_user)) {
|
|
14
|
+
throw Error("Invalid input.");
|
|
15
|
+
}
|
|
16
|
+
this.twitter_user_id = twitter_user.twitter_user_id;
|
|
17
|
+
this.username = twitter_user.username;
|
|
18
|
+
this.name = twitter_user.name;
|
|
19
|
+
this.url = twitter_user.url;
|
|
20
|
+
this.description = twitter_user.description;
|
|
21
|
+
this.location = twitter_user.location;
|
|
22
|
+
this.create_time = twitter_user.create_time;
|
|
23
|
+
this.subscription_type_id = twitter_user.subscription_type_id;
|
|
24
|
+
this.verification_type_id = twitter_user.verification_type_id;
|
|
25
|
+
this.entities = twitter_user.entities;
|
|
26
|
+
}
|
|
27
|
+
static is(twitter_user) {
|
|
28
|
+
return (twitter_user !== undefined &&
|
|
29
|
+
typeof twitter_user.twitter_user_id === "string" &&
|
|
30
|
+
typeof twitter_user.username === "string" &&
|
|
31
|
+
typeof twitter_user.name === "string" &&
|
|
32
|
+
typeof twitter_user.url === "string" &&
|
|
33
|
+
typeof twitter_user.description === "string" &&
|
|
34
|
+
typeof twitter_user.location === "string" &&
|
|
35
|
+
typeof twitter_user.create_time === "string" &&
|
|
36
|
+
typeof twitter_user.subscription_type_id === "string" &&
|
|
37
|
+
typeof twitter_user.verification_type_id === "string" &&
|
|
38
|
+
typeof twitter_user.entities === "string");
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { YoutubeVideoAux } from "./YoutubeVideo.js";
|
|
2
2
|
export declare class YoutubeVideoTag {
|
|
3
3
|
readonly youtube_video_id: string;
|
|
4
4
|
readonly tag_id: string;
|
|
@@ -9,7 +9,7 @@ export declare class YoutubeVideoTag {
|
|
|
9
9
|
static is(youtube_video_tag: any): youtube_video_tag is YoutubeVideoTag;
|
|
10
10
|
}
|
|
11
11
|
export declare class YoutubeVideoTagAux extends YoutubeVideoTag {
|
|
12
|
-
readonly youtube_video:
|
|
12
|
+
readonly youtube_video: YoutubeVideoAux;
|
|
13
13
|
constructor(youtube_video_tag: any);
|
|
14
14
|
static is(youtube_video_tag: any): youtube_video_tag is YoutubeVideoTagAux;
|
|
15
15
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { YoutubeVideoAux } from "./YoutubeVideo.js";
|
|
2
2
|
export class YoutubeVideoTag {
|
|
3
3
|
youtube_video_id;
|
|
4
4
|
tag_id;
|
|
@@ -32,6 +32,6 @@ export class YoutubeVideoTagAux extends YoutubeVideoTag {
|
|
|
32
32
|
}
|
|
33
33
|
static is(youtube_video_tag) {
|
|
34
34
|
return (YoutubeVideoTag.is(youtube_video_tag) &&
|
|
35
|
-
|
|
35
|
+
YoutubeVideoAux.is(youtube_video_tag.youtube_video));
|
|
36
36
|
}
|
|
37
37
|
}
|
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,44 @@
|
|
|
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 subscription_type_id : string
|
|
10
|
+
readonly verification_type_id : string
|
|
11
|
+
readonly entities : string
|
|
12
|
+
|
|
13
|
+
constructor(twitter_user : TwitterUser) {
|
|
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.subscription_type_id = twitter_user.subscription_type_id
|
|
25
|
+
this.verification_type_id = twitter_user.verification_type_id
|
|
26
|
+
this.entities = twitter_user.entities
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
static is(twitter_user : any) : twitter_user is TwitterUser {
|
|
30
|
+
return (
|
|
31
|
+
twitter_user !== undefined &&
|
|
32
|
+
typeof twitter_user.twitter_user_id === "string" &&
|
|
33
|
+
typeof twitter_user.username === "string" &&
|
|
34
|
+
typeof twitter_user.name === "string" &&
|
|
35
|
+
typeof twitter_user.url === "string" &&
|
|
36
|
+
typeof twitter_user.description === "string" &&
|
|
37
|
+
typeof twitter_user.location === "string" &&
|
|
38
|
+
typeof twitter_user.create_time === "string" &&
|
|
39
|
+
typeof twitter_user.subscription_type_id === "string" &&
|
|
40
|
+
typeof twitter_user.verification_type_id === "string" &&
|
|
41
|
+
typeof twitter_user.entities === "string"
|
|
42
|
+
)
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { YoutubeVideoAux } from "./YoutubeVideo"
|
|
2
2
|
|
|
3
3
|
export class YoutubeVideoTag {
|
|
4
4
|
readonly youtube_video_id : string
|
|
@@ -29,7 +29,7 @@ export class YoutubeVideoTag {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
export class YoutubeVideoTagAux extends YoutubeVideoTag {
|
|
32
|
-
readonly youtube_video :
|
|
32
|
+
readonly youtube_video : YoutubeVideoAux
|
|
33
33
|
|
|
34
34
|
constructor(youtube_video_tag : any) {
|
|
35
35
|
if (!YoutubeVideoTagAux.is(youtube_video_tag)) {
|
|
@@ -42,7 +42,7 @@ export class YoutubeVideoTagAux extends YoutubeVideoTag {
|
|
|
42
42
|
static is(youtube_video_tag : any) : youtube_video_tag is YoutubeVideoTagAux {
|
|
43
43
|
return (
|
|
44
44
|
YoutubeVideoTag.is(youtube_video_tag) &&
|
|
45
|
-
|
|
45
|
+
YoutubeVideoAux.is(youtube_video_tag.youtube_video)
|
|
46
46
|
)
|
|
47
47
|
}
|
|
48
48
|
}
|