From 4f4f12d6e1a6ab01bca475f05a948a6f00debc8c Mon Sep 17 00:00:00 2001 From: TAKAHASHI Shuuji Date: Fri, 1 Mar 2024 03:25:41 +0900 Subject: [PATCH] feat: replace `CreateStatusParams` with its superset type`CreateScheduledStatusParams` including an extra `scheduledAt` param ref. CreateScheduledStatusParams | masto - https://neet.github.io/masto.js/types/mastodon.rest.v1.CreateScheduledStatusParams.html --- composables/masto/publish.ts | 2 +- composables/masto/statusDrafts.ts | 2 +- types/index.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/composables/masto/publish.ts b/composables/masto/publish.ts index 92d45706..5e444c3b 100644 --- a/composables/masto/publish.ts +++ b/composables/masto/publish.ts @@ -94,7 +94,7 @@ export function usePublish(options: { language: draftItem.value.params.language || preferredLanguage.value, poll, ...(isGlitchEdition.value ? { 'content-type': 'text/markdown' } : {}), - } as mastodon.rest.v1.CreateStatusParams + } as mastodon.rest.v1.CreateScheduledStatusParams if (import.meta.dev) { // eslint-disable-next-line no-console diff --git a/composables/masto/statusDrafts.ts b/composables/masto/statusDrafts.ts index c2896e77..619f66e2 100644 --- a/composables/masto/statusDrafts.ts +++ b/composables/masto/statusDrafts.ts @@ -25,7 +25,7 @@ function getDefaultVisibility(currentVisibility: mastodon.v1.StatusVisibility) { : preferredVisibility } -export function getDefaultDraftItem(options: Partial & Omit> = {}): DraftItem { +export function getDefaultDraftItem(options: Partial & Omit> = {}): DraftItem { const { attachments = [], initialText = '', diff --git a/types/index.ts b/types/index.ts index e429a59d..d70b0ea3 100644 --- a/types/index.ts +++ b/types/index.ts @@ -48,7 +48,7 @@ export type TranslateFn = ReturnType['t'] export interface DraftItem { editingStatus?: mastodon.v1.Status initialText?: string - params: MarkNonNullable>, 'status' | 'language' | 'sensitive' | 'spoilerText' | 'visibility'> & { poll: Mutable } + params: MarkNonNullable>, 'status' | 'language' | 'sensitive' | 'spoilerText' | 'visibility'> & { poll: Mutable } attachments: mastodon.v1.MediaAttachment[] lastUpdated: number mentions?: string[]