triangle-types 1.0.210 → 1.0.212

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.
@@ -16,6 +16,7 @@ export declare class TwitterTweet {
16
16
  readonly attachments_json?: string;
17
17
  readonly entities_json?: string;
18
18
  readonly reply_settings_type_id: string;
19
+ readonly vector?: number[];
19
20
  constructor(twitter_tweet: TwitterTweet);
20
21
  static is(twitter_tweet: any): twitter_tweet is TwitterTweet;
21
22
  }
@@ -16,6 +16,7 @@ export class TwitterTweet {
16
16
  attachments_json;
17
17
  entities_json;
18
18
  reply_settings_type_id;
19
+ vector;
19
20
  constructor(twitter_tweet) {
20
21
  if (!TwitterTweet.is(twitter_tweet)) {
21
22
  throw Error("Invalid input.");
@@ -37,6 +38,7 @@ export class TwitterTweet {
37
38
  this.attachments_json = twitter_tweet.attachments_json;
38
39
  this.entities_json = twitter_tweet.entities_json;
39
40
  this.reply_settings_type_id = twitter_tweet.reply_settings_type_id;
41
+ this.vector = twitter_tweet.vector;
40
42
  }
41
43
  static is(twitter_tweet) {
42
44
  return (twitter_tweet !== undefined &&
@@ -56,6 +58,7 @@ export class TwitterTweet {
56
58
  (twitter_tweet.media_json === undefined || typeof twitter_tweet.media_json === "string") &&
57
59
  (twitter_tweet.attachments_json === undefined || typeof twitter_tweet.attachments_json === "string") &&
58
60
  (twitter_tweet.entities_json === undefined || typeof twitter_tweet.entities_json === "string") &&
59
- typeof twitter_tweet.reply_settings_type_id === "string");
61
+ typeof twitter_tweet.reply_settings_type_id === "string" &&
62
+ (twitter_tweet.vector === undefined || Array.isArray(twitter_tweet.vector) && twitter_tweet.vector.every((coordinate) => typeof coordinate === "number")));
60
63
  }
61
64
  }
@@ -9,8 +9,8 @@ export declare class TwitterUser {
9
9
  readonly affiliated_twitter_user_id?: string;
10
10
  readonly is_protected: boolean;
11
11
  readonly is_parody: boolean;
12
- readonly subscription_type_id: string;
13
- readonly verification_type_id: string;
12
+ readonly subscription_type_id?: string;
13
+ readonly verification_type_id?: string;
14
14
  readonly entities?: string;
15
15
  readonly scout_id?: string;
16
16
  constructor(twitter_user: TwitterUser);
@@ -44,8 +44,8 @@ export class TwitterUser {
44
44
  (twitter_user.affiliated_twitter_user_id === undefined || typeof twitter_user.affiliated_twitter_user_id == "string") &&
45
45
  typeof twitter_user.is_protected === "boolean" &&
46
46
  typeof twitter_user.is_parody === "boolean" &&
47
- typeof twitter_user.subscription_type_id === "string" &&
48
- typeof twitter_user.verification_type_id === "string" &&
47
+ (twitter_user.subscription_type_id === undefined || typeof twitter_user.subscription_type_id === "string") &&
48
+ (twitter_user.verification_type_id === undefined || typeof twitter_user.verification_type_id === "string") &&
49
49
  (twitter_user.entities === undefined || typeof twitter_user.entities === "string") &&
50
50
  (twitter_user.scout_id === undefined || typeof twitter_user.scout_id === "string"));
51
51
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-types",
3
- "version": "1.0.210",
3
+ "version": "1.0.212",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
@@ -16,6 +16,7 @@ export class TwitterTweet {
16
16
  readonly attachments_json? : string
17
17
  readonly entities_json? : string
18
18
  readonly reply_settings_type_id : string
19
+ readonly vector? : number[]
19
20
 
20
21
  constructor(twitter_tweet : TwitterTweet) {
21
22
  if (!TwitterTweet.is(twitter_tweet)) {
@@ -38,6 +39,7 @@ export class TwitterTweet {
38
39
  this.attachments_json = twitter_tweet.attachments_json
39
40
  this.entities_json = twitter_tweet.entities_json
40
41
  this.reply_settings_type_id = twitter_tweet.reply_settings_type_id
42
+ this.vector = twitter_tweet.vector
41
43
  }
42
44
 
43
45
  static is(twitter_tweet : any) : twitter_tweet is TwitterTweet {
@@ -59,7 +61,8 @@ export class TwitterTweet {
59
61
  (twitter_tweet.media_json === undefined || typeof twitter_tweet.media_json === "string") &&
60
62
  (twitter_tweet.attachments_json === undefined || typeof twitter_tweet.attachments_json === "string") &&
61
63
  (twitter_tweet.entities_json === undefined || typeof twitter_tweet.entities_json === "string") &&
62
- typeof twitter_tweet.reply_settings_type_id === "string"
64
+ typeof twitter_tweet.reply_settings_type_id === "string" &&
65
+ (twitter_tweet.vector === undefined || Array.isArray(twitter_tweet.vector) && twitter_tweet.vector.every((coordinate : any) => typeof coordinate === "number"))
63
66
 
64
67
  )
65
68
  }
@@ -9,8 +9,8 @@ export class TwitterUser {
9
9
  readonly affiliated_twitter_user_id? : string
10
10
  readonly is_protected : boolean
11
11
  readonly is_parody : boolean
12
- readonly subscription_type_id : string
13
- readonly verification_type_id : string
12
+ readonly subscription_type_id? : string
13
+ readonly verification_type_id? : string
14
14
  readonly entities? : string
15
15
  readonly scout_id? : string
16
16
 
@@ -47,8 +47,8 @@ export class TwitterUser {
47
47
  (twitter_user.affiliated_twitter_user_id === undefined || typeof twitter_user.affiliated_twitter_user_id == "string") &&
48
48
  typeof twitter_user.is_protected === "boolean" &&
49
49
  typeof twitter_user.is_parody === "boolean" &&
50
- typeof twitter_user.subscription_type_id === "string" &&
51
- typeof twitter_user.verification_type_id === "string" &&
50
+ (twitter_user.subscription_type_id === undefined || typeof twitter_user.subscription_type_id === "string") &&
51
+ (twitter_user.verification_type_id === undefined || typeof twitter_user.verification_type_id === "string") &&
52
52
  (twitter_user.entities === undefined || typeof twitter_user.entities === "string") &&
53
53
  (twitter_user.scout_id === undefined || typeof twitter_user.scout_id === "string")
54
54
  )