triangle-types 1.0.38 → 1.0.39

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.
@@ -1,3 +1,5 @@
1
+ import { ScoutDocument } from "../scout/ScoutDocument.js";
2
+ import { TwitterTweet } from "../twitter/TwitterTweet.js";
1
3
  declare const fragment_type_ids: readonly ["LINE", "CHAR"];
2
4
  export type FragmentTypeID = typeof fragment_type_ids[number];
3
5
  export declare function is_fragment_type_id(fragment_type_id: any): fragment_type_id is FragmentTypeID;
@@ -42,10 +44,20 @@ export declare class ScoutDocumentFragment extends Fragment {
42
44
  constructor(fragment: ScoutDocumentFragment);
43
45
  static is(fragment: any): fragment is ScoutDocumentFragment;
44
46
  }
47
+ export declare class ScoutDocumentFragmentAux extends ScoutDocumentFragment {
48
+ readonly scout_document: ScoutDocument;
49
+ constructor(fragment: ScoutDocumentFragmentAux);
50
+ static is(fragment: any): fragment is ScoutDocumentFragmentAux;
51
+ }
45
52
  export declare class TwitterTweetFragment extends Fragment {
46
53
  readonly document_type_id: "twitter_tweet";
47
54
  readonly twitter_tweet_id: string;
48
55
  constructor(fragment: TwitterTweetFragment);
49
56
  static is(fragment: any): fragment is TwitterTweetFragment;
50
57
  }
58
+ export declare class TwitterTweetFragmentAux extends TwitterTweetFragment {
59
+ readonly twitter_tweet: TwitterTweet;
60
+ constructor(fragment: TwitterTweetFragmentAux);
61
+ static is(fragment: any): fragment is TwitterTweetFragmentAux;
62
+ }
51
63
  export {};
@@ -1,3 +1,5 @@
1
+ import { ScoutDocument } from "../scout/ScoutDocument.js";
2
+ import { TwitterTweet } from "../twitter/TwitterTweet.js";
1
3
  const fragment_type_ids = ["LINE", "CHAR"];
2
4
  export function is_fragment_type_id(fragment_type_id) {
3
5
  return fragment_type_ids.includes(fragment_type_id);
@@ -94,6 +96,22 @@ export class PressArticleTagFragment extends Fragment {
94
96
  typeof fragment.tag_id === "string");
95
97
  }
96
98
  }
99
+ // export class PressArticleTagFragmentAux extends PressArticleTagFragment {
100
+ // readonly press_article_ : PressArticleTagAux
101
+ // constructor(fragment : PressArticleTagFragmentAux) {
102
+ // if (!PressArticleTagFragmentAux.is(fragment)) {
103
+ // throw Error("Invalid input.")
104
+ // }
105
+ // super(fragment)
106
+ // this.scout_document = fragment.scout_document
107
+ // }
108
+ // static is(fragment : any) : fragment is PressArticleTagFragmentAux {
109
+ // return (
110
+ // Fragment.is(fragment) &&
111
+ // ScoutDocument.is(fragment.scout_document)
112
+ // )
113
+ // }
114
+ // }
97
115
  export class ScoutDocumentFragment extends Fragment {
98
116
  document_type_id;
99
117
  scout_document_id;
@@ -111,6 +129,20 @@ export class ScoutDocumentFragment extends Fragment {
111
129
  typeof fragment.scout_document_id === "string");
112
130
  }
113
131
  }
132
+ export class ScoutDocumentFragmentAux extends ScoutDocumentFragment {
133
+ scout_document;
134
+ constructor(fragment) {
135
+ if (!ScoutDocumentFragmentAux.is(fragment)) {
136
+ throw Error("Invalid input.");
137
+ }
138
+ super(fragment);
139
+ this.scout_document = fragment.scout_document;
140
+ }
141
+ static is(fragment) {
142
+ return (Fragment.is(fragment) &&
143
+ ScoutDocument.is(fragment.scout_document));
144
+ }
145
+ }
114
146
  export class TwitterTweetFragment extends Fragment {
115
147
  document_type_id;
116
148
  twitter_tweet_id;
@@ -128,3 +160,17 @@ export class TwitterTweetFragment extends Fragment {
128
160
  typeof fragment.twitter_tweet_id === "string");
129
161
  }
130
162
  }
163
+ export class TwitterTweetFragmentAux extends TwitterTweetFragment {
164
+ twitter_tweet;
165
+ constructor(fragment) {
166
+ if (!TwitterTweetFragmentAux.is(fragment)) {
167
+ throw Error("Invalid input.");
168
+ }
169
+ super(fragment);
170
+ this.twitter_tweet = fragment.twitter_tweet;
171
+ }
172
+ static is(fragment) {
173
+ return (Fragment.is(fragment) &&
174
+ TwitterTweet.is(fragment.twitter_tweet));
175
+ }
176
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "triangle-types",
3
- "version": "1.0.38",
3
+ "version": "1.0.39",
4
4
  "main": "dist/src/index.js",
5
5
  "types": "dist/src/index.d.ts",
6
6
  "scripts": {
@@ -1,3 +1,7 @@
1
+ import { PressArticleTagAux } from "../press/PressArticleTag"
2
+ import { ScoutDocument } from "../scout/ScoutDocument"
3
+ import { TwitterTweet } from "../twitter/TwitterTweet"
4
+
1
5
  const fragment_type_ids = ["LINE", "CHAR"] as const
2
6
 
3
7
  export type FragmentTypeID = typeof fragment_type_ids[number]
@@ -123,6 +127,25 @@ export class PressArticleTagFragment extends Fragment {
123
127
  }
124
128
  }
125
129
 
130
+ // export class PressArticleTagFragmentAux extends PressArticleTagFragment {
131
+ // readonly press_article_ : PressArticleTagAux
132
+
133
+ // constructor(fragment : PressArticleTagFragmentAux) {
134
+ // if (!PressArticleTagFragmentAux.is(fragment)) {
135
+ // throw Error("Invalid input.")
136
+ // }
137
+ // super(fragment)
138
+ // this.scout_document = fragment.scout_document
139
+ // }
140
+
141
+ // static is(fragment : any) : fragment is PressArticleTagFragmentAux {
142
+ // return (
143
+ // Fragment.is(fragment) &&
144
+ // ScoutDocument.is(fragment.scout_document)
145
+ // )
146
+ // }
147
+ // }
148
+
126
149
  export class ScoutDocumentFragment extends Fragment {
127
150
  readonly document_type_id : "scout_document"
128
151
  readonly scout_document_id : string
@@ -145,6 +168,25 @@ export class ScoutDocumentFragment extends Fragment {
145
168
  }
146
169
  }
147
170
 
171
+ export class ScoutDocumentFragmentAux extends ScoutDocumentFragment {
172
+ readonly scout_document : ScoutDocument
173
+
174
+ constructor(fragment : ScoutDocumentFragmentAux) {
175
+ if (!ScoutDocumentFragmentAux.is(fragment)) {
176
+ throw Error("Invalid input.")
177
+ }
178
+ super(fragment)
179
+ this.scout_document = fragment.scout_document
180
+ }
181
+
182
+ static is(fragment : any) : fragment is ScoutDocumentFragmentAux {
183
+ return (
184
+ Fragment.is(fragment) &&
185
+ ScoutDocument.is(fragment.scout_document)
186
+ )
187
+ }
188
+ }
189
+
148
190
  export class TwitterTweetFragment extends Fragment {
149
191
  readonly document_type_id : "twitter_tweet"
150
192
  readonly twitter_tweet_id : string
@@ -165,4 +207,23 @@ export class TwitterTweetFragment extends Fragment {
165
207
  typeof fragment.twitter_tweet_id === "string"
166
208
  )
167
209
  }
210
+ }
211
+
212
+ export class TwitterTweetFragmentAux extends TwitterTweetFragment {
213
+ readonly twitter_tweet : TwitterTweet
214
+
215
+ constructor(fragment : TwitterTweetFragmentAux) {
216
+ if (!TwitterTweetFragmentAux.is(fragment)) {
217
+ throw Error("Invalid input.")
218
+ }
219
+ super(fragment)
220
+ this.twitter_tweet = fragment.twitter_tweet
221
+ }
222
+
223
+ static is(fragment : any) : fragment is TwitterTweetFragmentAux {
224
+ return (
225
+ Fragment.is(fragment) &&
226
+ TwitterTweet.is(fragment.twitter_tweet)
227
+ )
228
+ }
168
229
  }