Skip to content

Commit

Permalink
isRenote -> isPureRenote
Browse files Browse the repository at this point in the history
  • Loading branch information
kakkokari-gtyih committed Aug 17, 2024
1 parent 442cf00 commit 189295e
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkNote.vue
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ if (noteViewInterruptors.length > 0) {
});
}

const isRenote = Misskey.note.isRenote(note.value);
const isRenote = Misskey.note.isPureRenote(note.value);

const rootEl = shallowRef<HTMLElement>();
const menuButton = shallowRef<HTMLElement>();
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/components/MkNoteDetailed.vue
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ if (noteViewInterruptors.length > 0) {
});
}

const isRenote = Misskey.note.isRenote(note.value);
const isRenote = Misskey.note.isPureRenote(note.value);

const rootEl = shallowRef<HTMLElement>();
const menuButton = shallowRef<HTMLElement>();
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/scripts/get-appear-note.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@
import * as Misskey from 'misskey-js';

export function getAppearNote(note: Misskey.entities.Note) {
return Misskey.note.isRenote(note) ? note.renote : note;
return Misskey.note.isPureRenote(note) ? note.renote : note;
}
24 changes: 12 additions & 12 deletions packages/misskey-js/etc/misskey-js.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -1172,7 +1172,7 @@ declare namespace entities {
export {
ID,
DateString,
Renote,
PureRenote,
PageEvent,
ModerationLog,
ServerStats,
Expand Down Expand Up @@ -2279,7 +2279,7 @@ type ISigninHistoryRequest = operations['i___signin-history']['requestBody']['co
type ISigninHistoryResponse = operations['i___signin-history']['responses']['200']['content']['application/json'];

// @public (undocumented)
function isRenote(note: Note): note is Renote;
function isPureRenote(note: Note): note is PureRenote;

// @public (undocumented)
type IUnpinRequest = operations['i___unpin']['requestBody']['content']['application/json'];
Expand Down Expand Up @@ -2516,7 +2516,7 @@ type Note = components['schemas']['Note'];

declare namespace note {
export {
isRenote
isPureRenote
}
}
export { note }
Expand Down Expand Up @@ -2761,6 +2761,15 @@ type PinnedUsersResponse = operations['pinned-users']['responses']['200']['conte
// @public (undocumented)
type PromoReadRequest = operations['promo___read']['requestBody']['content']['application/json'];

// Warning: (ae-forgotten-export) The symbol "AllNullRecord" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "NonNullableRecord" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
type PureRenote = Omit<Note, 'renote' | 'renoteId' | 'reply' | 'replyId' | 'text' | 'cw' | 'files' | 'fileIds' | 'poll'> & AllNullRecord<Pick<Note, 'reply' | 'replyId' | 'text' | 'cw' | 'poll'>> & {
files: [];
fileIds: [];
} & NonNullableRecord<Pick<Note, 'renote' | 'renoteId'>>;

// @public (undocumented)
type QueueCount = components['schemas']['QueueCount'];

Expand All @@ -2783,15 +2792,6 @@ type QueueStats = {
// @public (undocumented)
type QueueStatsLog = QueueStats[];

// Warning: (ae-forgotten-export) The symbol "AllNullRecord" needs to be exported by the entry point index.d.ts
// Warning: (ae-forgotten-export) The symbol "NonNullableRecord" needs to be exported by the entry point index.d.ts
//
// @public (undocumented)
type Renote = Omit<Note, 'renote' | 'renoteId' | 'reply' | 'replyId' | 'text' | 'cw' | 'files' | 'fileIds' | 'poll'> & AllNullRecord<Pick<Note, 'reply' | 'replyId' | 'text' | 'cw' | 'poll'>> & {
files: [];
fileIds: [];
} & NonNullableRecord<Pick<Note, 'renote' | 'renoteId'>>;

// @public (undocumented)
type RenoteMuteCreateRequest = operations['renote-mute___create']['requestBody']['content']['application/json'];

Expand Down
2 changes: 1 addition & 1 deletion packages/misskey-js/src/entities.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ type AllNullRecord<T> = {
[P in keyof T]: null;
};

export type Renote =
export type PureRenote =
Omit<Note, 'renote' | 'renoteId' | 'reply' | 'replyId' | 'text' | 'cw' | 'files' | 'fileIds' | 'poll'>
& AllNullRecord<Pick<Note, 'reply' | 'replyId' | 'text' | 'cw' | 'poll'>>
& { files: []; fileIds: []; }
Expand Down
4 changes: 2 additions & 2 deletions packages/misskey-js/src/note.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Note, Renote } from './entities.js';
import type { Note, PureRenote } from './entities.js';

export function isRenote(note: Note): note is Renote {
export function isPureRenote(note: Note): note is PureRenote {
return (
note.renote != null &&
note.reply == null &&
Expand Down

0 comments on commit 189295e

Please sign in to comment.