feat: replace CreateStatusParams with its superset typeCreateScheduledStatusParams including an extra scheduledAt param

ref. CreateScheduledStatusParams | masto - https://neet.github.io/masto.js/types/mastodon.rest.v1.CreateScheduledStatusParams.html
This commit is contained in:
TAKAHASHI Shuuji 2024-03-01 03:25:41 +09:00
parent e58a6e8b62
commit 4f4f12d6e1
No known key found for this signature in database
GPG key ID: F15C887632129F5E
3 changed files with 3 additions and 3 deletions

View file

@ -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

View file

@ -25,7 +25,7 @@ function getDefaultVisibility(currentVisibility: mastodon.v1.StatusVisibility) {
: preferredVisibility
}
export function getDefaultDraftItem(options: Partial<Mutable<mastodon.rest.v1.CreateStatusParams> & Omit<DraftItem, 'params'>> = {}): DraftItem {
export function getDefaultDraftItem(options: Partial<Mutable<mastodon.rest.v1.CreateScheduledStatusParams> & Omit<DraftItem, 'params'>> = {}): DraftItem {
const {
attachments = [],
initialText = '',

View file

@ -48,7 +48,7 @@ export type TranslateFn = ReturnType<typeof useI18n>['t']
export interface DraftItem {
editingStatus?: mastodon.v1.Status
initialText?: string
params: MarkNonNullable<Mutable<Omit<mastodon.rest.v1.CreateStatusParams, 'poll'>>, 'status' | 'language' | 'sensitive' | 'spoilerText' | 'visibility'> & { poll: Mutable<mastodon.rest.v1.CreateStatusParams['poll']> }
params: MarkNonNullable<Mutable<Omit<mastodon.rest.v1.CreateScheduledStatusParams, 'poll'>>, 'status' | 'language' | 'sensitive' | 'spoilerText' | 'visibility'> & { poll: Mutable<mastodon.rest.v1.CreateScheduledStatusParams['poll']> }
attachments: mastodon.v1.MediaAttachment[]
lastUpdated: number
mentions?: string[]