From 13f9aa28e30f47eefb33d53eed84bd19bec0017c 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 a00b29f4..e0768e31 100644 --- a/composables/masto/publish.ts +++ b/composables/masto/publish.ts @@ -95,7 +95,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 53546f45..9d3bb0c6 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 4faa023f..ba037756 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[]