Skip to content

Commit

Permalink
fix: Use Blob | string as a type annotation for media
Browse files Browse the repository at this point in the history
  • Loading branch information
neet committed Nov 1, 2023
1 parent 4e69eea commit cca5c30
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/mastodon/rest/v1/account-repository.ts
Expand Up @@ -42,9 +42,9 @@ export interface UpdateCredentialsParams {
/** The account bio. */
readonly note?: string | null;
/** Avatar image encoded using multipart/form-data */
readonly avatar?: unknown;
readonly avatar?: Blob | string | null;
/** Header image encoded using multipart/form-data */
readonly header?: unknown;
readonly header?: Blob | string | null;
/** Whether manual approval of follow requests is required. */
readonly locked?: boolean | null;
readonly source?: Partial<
Expand Down
4 changes: 2 additions & 2 deletions src/mastodon/rest/v1/media-attachment-repository.ts
Expand Up @@ -3,13 +3,13 @@ import { type MediaAttachment } from "../../entities/v1";

export interface CreateMediaAttachmentParams {
/** The file to be attached, using multipart form data. */
readonly file: unknown;
readonly file: Blob | string;
/** A plain-text description of the media, for accessibility purposes. */
readonly description?: string | null;
/** Two floating points (x,y), comma-delimited, ranging from -1.0 to 1.0 */
readonly focus?: string | null;
/** Custom thumbnail */
readonly thumbnail?: unknown | null;
readonly thumbnail?: Blob | string | null;
}

export type UpdateMediaAttachmentParams = Partial<CreateMediaAttachmentParams>;
Expand Down
2 changes: 1 addition & 1 deletion src/mastodon/rest/v1/status-repository.ts
Expand Up @@ -71,7 +71,7 @@ interface UpdateStatusMediaAttribute {
/** Two floating points (x,y), comma-delimited, ranging from -1.0 to 1.0 */
readonly focus?: string | null;
/** Custom thumbnail */
readonly thumbnail?: unknown | null;
readonly thumbnail?: Blob | string | null;
}

export type UpdateStatusParams = CreateStatusParams & {
Expand Down
4 changes: 2 additions & 2 deletions src/mastodon/rest/v2/media-attachment-repository.ts
Expand Up @@ -3,13 +3,13 @@ import { type MediaAttachment } from "../../entities/v1";

export interface CreateMediaAttachmentParams {
/** The file to be attached, using multipart form data. */
readonly file: unknown;
readonly file: Blob | string;
/** A plain-text description of the media, for accessibility purposes. */
readonly description?: string | null;
/** Two floating points (x,y), comma-delimited, ranging from -1.0 to 1.0 */
readonly focus?: string | null;
/** Custom thumbnail */
readonly thumbnail?: unknown | null;
readonly thumbnail?: Blob | string | null;
}

export interface CreateMediaAttachmentExtraParams {
Expand Down

0 comments on commit cca5c30

Please sign in to comment.