Skip to content

Commit e359327

Browse files
authored
Fixes for #1324 (#1326)
* fix: Export Quote and ShallowQuote entity types * fix: Mark nullable parameters optional for consistency * fix: Use Pick<T, U> for StatusEdit["quote"]
2 parents be42256 + 4817a7a commit e359327

File tree

5 files changed

+7
-6
lines changed

5 files changed

+7
-6
lines changed

src/mastodon/entities/v1/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ export type * from "./notification-request.js";
2525
export type * from "./poll.js";
2626
export type * from "./preference.js";
2727
export type * from "./preview-card.js";
28+
export type * from "./quote.js";
2829
export type * from "./reaction.js";
2930
export type * from "./relationship.js";
3031
export type * from "./relationship-severance-event.js";
@@ -33,6 +34,7 @@ export type * from "./role.js";
3334
export type * from "./rule.js";
3435
export type * from "./scheduled-status.js";
3536
export type * from "./search.js";
37+
export type * from "./shallow-quote.js";
3638
export type * from "./status.js";
3739
export type * from "./status-edit.js";
3840
export type * from "./status-source.js";

src/mastodon/entities/v1/quote.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ export interface Quote {
1919
/* The state of the quote */
2020
state: QuoteState;
2121
/* The status being quoted, if the quote has been accepted. This will be null, unless the state attribute is accepted. */
22-
quotedStatus: Status | null;
22+
quotedStatus?: Status | null;
2323
}

src/mastodon/entities/v1/shallow-quote.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ export interface ShallowQuote {
88
/* The state of the quote. */
99
state: QuoteState;
1010
/* The identifier of the status being quoted, if the quote has been accepted. This will be null, unless the state attribute is accepted. */
11-
quotedStatusId: string | null;
11+
quotedStatusId?: string | null;
1212
}

src/mastodon/entities/v1/status-edit.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ export type StatusEdit = Pick<
99
| "account"
1010
| "mediaAttachments"
1111
| "emojis"
12-
> & {
13-
quote?: Status["quote"];
14-
};
12+
| "quote"
13+
>;

src/mastodon/entities/v1/status.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ export interface Status {
8080
/** How many replies this status has received. */
8181
repliesCount: number;
8282
/** Information about the status being quoted, if any */
83-
quote: Quote | ShallowQuote | null;
83+
quote?: Quote | ShallowQuote | null;
8484

8585
/** A link to the status's HTML representation. */
8686
url?: string | null;

0 commit comments

Comments
 (0)