Refactor: firefishjs imports

This commit is contained in:
Kainoa Kanter 2023-09-24 04:27:16 +00:00
parent 17d94c5ff7
commit 9ea046c011
87 changed files with 312 additions and 2990 deletions

View File

@ -24,7 +24,7 @@ export const packedUserLiteSchema = {
type: "string", type: "string",
nullable: true, nullable: true,
optional: false, optional: false,
example: "misskey.example.com", example: "firefish.example.com",
description: "The local host is represented with `null`.", description: "The local host is represented with `null`.",
}, },
avatarUrl: { avatarUrl: {

View File

@ -15,7 +15,7 @@ import {
failedApiCall, failedApiCall,
uploadFile, uploadFile,
} from "../utils.js"; } from "../utils.js";
import type * as misskey from "misskey-js"; import type * as firefish from "firefish-js";
import type { INestApplicationContext } from "@nestjs/common"; import type { INestApplicationContext } from "@nestjs/common";
describe("ユーザー", () => { describe("ユーザー", () => {
@ -34,16 +34,16 @@ describe("ユーザー", () => {
}; };
// BUG misskey-jsとjson-schemaと実際に返ってくるデータが全部違う // BUG misskey-jsとjson-schemaと実際に返ってくるデータが全部違う
type UserLite = misskey.entities.UserLite & { type UserLite = firefish.entities.UserLite & {
badgeRoles: any[]; badgeRoles: any[];
}; };
type UserDetailedNotMe = UserLite & type UserDetailedNotMe = UserLite &
misskey.entities.UserDetailed & { firefish.entities.UserDetailed & {
roles: any[]; roles: any[];
}; };
type MeDetailed = UserDetailedNotMe & misskey.entities.MeDetailed; type MeDetailed = UserDetailedNotMe & firefish.entities.MeDetailed;
type User = MeDetailed & { token: string }; type User = MeDetailed & { token: string };
@ -183,12 +183,12 @@ describe("ユーザー", () => {
let root: User; let root: User;
let alice: User; let alice: User;
let aliceNote: misskey.entities.Note; let aliceNote: firefish.entities.Note;
let alicePage: misskey.entities.Page; let alicePage: firefish.entities.Page;
let aliceList: misskey.entities.UserList; let aliceList: firefish.entities.UserList;
let bob: User; let bob: User;
let bobNote: misskey.entities.Note; let bobNote: firefish.entities.Note;
let carol: User; let carol: User;
let dave: User; let dave: User;

View File

@ -6,7 +6,7 @@ import * as childProcess from "child_process";
import * as http from "node:http"; import * as http from "node:http";
import { SIGKILL } from "constants"; import { SIGKILL } from "constants";
import WebSocket from "ws"; import WebSocket from "ws";
import * as misskey from "firefish-js"; import * as firefish from "firefish-js";
import fetch from "node-fetch"; import fetch from "node-fetch";
import FormData from "form-data"; import FormData from "form-data";
import { DataSource } from "typeorm"; import { DataSource } from "typeorm";
@ -113,8 +113,8 @@ export const signup = async (params?: any): Promise<any> => {
export const post = async ( export const post = async (
user: any, user: any,
params?: misskey.Endpoints["notes/create"]["req"], params?: firefish.Endpoints["notes/create"]["req"],
): Promise<misskey.entities.Note> => { ): Promise<firefish.entities.Note> => {
const q = Object.assign( const q = Object.assign(
{ {
text: "test", text: "test",

View File

@ -1,5 +1,5 @@
import { defineAsyncComponent, reactive } from "vue"; import { defineAsyncComponent, reactive } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import { i18n } from "./i18n"; import { i18n } from "./i18n";
import { del, get, set } from "@/scripts/idb-proxy"; import { del, get, set } from "@/scripts/idb-proxy";
import { apiUrl } from "@/config"; import { apiUrl } from "@/config";
@ -8,7 +8,7 @@ import { reloadChannel, unisonReload } from "@/scripts/unison-reload";
// TODO: 他のタブと永続化されたstateを同期 // TODO: 他のタブと永続化されたstateを同期
type Account = misskey.entities.MeDetailed; type Account = firefish.entities.MeDetailed;
const accountData = localStorage.getItem("account"); const accountData = localStorage.getItem("account");
@ -150,8 +150,8 @@ export async function openAccountMenu(
opts: { opts: {
includeCurrentAccount?: boolean; includeCurrentAccount?: boolean;
withExtraOperation: boolean; withExtraOperation: boolean;
active?: misskey.entities.UserDetailed["id"]; active?: firefish.entities.UserDetailed["id"];
onChoose?: (account: misskey.entities.UserDetailed) => void; onChoose?: (account: firefish.entities.UserDetailed) => void;
}, },
ev: MouseEvent, ev: MouseEvent,
) { ) {
@ -183,7 +183,7 @@ export async function openAccountMenu(
); );
} }
async function switchAccount(account: misskey.entities.UserDetailed) { async function switchAccount(account: firefish.entities.UserDetailed) {
const storedAccounts = await getAccounts(); const storedAccounts = await getAccounts();
const token = storedAccounts.find((x) => x.id === account.id).token; const token = storedAccounts.find((x) => x.id === account.id).token;
switchAccountWithToken(token); switchAccountWithToken(token);
@ -200,7 +200,7 @@ export async function openAccountMenu(
userIds: storedAccounts.map((x) => x.id), userIds: storedAccounts.map((x) => x.id),
}); });
function createItem(account: misskey.entities.UserDetailed) { function createItem(account: firefish.entities.UserDetailed) {
return { return {
type: "user", type: "user",
user: account, user: account,

View File

@ -41,7 +41,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from "vue"; import { ref } from "vue";
import type * as Misskey from "firefish-js"; import type * as firefish from "firefish-js";
import XWindow from "@/components/MkWindow.vue"; import XWindow from "@/components/MkWindow.vue";
import MkTextarea from "@/components/form/textarea.vue"; import MkTextarea from "@/components/form/textarea.vue";
import MkButton from "@/components/MkButton.vue"; import MkButton from "@/components/MkButton.vue";
@ -49,7 +49,7 @@ import * as os from "@/os";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
const props = defineProps<{ const props = defineProps<{
user: Misskey.entities.User; user: firefish.entities.User;
initialComment?: string; initialComment?: string;
}>(); }>();

View File

@ -37,7 +37,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, ref } from "vue"; import { onMounted, ref } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import Cropper from "cropperjs"; import Cropper from "cropperjs";
import tinycolor from "tinycolor2"; import tinycolor from "tinycolor2";
import XModalWindow from "@/components/MkModalWindow.vue"; import XModalWindow from "@/components/MkModalWindow.vue";
@ -49,13 +49,13 @@ import { query } from "@/scripts/url";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
const emit = defineEmits<{ const emit = defineEmits<{
(ev: "ok", cropped: misskey.entities.DriveFile): void; (ev: "ok", cropped: firefish.entities.DriveFile): void;
(ev: "cancel"): void; (ev: "cancel"): void;
(ev: "closed"): void; (ev: "closed"): void;
}>(); }>();
const props = defineProps<{ const props = defineProps<{
file: misskey.entities.DriveFile; file: firefish.entities.DriveFile;
aspectRatio: number; aspectRatio: number;
}>(); }>();
@ -68,7 +68,7 @@ let cropper: Cropper | null = null,
loading = ref(true); loading = ref(true);
const ok = async () => { const ok = async () => {
const promise = new Promise<misskey.entities.DriveFile>(async (res) => { const promise = new Promise<firefish.entities.DriveFile>(async (res) => {
const croppedCanvas = await cropper?.getCropperSelection()?.$toCanvas(); const croppedCanvas = await cropper?.getCropperSelection()?.$toCanvas();
croppedCanvas.toBlob((blob) => { croppedCanvas.toBlob((blob) => {
const formData = new FormData(); const formData = new FormData();

View File

@ -15,13 +15,13 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, ref } from "vue"; import { computed, ref } from "vue";
import { length } from "stringz"; import { length } from "stringz";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import { concat } from "@/scripts/array"; import { concat } from "@/scripts/array";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
const props = defineProps<{ const props = defineProps<{
modelValue: boolean; modelValue: boolean;
note: misskey.entities.Note; note: firefish.entities.Note;
}>(); }>();
const emit = defineEmits<{ const emit = defineEmits<{

View File

@ -39,7 +39,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, defineAsyncComponent, ref } from "vue"; import { computed, defineAsyncComponent, ref } from "vue";
import type * as Misskey from "firefish-js"; import type * as firefish from "firefish-js";
import copyToClipboard from "@/scripts/copy-to-clipboard"; import copyToClipboard from "@/scripts/copy-to-clipboard";
import MkDriveFileThumbnail from "@/components/MkDriveFileThumbnail.vue"; import MkDriveFileThumbnail from "@/components/MkDriveFileThumbnail.vue";
import bytes from "@/filters/bytes"; import bytes from "@/filters/bytes";
@ -49,7 +49,7 @@ import { $i } from "@/account";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
file: Misskey.entities.DriveFile; file: firefish.entities.DriveFile;
isSelected?: boolean; isSelected?: boolean;
selectMode?: boolean; selectMode?: boolean;
}>(), }>(),
@ -60,7 +60,7 @@ const props = withDefaults(
); );
const emit = defineEmits<{ const emit = defineEmits<{
(ev: "chosen", r: Misskey.entities.DriveFile): void; (ev: "chosen", r: firefish.entities.DriveFile): void;
(ev: "dragstart"): void; (ev: "dragstart"): void;
(ev: "dragend"): void; (ev: "dragend"): void;
}>(); }>();

View File

@ -38,14 +38,14 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, defineAsyncComponent, ref } from "vue"; import { computed, defineAsyncComponent, ref } from "vue";
import type * as Misskey from "firefish-js"; import type * as firefish from "firefish-js";
import * as os from "@/os"; import * as os from "@/os";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import { defaultStore } from "@/store"; import { defaultStore } from "@/store";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
folder: Misskey.entities.DriveFolder; folder: firefish.entities.DriveFolder;
isSelected?: boolean; isSelected?: boolean;
selectMode?: boolean; selectMode?: boolean;
}>(), }>(),
@ -56,11 +56,11 @@ const props = withDefaults(
); );
const emit = defineEmits<{ const emit = defineEmits<{
(ev: "chosen", v: Misskey.entities.DriveFolder): void; (ev: "chosen", v: firefish.entities.DriveFolder): void;
(ev: "move", v: Misskey.entities.DriveFolder): void; (ev: "move", v: firefish.entities.DriveFolder): void;
(ev: "upload", file: File, folder: Misskey.entities.DriveFolder); (ev: "upload", file: File, folder: firefish.entities.DriveFolder);
(ev: "removeFile", v: Misskey.entities.DriveFile["id"]): void; (ev: "removeFile", v: firefish.entities.DriveFile["id"]): void;
(ev: "removeFolder", v: Misskey.entities.DriveFolder["id"]): void; (ev: "removeFolder", v: firefish.entities.DriveFolder["id"]): void;
(ev: "dragstart"): void; (ev: "dragstart"): void;
(ev: "dragend"): void; (ev: "dragend"): void;
}>(); }>();

View File

@ -15,24 +15,24 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
import type * as Misskey from "firefish-js"; import type * as firefish from "firefish-js";
import * as os from "@/os"; import * as os from "@/os";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
const props = defineProps<{ const props = defineProps<{
folder?: Misskey.entities.DriveFolder; folder?: firefish.entities.DriveFolder;
parentFolder: Misskey.entities.DriveFolder | null; parentFolder: firefish.entities.DriveFolder | null;
}>(); }>();
const emit = defineEmits<{ const emit = defineEmits<{
(ev: "move", v?: Misskey.entities.DriveFolder): void; (ev: "move", v?: firefish.entities.DriveFolder): void;
( (
ev: "upload", ev: "upload",
file: File, file: File,
folder?: Misskey.entities.DriveFolder | null, folder?: firefish.entities.DriveFolder | null,
): void; ): void;
(ev: "removeFile", v: Misskey.entities.DriveFile["id"]): void; (ev: "removeFile", v: firefish.entities.DriveFile["id"]): void;
(ev: "removeFolder", v: Misskey.entities.DriveFolder["id"]): void; (ev: "removeFolder", v: firefish.entities.DriveFolder["id"]): void;
}>(); }>();
const hover = ref(false); const hover = ref(false);

View File

@ -139,7 +139,7 @@ import {
ref, ref,
watch, watch,
} from "vue"; } from "vue";
import type * as Misskey from "firefish-js"; import type * as firefish from "firefish-js";
import MkButton from "./MkButton.vue"; import MkButton from "./MkButton.vue";
import XNavFolder from "@/components/MkDrive.navFolder.vue"; import XNavFolder from "@/components/MkDrive.navFolder.vue";
import XFolder from "@/components/MkDrive.folder.vue"; import XFolder from "@/components/MkDrive.folder.vue";
@ -152,7 +152,7 @@ import { uploadFile, uploads } from "@/scripts/upload";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
initialFolder?: Misskey.entities.DriveFolder; initialFolder?: firefish.entities.DriveFolder;
type?: string; type?: string;
multiple?: boolean; multiple?: boolean;
select?: "file" | "folder" | null; select?: "file" | "folder" | null;
@ -166,28 +166,28 @@ const props = withDefaults(
const emit = defineEmits<{ const emit = defineEmits<{
( (
ev: "selected", ev: "selected",
v: Misskey.entities.DriveFile | Misskey.entities.DriveFolder, v: firefish.entities.DriveFile | firefish.entities.DriveFolder,
): void; ): void;
( (
ev: "change-selection", ev: "change-selection",
v: Misskey.entities.DriveFile[] | Misskey.entities.DriveFolder[], v: firefish.entities.DriveFile[] | firefish.entities.DriveFolder[],
): void; ): void;
(ev: "move-root"): void; (ev: "move-root"): void;
(ev: "cd", v: Misskey.entities.DriveFolder | null): void; (ev: "cd", v: firefish.entities.DriveFolder | null): void;
(ev: "open-folder", v: Misskey.entities.DriveFolder): void; (ev: "open-folder", v: firefish.entities.DriveFolder): void;
}>(); }>();
const loadMoreFiles = ref<InstanceType<typeof MkButton>>(); const loadMoreFiles = ref<InstanceType<typeof MkButton>>();
const fileInput = ref<HTMLInputElement>(); const fileInput = ref<HTMLInputElement>();
const folder = ref<Misskey.entities.DriveFolder | null>(null); const folder = ref<firefish.entities.DriveFolder | null>(null);
const files = ref<Misskey.entities.DriveFile[]>([]); const files = ref<firefish.entities.DriveFile[]>([]);
const folders = ref<Misskey.entities.DriveFolder[]>([]); const folders = ref<firefish.entities.DriveFolder[]>([]);
const moreFiles = ref(false); const moreFiles = ref(false);
const moreFolders = ref(false); const moreFolders = ref(false);
const hierarchyFolders = ref<Misskey.entities.DriveFolder[]>([]); const hierarchyFolders = ref<firefish.entities.DriveFolder[]>([]);
const selectedFiles = ref<Misskey.entities.DriveFile[]>([]); const selectedFiles = ref<firefish.entities.DriveFile[]>([]);
const selectedFolders = ref<Misskey.entities.DriveFolder[]>([]); const selectedFolders = ref<firefish.entities.DriveFolder[]>([]);
const uploadings = uploads; const uploadings = uploads;
const connection = stream.useChannel("drive"); const connection = stream.useChannel("drive");
const keepOriginal = ref<boolean>(defaultStore.state.keepOriginalUploading); // $ref使 const keepOriginal = ref<boolean>(defaultStore.state.keepOriginalUploading); // $ref使
@ -211,11 +211,11 @@ const ilFilesObserver = new IntersectionObserver(
watch(folder, () => emit("cd", folder.value)); watch(folder, () => emit("cd", folder.value));
function onStreamDriveFileCreated(file: Misskey.entities.DriveFile) { function onStreamDriveFileCreated(file: firefish.entities.DriveFile) {
addFile(file, true); addFile(file, true);
} }
function onStreamDriveFileUpdated(file: Misskey.entities.DriveFile) { function onStreamDriveFileUpdated(file: firefish.entities.DriveFile) {
const current = folder.value ? folder.value.id : null; const current = folder.value ? folder.value.id : null;
if (current !== file.folderId) { if (current !== file.folderId) {
removeFile(file); removeFile(file);
@ -229,13 +229,13 @@ function onStreamDriveFileDeleted(fileId: string) {
} }
function onStreamDriveFolderCreated( function onStreamDriveFolderCreated(
createdFolder: Misskey.entities.DriveFolder, createdFolder: firefish.entities.DriveFolder,
) { ) {
addFolder(createdFolder, true); addFolder(createdFolder, true);
} }
function onStreamDriveFolderUpdated( function onStreamDriveFolderUpdated(
updatedFolder: Misskey.entities.DriveFolder, updatedFolder: firefish.entities.DriveFolder,
) { ) {
const current = folder.value ? folder.value.id : null; const current = folder.value ? folder.value.id : null;
if (current !== updatedFolder.parentId) { if (current !== updatedFolder.parentId) {
@ -380,7 +380,7 @@ function createFolder() {
}); });
} }
function renameFolder(folderToRename: Misskey.entities.DriveFolder) { function renameFolder(folderToRename: firefish.entities.DriveFolder) {
os.inputText({ os.inputText({
title: i18n.ts.renameFolder, title: i18n.ts.renameFolder,
placeholder: i18n.ts.inputNewFolderName, placeholder: i18n.ts.inputNewFolderName,
@ -397,7 +397,7 @@ function renameFolder(folderToRename: Misskey.entities.DriveFolder) {
}); });
} }
function deleteFolder(folderToDelete: Misskey.entities.DriveFolder) { function deleteFolder(folderToDelete: firefish.entities.DriveFolder) {
os.api("drive/folders/delete", { os.api("drive/folders/delete", {
folderId: folderToDelete.id, folderId: folderToDelete.id,
}) })
@ -432,7 +432,7 @@ function onChangeFileInput() {
function upload( function upload(
file: File, file: File,
folderToUpload?: Misskey.entities.DriveFolder | null, folderToUpload?: firefish.entities.DriveFolder | null,
) { ) {
uploadFile( uploadFile(
file, file,
@ -446,7 +446,7 @@ function upload(
}); });
} }
function chooseFile(file: Misskey.entities.DriveFile) { function chooseFile(file: firefish.entities.DriveFile) {
const isAlreadySelected = selectedFiles.value.some((f) => f.id === file.id); const isAlreadySelected = selectedFiles.value.some((f) => f.id === file.id);
if (props.multiple) { if (props.multiple) {
if (isAlreadySelected) { if (isAlreadySelected) {
@ -467,7 +467,7 @@ function chooseFile(file: Misskey.entities.DriveFile) {
} }
} }
function chooseFolder(folderToChoose: Misskey.entities.DriveFolder) { function chooseFolder(folderToChoose: firefish.entities.DriveFolder) {
const isAlreadySelected = selectedFolders.value.some( const isAlreadySelected = selectedFolders.value.some(
(f) => f.id === folderToChoose.id, (f) => f.id === folderToChoose.id,
); );
@ -490,7 +490,7 @@ function chooseFolder(folderToChoose: Misskey.entities.DriveFolder) {
} }
} }
function move(target?: Misskey.entities.DriveFolder) { function move(target?: firefish.entities.DriveFolder) {
if (!target) { if (!target) {
goRoot(); goRoot();
return; return;
@ -518,7 +518,10 @@ function move(target?: Misskey.entities.DriveFolder) {
}); });
} }
function addFolder(folderToAdd: Misskey.entities.DriveFolder, unshift = false) { function addFolder(
folderToAdd: firefish.entities.DriveFolder,
unshift = false,
) {
const current = folder.value ? folder.value.id : null; const current = folder.value ? folder.value.id : null;
if (current !== folderToAdd.parentId) return; if (current !== folderToAdd.parentId) return;
@ -535,7 +538,7 @@ function addFolder(folderToAdd: Misskey.entities.DriveFolder, unshift = false) {
} }
} }
function addFile(fileToAdd: Misskey.entities.DriveFile, unshift = false) { function addFile(fileToAdd: firefish.entities.DriveFile, unshift = false) {
const current = folder.value ? folder.value.id : null; const current = folder.value ? folder.value.id : null;
if (current !== fileToAdd.folderId) return; if (current !== fileToAdd.folderId) return;
@ -552,30 +555,30 @@ function addFile(fileToAdd: Misskey.entities.DriveFile, unshift = false) {
} }
} }
function removeFolder(folderToRemove: Misskey.entities.DriveFolder | string) { function removeFolder(folderToRemove: firefish.entities.DriveFolder | string) {
const folderIdToRemove = const folderIdToRemove =
typeof folderToRemove === "object" ? folderToRemove.id : folderToRemove; typeof folderToRemove === "object" ? folderToRemove.id : folderToRemove;
folders.value = folders.value.filter((f) => f.id !== folderIdToRemove); folders.value = folders.value.filter((f) => f.id !== folderIdToRemove);
} }
function removeFile(file: Misskey.entities.DriveFile | string) { function removeFile(file: firefish.entities.DriveFile | string) {
const fileId = typeof file === "object" ? file.id : file; const fileId = typeof file === "object" ? file.id : file;
files.value = files.value.filter((f) => f.id !== fileId); files.value = files.value.filter((f) => f.id !== fileId);
} }
function appendFile(file: Misskey.entities.DriveFile) { function appendFile(file: firefish.entities.DriveFile) {
addFile(file); addFile(file);
} }
function appendFolder(folderToAppend: Misskey.entities.DriveFolder) { function appendFolder(folderToAppend: firefish.entities.DriveFolder) {
addFolder(folderToAppend); addFolder(folderToAppend);
} }
/* /*
function prependFile(file: Misskey.entities.DriveFile) { function prependFile(file: firefish.entities.DriveFile) {
addFile(file, true); addFile(file, true);
} }
function prependFolder(folderToPrepend: Misskey.entities.DriveFolder) { function prependFolder(folderToPrepend: firefish.entities.DriveFolder) {
addFolder(folderToPrepend, true); addFolder(folderToPrepend, true);
} }
*/ */
@ -706,7 +709,7 @@ function getMenu() {
icon: "ph-trash ph-bold ph-lg", icon: "ph-trash ph-bold ph-lg",
action: () => { action: () => {
deleteFolder( deleteFolder(
folder.value as Misskey.entities.DriveFolder, folder.value as firefish.entities.DriveFolder,
); );
}, },
} }

View File

@ -41,11 +41,11 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed } from "vue"; import { computed } from "vue";
import type * as Misskey from "firefish-js"; import type * as firefish from "firefish-js";
import ImgWithBlurhash from "@/components/MkImgWithBlurhash.vue"; import ImgWithBlurhash from "@/components/MkImgWithBlurhash.vue";
const props = defineProps<{ const props = defineProps<{
file: Misskey.entities.DriveFile; file: firefish.entities.DriveFile;
fit: string; fit: string;
}>(); }>();

View File

@ -37,7 +37,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
import type * as Misskey from "firefish-js"; import type * as firefish from "firefish-js";
import XDrive from "@/components/MkDrive.vue"; import XDrive from "@/components/MkDrive.vue";
import XModalWindow from "@/components/MkModalWindow.vue"; import XModalWindow from "@/components/MkModalWindow.vue";
import number from "@/filters/number"; import number from "@/filters/number";
@ -54,13 +54,13 @@ withDefaults(
); );
const emit = defineEmits<{ const emit = defineEmits<{
(ev: "done", r?: Misskey.entities.DriveFile[]): void; (ev: "done", r?: firefish.entities.DriveFile[]): void;
(ev: "closed"): void; (ev: "closed"): void;
}>(); }>();
const dialog = ref<InstanceType<typeof XModalWindow>>(); const dialog = ref<InstanceType<typeof XModalWindow>>();
const selected = ref<Misskey.entities.DriveFile[]>([]); const selected = ref<firefish.entities.DriveFile[]>([]);
function ok() { function ok() {
emit("done", selected.value); emit("done", selected.value);
@ -72,7 +72,7 @@ function cancel() {
dialog.value?.close(); dialog.value?.close();
} }
function onChangeSelection(files: Misskey.entities.DriveFile[]) { function onChangeSelection(files: firefish.entities.DriveFile[]) {
selected.value = files; selected.value = files;
} }
</script> </script>

View File

@ -15,13 +15,13 @@
<script lang="ts" setup> <script lang="ts" setup>
import {} from "vue"; import {} from "vue";
import type * as Misskey from "firefish-js"; import type * as firefish from "firefish-js";
import XDrive from "@/components/MkDrive.vue"; import XDrive from "@/components/MkDrive.vue";
import XWindow from "@/components/MkWindow.vue"; import XWindow from "@/components/MkWindow.vue";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
defineProps<{ defineProps<{
initialFolder?: Misskey.entities.DriveFolder; initialFolder?: firefish.entities.DriveFolder;
}>(); }>();
const emit = defineEmits<{ const emit = defineEmits<{

View File

@ -165,7 +165,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, onMounted, ref, watch } from "vue"; import { computed, onMounted, ref, watch } from "vue";
import type * as Misskey from "firefish-js"; import type * as firefish from "firefish-js";
import { FocusTrap } from "focus-trap-vue"; import { FocusTrap } from "focus-trap-vue";
import XSection from "@/components/MkEmojiPicker.section.vue"; import XSection from "@/components/MkEmojiPicker.section.vue";
import type { UnicodeEmojiDef } from "@/scripts/emojilist"; import type { UnicodeEmojiDef } from "@/scripts/emojilist";
@ -241,7 +241,7 @@ const height = computed(() =>
const customEmojiCategories = emojiCategories; const customEmojiCategories = emojiCategories;
const customEmojis = instance.emojis; const customEmojis = instance.emojis;
const q = ref<string | null>(null); const q = ref<string | null>(null);
const searchResultCustom = ref<Misskey.entities.CustomEmoji[]>([]); const searchResultCustom = ref<firefish.entities.CustomEmoji[]>([]);
const searchResultUnicode = ref<UnicodeEmojiDef[]>([]); const searchResultUnicode = ref<UnicodeEmojiDef[]>([]);
const tab = ref<"index" | "custom" | "unicode" | "tags">("index"); const tab = ref<"index" | "custom" | "unicode" | "tags">("index");
@ -259,7 +259,7 @@ watch(q, () => {
const searchCustom = () => { const searchCustom = () => {
const max = 16; const max = 16;
const emojis = customEmojis; const emojis = customEmojis;
const matches = new Set<Misskey.entities.CustomEmoji>(); const matches = new Set<firefish.entities.CustomEmoji>();
const exactMatch = emojis.find((emoji) => emoji.name === newQ); const exactMatch = emojis.find((emoji) => emoji.name === newQ);
if (exactMatch) matches.add(exactMatch); if (exactMatch) matches.add(exactMatch);
@ -420,7 +420,7 @@ function reset() {
} }
function getKey( function getKey(
emoji: string | Misskey.entities.CustomEmoji | UnicodeEmojiDef, emoji: string | firefish.entities.CustomEmoji | UnicodeEmojiDef,
): string { ): string {
return typeof emoji === "string" ? emoji : emoji.emoji || `:${emoji.name}:`; return typeof emoji === "string" ? emoji : emoji.emoji || `:${emoji.name}:`;
} }

View File

@ -8,10 +8,10 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
import type * as Misskey from "firefish-js"; import type * as firefish from "firefish-js";
import * as os from "@/os"; import * as os from "@/os";
const meta = ref<Misskey.entities.DetailedInstanceMetadata>(); const meta = ref<firefish.entities.DetailedInstanceMetadata>();
os.api("meta", { detail: true }).then((gotMeta) => { os.api("meta", { detail: true }).then((gotMeta) => {
meta.value = gotMeta; meta.value = gotMeta;

View File

@ -62,7 +62,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, onBeforeUnmount, onMounted, ref } from "vue"; import { computed, onBeforeUnmount, onMounted, ref } from "vue";
import type * as Misskey from "firefish-js"; import type * as firefish from "firefish-js";
import * as os from "@/os"; import * as os from "@/os";
import { stream } from "@/stream"; import { stream } from "@/stream";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
@ -76,7 +76,7 @@ const router = useRouter();
const emit = defineEmits(["refresh"]); const emit = defineEmits(["refresh"]);
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
user: Misskey.entities.UserDetailed; user: firefish.entities.UserDetailed;
full?: boolean; full?: boolean;
large?: boolean; large?: boolean;
hideMenu?: boolean; hideMenu?: boolean;
@ -104,7 +104,7 @@ if (props.user.isFollowing == null) {
}).then(onFollowChange); }).then(onFollowChange);
} }
function onFollowChange(user: Misskey.entities.UserDetailed) { function onFollowChange(user: firefish.entities.UserDetailed) {
if (user.id === props.user.id) { if (user.id === props.user.id) {
isFollowing.value = user.isFollowing; isFollowing.value = user.isFollowing;
hasPendingFollowRequestFromYou.value = hasPendingFollowRequestFromYou.value =

View File

@ -28,14 +28,14 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import bytes from "@/filters/bytes"; import bytes from "@/filters/bytes";
import number from "@/filters/number"; import number from "@/filters/number";
import MkModal from "@/components/MkModal.vue"; import MkModal from "@/components/MkModal.vue";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
image: misskey.entities.DriveFile; image: firefish.entities.DriveFile;
}>(), }>(),
{}, {},
); );

View File

@ -92,7 +92,7 @@
import { computed, ref, watch } from "vue"; import { computed, ref, watch } from "vue";
import VuePlyr from "vue-plyr"; import VuePlyr from "vue-plyr";
import "vue-plyr/dist/vue-plyr.css"; import "vue-plyr/dist/vue-plyr.css";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import { getStaticImageUrl } from "@/scripts/get-static-image-url"; import { getStaticImageUrl } from "@/scripts/get-static-image-url";
import ImgWithBlurhash from "@/components/MkImgWithBlurhash.vue"; import ImgWithBlurhash from "@/components/MkImgWithBlurhash.vue";
import { defaultStore } from "@/store"; import { defaultStore } from "@/store";
@ -100,7 +100,7 @@ import { i18n } from "@/i18n";
import * as os from "@/os"; import * as os from "@/os";
const props = defineProps<{ const props = defineProps<{
media: misskey.entities.DriveFile; media: firefish.entities.DriveFile;
raw?: boolean; raw?: boolean;
}>(); }>();

View File

@ -58,14 +58,14 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, ref } from "vue"; import { onMounted, ref } from "vue";
import VuePlyr from "vue-plyr"; import VuePlyr from "vue-plyr";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import { ColdDeviceStorage } from "@/store"; import { ColdDeviceStorage } from "@/store";
import "vue-plyr/dist/vue-plyr.css"; import "vue-plyr/dist/vue-plyr.css";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
media: misskey.entities.DriveFile; media: firefish.entities.DriveFile;
}>(), }>(),
{}, {},
); );

View File

@ -41,7 +41,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, ref } from "vue"; import { onMounted, ref } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import PhotoSwipeLightbox from "photoswipe/lightbox"; import PhotoSwipeLightbox from "photoswipe/lightbox";
import PhotoSwipe from "photoswipe"; import PhotoSwipe from "photoswipe";
import "photoswipe/style.css"; import "photoswipe/style.css";
@ -56,7 +56,7 @@ import {
} from "@/const"; } from "@/const";
const props = defineProps<{ const props = defineProps<{
mediaList: misskey.entities.DriveFile[]; mediaList: firefish.entities.DriveFile[];
raw?: boolean; raw?: boolean;
inDm?: boolean; inDm?: boolean;
}>(); }>();
@ -184,7 +184,7 @@ onMounted(() => {
} }
}); });
const previewable = (file: misskey.entities.DriveFile): boolean => { const previewable = (file: firefish.entities.DriveFile): boolean => {
if (file.type === "image/svg+xml") return true; // svgwebpublic/thumbnailpngtrue if (file.type === "image/svg+xml") return true; // svgwebpublic/thumbnailpngtrue
// FILE_TYPE_BROWSERSAFE // FILE_TYPE_BROWSERSAFE
if (isModule(file)) return true; if (isModule(file)) return true;
@ -194,7 +194,7 @@ const previewable = (file: misskey.entities.DriveFile): boolean => {
); );
}; };
const isModule = (file: misskey.entities.DriveFile): boolean => { const isModule = (file: firefish.entities.DriveFile): boolean => {
return ( return (
FILE_TYPE_TRACKER_MODULES.some((type) => { FILE_TYPE_TRACKER_MODULES.some((type) => {
return file.type === type; return file.type === type;

View File

@ -275,7 +275,7 @@
import { computed, inject, onMounted, ref } from "vue"; import { computed, inject, onMounted, ref } from "vue";
import * as mfm from "mfm-js"; import * as mfm from "mfm-js";
import type { Ref } from "vue"; import type { Ref } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import { detect as detectLanguage_ } from "tinyld"; import { detect as detectLanguage_ } from "tinyld";
import MkSubNoteContent from "./MkSubNoteContent.vue"; import MkSubNoteContent from "./MkSubNoteContent.vue";
import MkNoteSub from "@/components/MkNoteSub.vue"; import MkNoteSub from "@/components/MkNoteSub.vue";
@ -307,7 +307,7 @@ import { getNoteSummary } from "@/scripts/get-note-summary";
const router = useRouter(); const router = useRouter();
const props = defineProps<{ const props = defineProps<{
note: misskey.entities.Note; note: firefish.entities.Note;
pinned?: boolean; pinned?: boolean;
detailedView?: boolean; detailedView?: boolean;
collapsedReply?: boolean; collapsedReply?: boolean;
@ -352,7 +352,7 @@ const renoteButton = ref<InstanceType<typeof XRenoteButton>>();
const renoteTime = ref<HTMLElement>(); const renoteTime = ref<HTMLElement>();
const reactButton = ref<HTMLElement>(); const reactButton = ref<HTMLElement>();
const appearNote = computed(() => const appearNote = computed(() =>
isRenote ? (note.value.renote as misskey.entities.Note) : note.value, isRenote ? (note.value.renote as firefish.entities.Note) : note.value,
); );
const isMyRenote = $i && $i.id === note.value.userId; const isMyRenote = $i && $i.id === note.value.userId;
const showContent = ref(false); const showContent = ref(false);
@ -476,7 +476,7 @@ function undoReact(note): void {
}); });
} }
const currentClipPage = inject<Ref<misskey.entities.Clip> | null>( const currentClipPage = inject<Ref<firefish.entities.Clip> | null>(
"currentClipPage", "currentClipPage",
null, null,
); );

View File

@ -151,7 +151,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, onUnmounted, onUpdated, ref } from "vue"; import { onMounted, onUnmounted, onUpdated, ref } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import type { NoteUpdatedEvent } from "firefish-js/built/streaming.types"; import type { NoteUpdatedEvent } from "firefish-js/built/streaming.types";
import MkTab from "@/components/MkTab.vue"; import MkTab from "@/components/MkTab.vue";
import MkNote from "@/components/MkNote.vue"; import MkNote from "@/components/MkNote.vue";
@ -173,7 +173,7 @@ import { deepClone } from "@/scripts/clone";
import { stream } from "@/stream"; import { stream } from "@/stream";
const props = defineProps<{ const props = defineProps<{
note: misskey.entities.Note; note: firefish.entities.Note;
pinned?: boolean; pinned?: boolean;
}>(); }>();
@ -219,10 +219,10 @@ const muted = ref(
); );
const translation = ref(null); const translation = ref(null);
const translating = ref(false); const translating = ref(false);
const conversation = ref<null | misskey.entities.Note[]>([]); const conversation = ref<null | firefish.entities.Note[]>([]);
const replies = ref<misskey.entities.Note[]>([]); const replies = ref<firefish.entities.Note[]>([]);
const directReplies = ref<null | misskey.entities.Note[]>([]); const directReplies = ref<null | firefish.entities.Note[]>([]);
const directQuotes = ref<null | misskey.entities.Note[]>([]); const directQuotes = ref<null | firefish.entities.Note[]>([]);
const clips = ref(); const clips = ref();
const renotes = ref(); const renotes = ref();
let isScrolling; let isScrolling;

View File

@ -50,7 +50,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import { defaultStore } from "@/store"; import { defaultStore } from "@/store";
import MkVisibility from "@/components/MkVisibility.vue"; import MkVisibility from "@/components/MkVisibility.vue";
import MkInstanceTicker from "@/components/MkInstanceTicker.vue"; import MkInstanceTicker from "@/components/MkInstanceTicker.vue";
@ -60,7 +60,7 @@ import { i18n } from "@/i18n";
import { pageWindow } from "@/os"; import { pageWindow } from "@/os";
const props = defineProps<{ const props = defineProps<{
note: misskey.entities.Note; note: firefish.entities.Note;
pinned?: boolean; pinned?: boolean;
canOpenServerInfo?: boolean; canOpenServerInfo?: boolean;
}>(); }>();

View File

@ -11,12 +11,12 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import XNoteHeader from "@/components/MkNoteHeader.vue"; import XNoteHeader from "@/components/MkNoteHeader.vue";
import MkSubNoteContent from "@/components/MkSubNoteContent.vue"; import MkSubNoteContent from "@/components/MkSubNoteContent.vue";
const props = defineProps<{ const props = defineProps<{
note: misskey.entities.Note; note: firefish.entities.Note;
pinned?: boolean; pinned?: boolean;
}>(); }>();
</script> </script>

View File

@ -191,7 +191,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, inject, ref } from "vue"; import { computed, inject, ref } from "vue";
import type { Ref } from "vue"; import type { Ref } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import * as mfm from "mfm-js"; import * as mfm from "mfm-js";
import { detect as detectLanguage_ } from "tinyld"; import { detect as detectLanguage_ } from "tinyld";
import XNoteHeader from "@/components/MkNoteHeader.vue"; import XNoteHeader from "@/components/MkNoteHeader.vue";
@ -221,8 +221,8 @@ const router = useRouter();
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
note: misskey.entities.Note; note: firefish.entities.Note;
conversation?: misskey.entities.Note[]; conversation?: firefish.entities.Note[];
parentId?; parentId?;
detailedView?; detailedView?;
@ -262,7 +262,7 @@ const starButton = ref<InstanceType<typeof XStarButton>>();
const renoteButton = ref<InstanceType<typeof XRenoteButton>>(); const renoteButton = ref<InstanceType<typeof XRenoteButton>>();
const reactButton = ref<HTMLElement>(); const reactButton = ref<HTMLElement>();
const appearNote = computed(() => const appearNote = computed(() =>
isRenote ? (note.value.renote as misskey.entities.Note) : note.value, isRenote ? (note.value.renote as firefish.entities.Note) : note.value,
); );
const isDeleted = ref(false); const isDeleted = ref(false);
const muted = ref( const muted = ref(
@ -275,7 +275,7 @@ const muted = ref(
); );
const translation = ref(null); const translation = ref(null);
const translating = ref(false); const translating = ref(false);
const replies: misskey.entities.Note[] = const replies: firefish.entities.Note[] =
props.conversation props.conversation
?.filter( ?.filter(
(item) => (item) =>
@ -378,7 +378,7 @@ function undoReact(note): void {
}); });
} }
const currentClipPage = inject<Ref<misskey.entities.Clip> | null>( const currentClipPage = inject<Ref<firefish.entities.Clip> | null>(
"currentClipPage", "currentClipPage",
null, null,
); );

View File

@ -274,7 +274,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, onUnmounted, ref, watch } from "vue"; import { onMounted, onUnmounted, ref, watch } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import XReactionIcon from "@/components/MkReactionIcon.vue"; import XReactionIcon from "@/components/MkReactionIcon.vue";
import MkFollowButton from "@/components/MkFollowButton.vue"; import MkFollowButton from "@/components/MkFollowButton.vue";
import XReactionTooltip from "@/components/MkReactionTooltip.vue"; import XReactionTooltip from "@/components/MkReactionTooltip.vue";
@ -290,7 +290,7 @@ import { instance } from "@/instance";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
notification: misskey.entities.Notification; notification: firefish.entities.Notification;
withTime?: boolean; withTime?: boolean;
full?: boolean; full?: boolean;
}>(), }>(),

View File

@ -65,7 +65,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { ComputedRef } from "vue"; import type { ComputedRef } from "vue";
import { computed, isRef, onActivated, onDeactivated, ref, watch } from "vue"; import { computed, isRef, onActivated, onDeactivated, ref, watch } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import * as os from "@/os"; import * as os from "@/os";
import { import {
getScrollContainer, getScrollContainer,
@ -77,13 +77,13 @@ import MkButton from "@/components/MkButton.vue";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
export interface Paging< export interface Paging<
E extends keyof misskey.Endpoints = keyof misskey.Endpoints, E extends keyof firefish.Endpoints = keyof firefish.Endpoints,
> { > {
endpoint: E; endpoint: E;
limit: number; limit: number;
params?: params?:
| misskey.Endpoints[E]["req"] | firefish.Endpoints[E]["req"]
| ComputedRef<misskey.Endpoints[E]["req"]>; | ComputedRef<firefish.Endpoints[E]["req"]>;
/** /**
* 検索APIのようなページング不可なエンドポイントを利用する場合 * 検索APIのようなページング不可なエンドポイントを利用する場合

View File

@ -53,7 +53,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, ref } from "vue"; import { computed, ref } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import { sum } from "@/scripts/array"; import { sum } from "@/scripts/array";
import { pleaseLogin } from "@/scripts/please-login"; import { pleaseLogin } from "@/scripts/please-login";
import * as os from "@/os"; import * as os from "@/os";
@ -61,7 +61,7 @@ import { i18n } from "@/i18n";
import { useInterval } from "@/scripts/use-interval"; import { useInterval } from "@/scripts/use-interval";
const props = defineProps<{ const props = defineProps<{
note: misskey.entities.Note; note: firefish.entities.Note;
readOnly?: boolean; readOnly?: boolean;
}>(); }>();

View File

@ -243,7 +243,7 @@ import {
watch, watch,
} from "vue"; } from "vue";
import * as mfm from "mfm-js"; import * as mfm from "mfm-js";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import autosize from "autosize"; import autosize from "autosize";
import insertTextAtCursor from "insert-text-at-cursor"; import insertTextAtCursor from "insert-text-at-cursor";
import { length } from "stringz"; import { length } from "stringz";
@ -281,22 +281,22 @@ const modal = inject("modal");
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
reply?: misskey.entities.Note; reply?: firefish.entities.Note;
renote?: misskey.entities.Note; renote?: firefish.entities.Note;
channel?: any; // TODO channel?: any; // TODO
mention?: misskey.entities.User; mention?: firefish.entities.User;
specified?: misskey.entities.User; specified?: firefish.entities.User;
initialText?: string; initialText?: string;
initialVisibility?: typeof misskey.noteVisibilities; initialVisibility?: typeof firefish.noteVisibilities;
initialFiles?: misskey.entities.DriveFile[]; initialFiles?: firefish.entities.DriveFile[];
initialLocalOnly?: boolean; initialLocalOnly?: boolean;
initialVisibleUsers?: misskey.entities.User[]; initialVisibleUsers?: firefish.entities.User[];
initialNote?: misskey.entities.Note; initialNote?: firefish.entities.Note;
instant?: boolean; instant?: boolean;
fixed?: boolean; fixed?: boolean;
autofocus?: boolean; autofocus?: boolean;
showMfmCheatSheet?: boolean; showMfmCheatSheet?: boolean;
editId?: misskey.entities.Note["id"]; editId?: firefish.entities.Note["id"];
}>(), }>(),
{ {
initialVisibleUsers: () => [], initialVisibleUsers: () => [],
@ -338,7 +338,7 @@ const visibility = ref(
((defaultStore.state.rememberNoteVisibility ((defaultStore.state.rememberNoteVisibility
? defaultStore.state.visibility ? defaultStore.state.visibility
: defaultStore.state : defaultStore.state
.defaultNoteVisibility) as (typeof misskey.noteVisibilities)[number]), .defaultNoteVisibility) as (typeof firefish.noteVisibilities)[number]),
); );
const visibleUsers = ref([]); const visibleUsers = ref([]);
if (props.initialVisibleUsers) { if (props.initialVisibleUsers) {
@ -980,7 +980,7 @@ function showActions(ev) {
); );
} }
const postAccount = ref<misskey.entities.UserDetailed | null>(null); const postAccount = ref<firefish.entities.UserDetailed | null>(null);
function openAccountMenu(ev: MouseEvent) { function openAccountMenu(ev: MouseEvent) {
openAccountMenu_( openAccountMenu_(

View File

@ -21,26 +21,26 @@
<script lang="ts" setup> <script lang="ts" setup>
import { shallowRef } from "vue"; import { shallowRef } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import MkModal from "@/components/MkModal.vue"; import MkModal from "@/components/MkModal.vue";
import MkPostForm from "@/components/MkPostForm.vue"; import MkPostForm from "@/components/MkPostForm.vue";
const props = defineProps<{ const props = defineProps<{
reply?: misskey.entities.Note; reply?: firefish.entities.Note;
renote?: misskey.entities.Note; renote?: firefish.entities.Note;
channel?: any; // TODO channel?: any; // TODO
mention?: misskey.entities.User; mention?: firefish.entities.User;
specified?: misskey.entities.User; specified?: firefish.entities.User;
initialText?: string; initialText?: string;
initialVisibility?: typeof misskey.noteVisibilities; initialVisibility?: typeof firefish.noteVisibilities;
initialFiles?: misskey.entities.DriveFile[]; initialFiles?: firefish.entities.DriveFile[];
initialLocalOnly?: boolean; initialLocalOnly?: boolean;
initialVisibleUsers?: misskey.entities.User[]; initialVisibleUsers?: firefish.entities.User[];
initialNote?: misskey.entities.Note; initialNote?: firefish.entities.Note;
instant?: boolean; instant?: boolean;
fixed?: boolean; fixed?: boolean;
autofocus?: boolean; autofocus?: boolean;
editId?: misskey.entities.Note["id"]; editId?: firefish.entities.Note["id"];
}>(); }>();
const emit = defineEmits<{ const emit = defineEmits<{

View File

@ -37,16 +37,16 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, ref, watch } from "vue"; import { onMounted, ref, watch } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import MkReactionIcon from "@/components/MkReactionIcon.vue"; import MkReactionIcon from "@/components/MkReactionIcon.vue";
import MkUserCardMini from "@/components/MkUserCardMini.vue"; import MkUserCardMini from "@/components/MkUserCardMini.vue";
import * as os from "@/os"; import * as os from "@/os";
const props = defineProps<{ const props = defineProps<{
noteId: misskey.entities.Note["id"]; noteId: firefish.entities.Note["id"];
}>(); }>();
const note = ref<misskey.entities.Note>(); const note = ref<firefish.entities.Note>();
const tab = ref<string>(); const tab = ref<string>();
const reactions = ref<string[]>(); const reactions = ref<string[]>();
const users = ref(); const users = ref();

View File

@ -23,7 +23,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, ref } from "vue"; import { computed, ref } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import XDetails from "@/components/MkReactionsViewer.details.vue"; import XDetails from "@/components/MkReactionsViewer.details.vue";
import XReactionIcon from "@/components/MkReactionIcon.vue"; import XReactionIcon from "@/components/MkReactionIcon.vue";
import * as os from "@/os"; import * as os from "@/os";
@ -34,7 +34,7 @@ const props = defineProps<{
reaction: string; reaction: string;
count: number; count: number;
isInitial: boolean; isInitial: boolean;
note: misskey.entities.Note; note: firefish.entities.Note;
}>(); }>();
const emit = defineEmits<{ const emit = defineEmits<{

View File

@ -18,12 +18,12 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, ref } from "vue"; import { computed, ref } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import { $i } from "@/account"; import { $i } from "@/account";
import XReaction from "@/components/MkReactionsViewer.reaction.vue"; import XReaction from "@/components/MkReactionsViewer.reaction.vue";
const props = defineProps<{ const props = defineProps<{
note: misskey.entities.Note; note: firefish.entities.Note;
}>(); }>();
const reactionsEl = ref<HTMLElement>(); const reactionsEl = ref<HTMLElement>();

View File

@ -22,7 +22,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, ref } from "vue"; import { computed, ref } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import Ripple from "@/components/MkRipple.vue"; import Ripple from "@/components/MkRipple.vue";
import XDetails from "@/components/MkUsersTooltip.vue"; import XDetails from "@/components/MkUsersTooltip.vue";
import { pleaseLogin } from "@/scripts/please-login"; import { pleaseLogin } from "@/scripts/please-login";
@ -35,7 +35,7 @@ import type { MenuItem } from "@/types/menu";
import { vibrate } from "@/scripts/vibrate"; import { vibrate } from "@/scripts/vibrate";
const props = defineProps<{ const props = defineProps<{
note: misskey.entities.Note; note: firefish.entities.Note;
count: number; count: number;
detailedView?; detailedView?;
}>(); }>();

View File

@ -177,7 +177,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import * as mfm from "mfm-js"; import * as mfm from "mfm-js";
import * as os from "@/os"; import * as os from "@/os";
import XNoteSimple from "@/components/MkNoteSimple.vue"; import XNoteSimple from "@/components/MkNoteSimple.vue";
@ -194,7 +194,7 @@ import { i18n } from "@/i18n";
import { defaultStore } from "@/store"; import { defaultStore } from "@/store";
const props = defineProps<{ const props = defineProps<{
note: misskey.entities.Note; note: firefish.entities.Note;
parentId?; parentId?;
conversation?; conversation?;
detailed?: boolean; detailed?: boolean;

View File

@ -26,14 +26,14 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import MkMiniChart from "@/components/MkMiniChart.vue"; import MkMiniChart from "@/components/MkMiniChart.vue";
import * as os from "@/os"; import * as os from "@/os";
import { acct, userPage } from "@/filters/user"; import { acct, userPage } from "@/filters/user";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
user: misskey.entities.User; user: firefish.entities.User;
withChart?: boolean; withChart?: boolean;
showAboutPage?: boolean; showAboutPage?: boolean;
}>(), }>(),

View File

@ -88,7 +88,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import MkFollowButton from "@/components/MkFollowButton.vue"; import MkFollowButton from "@/components/MkFollowButton.vue";
import XShowMoreButton from "@/components/MkShowMoreButton.vue"; import XShowMoreButton from "@/components/MkShowMoreButton.vue";
import MkNumber from "@/components/MkNumber.vue"; import MkNumber from "@/components/MkNumber.vue";
@ -96,7 +96,7 @@ import { userPage } from "@/filters/user";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
const props = defineProps<{ const props = defineProps<{
user: misskey.entities.UserDetailed; user: firefish.entities.UserDetailed;
detailed?: boolean; detailed?: boolean;
}>(); }>();

View File

@ -5,11 +5,11 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed } from "vue"; import { computed } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
const props = defineProps<{ const props = defineProps<{
user: misskey.entities.User; user: firefish.entities.User;
}>(); }>();
const text = computed(() => { const text = computed(() => {

View File

@ -30,7 +30,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, ref } from "vue"; import { onMounted, ref } from "vue";
import * as Acct from "firefish-js/built/acct"; import * as Acct from "firefish-js/built/acct";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import MkUserInfo from "@/components/MkUserInfo.vue"; import MkUserInfo from "@/components/MkUserInfo.vue";
import * as os from "@/os"; import * as os from "@/os";
@ -47,7 +47,7 @@ const emit = defineEmits<{
}>(); }>();
const zIndex = os.claimZIndex("middle"); const zIndex = os.claimZIndex("middle");
const user = ref<misskey.entities.UserDetailed | null>(null); const user = ref<firefish.entities.UserDetailed | null>(null);
const top = ref(0); const top = ref(0);
const left = ref(0); const left = ref(0);

View File

@ -89,7 +89,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, ref } from "vue"; import { onMounted, ref } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import MkInput from "@/components/form/input.vue"; import MkInput from "@/components/form/input.vue";
import FormSplit from "@/components/form/split.vue"; import FormSplit from "@/components/form/split.vue";
import XModalWindow from "@/components/MkModalWindow.vue"; import XModalWindow from "@/components/MkModalWindow.vue";
@ -98,16 +98,16 @@ import { defaultStore } from "@/store";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
const emit = defineEmits<{ const emit = defineEmits<{
(ev: "ok", selected: misskey.entities.UserDetailed): void; (ev: "ok", selected: firefish.entities.UserDetailed): void;
(ev: "cancel"): void; (ev: "cancel"): void;
(ev: "closed"): void; (ev: "closed"): void;
}>(); }>();
const username = ref(""); const username = ref("");
const host = ref(""); const host = ref("");
const users: misskey.entities.UserDetailed[] = ref([]); const users: firefish.entities.UserDetailed[] = ref([]);
const recentUsers: misskey.entities.UserDetailed[] = ref([]); const recentUsers: firefish.entities.UserDetailed[] = ref([]);
const selected: misskey.entities.UserDetailed | null = ref(null); const selected: firefish.entities.UserDetailed | null = ref(null);
const dialogEl = ref(); const dialogEl = ref();
const search = () => { const search = () => {

View File

@ -85,7 +85,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, ref } from "vue"; import { onMounted, ref } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import MkInput from "@/components/form/input.vue"; import MkInput from "@/components/form/input.vue";
import FormSplit from "@/components/form/split.vue"; import FormSplit from "@/components/form/split.vue";
import XModalWindow from "@/components/MkModalWindow.vue"; import XModalWindow from "@/components/MkModalWindow.vue";
@ -94,15 +94,15 @@ import { defaultStore } from "@/store";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
const emit = defineEmits<{ const emit = defineEmits<{
(ev: "ok", selected: misskey.entities.UserDetailed): void; (ev: "ok", selected: firefish.entities.UserDetailed): void;
(ev: "cancel"): void; (ev: "cancel"): void;
(ev: "closed"): void; (ev: "closed"): void;
}>(); }>();
const username = ref(""); const username = ref("");
const users: misskey.entities.UserDetailed[] = ref([]); const users: firefish.entities.UserDetailed[] = ref([]);
const recentUsers: misskey.entities.UserDetailed[] = ref([]); const recentUsers: firefish.entities.UserDetailed[] = ref([]);
const selected: misskey.entities.UserDetailed | null = ref(null); const selected: firefish.entities.UserDetailed | null = ref(null);
const dialogEl = ref(); const dialogEl = ref();
const search = () => { const search = () => {

View File

@ -123,7 +123,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { nextTick, ref, shallowRef, watch } from "vue"; import { nextTick, ref, shallowRef, watch } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import MkModal from "@/components/MkModal.vue"; import MkModal from "@/components/MkModal.vue";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
@ -131,7 +131,7 @@ const modal = shallowRef<InstanceType<typeof MkModal>>();
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
currentVisibility: (typeof misskey.noteVisibilities)[number]; currentVisibility: (typeof firefish.noteVisibilities)[number];
currentLocalOnly: boolean; currentLocalOnly: boolean;
src?: HTMLElement; src?: HTMLElement;
}>(), }>(),
@ -141,7 +141,7 @@ const props = withDefaults(
const emit = defineEmits<{ const emit = defineEmits<{
( (
ev: "changeVisibility", ev: "changeVisibility",
v: (typeof misskey.noteVisibilities)[number], v: (typeof firefish.noteVisibilities)[number],
): void; ): void;
(ev: "changeLocalOnly", v: boolean): void; (ev: "changeLocalOnly", v: boolean): void;
(ev: "closed"): void; (ev: "closed"): void;
@ -154,7 +154,7 @@ watch(localOnly, () => {
emit("changeLocalOnly", localOnly.value); emit("changeLocalOnly", localOnly.value);
}); });
function choose(visibility: (typeof misskey.noteVisibilities)[number]): void { function choose(visibility: (typeof firefish.noteVisibilities)[number]): void {
v.value = visibility; v.value = visibility;
emit("changeVisibility", visibility); emit("changeVisibility", visibility);
nextTick(() => { nextTick(() => {

View File

@ -10,12 +10,12 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import { toUnicode } from "punycode/"; import { toUnicode } from "punycode/";
import { host as hostRaw } from "@/config"; import { host as hostRaw } from "@/config";
defineProps<{ defineProps<{
user: misskey.entities.UserDetailed; user: firefish.entities.UserDetailed;
detail?: boolean; detail?: boolean;
}>(); }>();

View File

@ -37,7 +37,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, ref, watch } from "vue"; import { computed, ref, watch } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import { getStaticImageUrl } from "@/scripts/get-static-image-url"; import { getStaticImageUrl } from "@/scripts/get-static-image-url";
import { extractAvgColorFromBlurhash } from "@/scripts/extract-avg-color-from-blurhash"; import { extractAvgColorFromBlurhash } from "@/scripts/extract-avg-color-from-blurhash";
import { acct, userPage } from "@/filters/user"; import { acct, userPage } from "@/filters/user";
@ -46,7 +46,7 @@ import { defaultStore } from "@/store";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
user: misskey.entities.User; user: firefish.entities.User;
target?: string | null; target?: string | null;
disableLink?: boolean; disableLink?: boolean;
disablePreview?: boolean; disablePreview?: boolean;

View File

@ -9,11 +9,11 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
user: misskey.entities.User; user: firefish.entities.User;
nowrap?: boolean; nowrap?: boolean;
}>(), }>(),
{ {

View File

@ -1,15 +1,15 @@
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import * as Acct from "firefish-js/built/acct"; import * as Acct from "firefish-js/built/acct";
import { url } from "@/config"; import { url } from "@/config";
export const acct = (user: misskey.Acct) => { export const acct = (user: firefish.Acct) => {
return Acct.toString(user); return Acct.toString(user);
}; };
export const userName = (user: misskey.entities.User) => { export const userName = (user: firefish.entities.User) => {
return user.name || user.username; return user.name || user.username;
}; };
export const userPage = (user: misskey.Acct, path?, absolute = false) => { export const userPage = (user: firefish.Acct, path?, absolute = false) => {
return `${absolute ? url : ""}/@${acct(user)}${path ? `/${path}` : ""}`; return `${absolute ? url : ""}/@${acct(user)}${path ? `/${path}` : ""}`;
}; };

View File

@ -1,5 +1,5 @@
import { computed, reactive } from "vue"; import { computed, reactive } from "vue";
import type * as Misskey from "firefish-js"; import type * as firefish from "firefish-js";
import { api } from "./os"; import { api } from "./os";
// TODO: 他のタブと永続化されたstateを同期 // TODO: 他のタブと永続化されたstateを同期
@ -7,7 +7,7 @@ import { api } from "./os";
const instanceData = localStorage.getItem("instance"); const instanceData = localStorage.getItem("instance");
// TODO: instanceをリアクティブにするかは再考の余地あり // TODO: instanceをリアクティブにするかは再考の余地あり
export const instance: Misskey.entities.DetailedInstanceMetadata = reactive( export const instance: firefish.entities.DetailedInstanceMetadata = reactive(
instanceData instanceData
? JSON.parse(instanceData) ? JSON.parse(instanceData)
: { : {

View File

@ -4,7 +4,7 @@ import type { Component, Ref } from "vue";
import { defineAsyncComponent, markRaw, ref } from "vue"; import { defineAsyncComponent, markRaw, ref } from "vue";
import { EventEmitter } from "eventemitter3"; import { EventEmitter } from "eventemitter3";
import insertTextAtCursor from "insert-text-at-cursor"; import insertTextAtCursor from "insert-text-at-cursor";
import * as Misskey from "firefish-js"; import * as firefish from "firefish-js";
import { i18n } from "./i18n"; import { i18n } from "./i18n";
import { apiUrl, url } from "@/config"; import { apiUrl, url } from "@/config";
import MkPostFormDialog from "@/components/MkPostFormDialog.vue"; import MkPostFormDialog from "@/components/MkPostFormDialog.vue";
@ -16,7 +16,7 @@ import { $i } from "@/account";
export const pendingApiRequestsCount = ref(0); export const pendingApiRequestsCount = ref(0);
const apiClient = new Misskey.api.APIClient({ const apiClient = new firefish.api.APIClient({
origin: url, origin: url,
}); });
@ -651,7 +651,7 @@ export async function selectLocalUser() {
}); });
} }
export async function selectInstance(): Promise<Misskey.entities.Instance> { export async function selectInstance(): Promise<firefish.entities.Instance> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup( popup(
defineAsyncComponent({ defineAsyncComponent({
@ -741,11 +741,11 @@ export async function pickEmoji(src: HTMLElement | null, opts) {
} }
export async function cropImage( export async function cropImage(
image: Misskey.entities.DriveFile, image: firefish.entities.DriveFile,
options: { options: {
aspectRatio: number; aspectRatio: number;
}, },
): Promise<Misskey.entities.DriveFile> { ): Promise<firefish.entities.DriveFile> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup( popup(
defineAsyncComponent({ defineAsyncComponent({

View File

@ -37,7 +37,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import MkButton from "@/components/MkButton.vue"; import MkButton from "@/components/MkButton.vue";
import { version } from "@/config"; import { version } from "@/config";
import * as os from "@/os"; import * as os from "@/os";
@ -54,7 +54,7 @@ const props = withDefaults(
const loaded = ref(false); const loaded = ref(false);
const serverIsDead = ref(false); const serverIsDead = ref(false);
const meta = ref<misskey.entities.LiteInstanceMetadata | null>(null); const meta = ref<firefish.entities.LiteInstanceMetadata | null>(null);
os.api("meta", { os.api("meta", {
detail: false, detail: false,

View File

@ -19,13 +19,13 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import MkMiniChart from "@/components/MkMiniChart.vue"; import MkMiniChart from "@/components/MkMiniChart.vue";
import * as os from "@/os"; import * as os from "@/os";
import { acct } from "@/filters/user"; import { acct } from "@/filters/user";
const props = defineProps<{ const props = defineProps<{
user: misskey.entities.User; user: firefish.entities.User;
}>(); }>();
const chart = ref(null); const chart = ref(null);

View File

@ -29,7 +29,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, provide, ref, watch } from "vue"; import { computed, provide, ref, watch } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import XNotes from "@/components/MkNotes.vue"; import XNotes from "@/components/MkNotes.vue";
import { $i } from "@/account"; import { $i } from "@/account";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
@ -40,7 +40,7 @@ const props = defineProps<{
clipId: string; clipId: string;
}>(); }>();
const clip = ref<misskey.entities.Clip>(); const clip = ref<firefish.entities.Clip>();
const pagination = { const pagination = {
endpoint: "clips/notes" as const, endpoint: "clips/notes" as const,
limit: 10, limit: 10,

View File

@ -56,7 +56,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, onMounted, ref, watch } from "vue"; import { computed, onMounted, ref, watch } from "vue";
import type * as Misskey from "firefish-js"; import type * as firefish from "firefish-js";
import autosize from "autosize"; import autosize from "autosize";
// import insertTextAtCursor from 'insert-text-at-cursor'; // import insertTextAtCursor from 'insert-text-at-cursor';
import { throttle } from "throttle-debounce"; import { throttle } from "throttle-debounce";
@ -70,15 +70,15 @@ import { i18n } from "@/i18n";
import { uploadFile } from "@/scripts/upload"; import { uploadFile } from "@/scripts/upload";
const props = defineProps<{ const props = defineProps<{
user?: Misskey.entities.UserDetailed | null; user?: firefish.entities.UserDetailed | null;
group?: Misskey.entities.UserGroup | null; group?: firefish.entities.UserGroup | null;
}>(); }>();
const textEl = ref<HTMLTextAreaElement>(); const textEl = ref<HTMLTextAreaElement>();
const fileEl = ref<HTMLInputElement>(); const fileEl = ref<HTMLInputElement>();
const text = ref<string>(""); const text = ref<string>("");
const file = ref<Misskey.entities.DriveFile | null>(null); const file = ref<firefish.entities.DriveFile | null>(null);
const sending = ref(false); const sending = ref(false);
const typing = throttle(3000, () => { const typing = throttle(3000, () => {
stream.send( stream.send(

View File

@ -85,7 +85,7 @@
import { computed } from "vue"; import { computed } from "vue";
import * as mfm from "mfm-js"; import * as mfm from "mfm-js";
import type * as Misskey from "firefish-js"; import type * as firefish from "firefish-js";
import XMediaList from "@/components/MkMediaList.vue"; import XMediaList from "@/components/MkMediaList.vue";
import { extractUrlFromMfm } from "@/scripts/extract-url-from-mfm"; import { extractUrlFromMfm } from "@/scripts/extract-url-from-mfm";
import MkUrlPreview from "@/components/MkUrlPreview.vue"; import MkUrlPreview from "@/components/MkUrlPreview.vue";
@ -94,7 +94,7 @@ import { $i } from "@/account";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
const props = defineProps<{ const props = defineProps<{
message: Misskey.entities.MessagingMessage; message: firefish.entities.MessagingMessage;
isGroup?: boolean; isGroup?: boolean;
}>(); }>();

View File

@ -105,7 +105,7 @@ import {
ref, ref,
watch, watch,
} from "vue"; } from "vue";
import type * as Misskey from "firefish-js"; import type * as firefish from "firefish-js";
import * as Acct from "firefish-js/built/acct"; import * as Acct from "firefish-js/built/acct";
import XMessage from "./messaging-room.message.vue"; import XMessage from "./messaging-room.message.vue";
import XForm from "./messaging-room.form.vue"; import XForm from "./messaging-room.form.vue";
@ -136,11 +136,11 @@ const formEl = ref<InstanceType<typeof XForm>>();
const pagingComponent = ref<InstanceType<typeof MkPagination>>(); const pagingComponent = ref<InstanceType<typeof MkPagination>>();
const fetching = ref(true); const fetching = ref(true);
const user = ref<Misskey.entities.UserDetailed | null>(null); const user = ref<firefish.entities.UserDetailed | null>(null);
const group = ref<Misskey.entities.UserGroup | null>(null); const group = ref<firefish.entities.UserGroup | null>(null);
const typers = ref<Misskey.entities.User[]>([]); const typers = ref<firefish.entities.User[]>([]);
const connection: Misskey.ChannelConnection< const connection: firefish.ChannelConnection<
Misskey.Channels["messaging"] firefish.Channels["messaging"]
> | null = ref(null); > | null = ref(null);
const showIndicator = ref(false); const showIndicator = ref(false);
const { animation } = defaultStore.reactiveState; const { animation } = defaultStore.reactiveState;

View File

@ -70,7 +70,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, ref, watch } from "vue"; import { computed, ref, watch } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import XNoteDetailed from "@/components/MkNoteDetailed.vue"; import XNoteDetailed from "@/components/MkNoteDetailed.vue";
import XNotes from "@/components/MkNotes.vue"; import XNotes from "@/components/MkNotes.vue";
import MkRemoteCaution from "@/components/MkRemoteCaution.vue"; import MkRemoteCaution from "@/components/MkRemoteCaution.vue";
@ -83,14 +83,14 @@ const props = defineProps<{
noteId: string; noteId: string;
}>(); }>();
const note = ref<null | misskey.entities.Note>(); const note = ref<null | firefish.entities.Note>();
const hasPrev = ref(false); const hasPrev = ref(false);
const hasNext = ref(false); const hasNext = ref(false);
const showPrev = ref(false); const showPrev = ref(false);
const showNext = ref(false); const showNext = ref(false);
const error = ref(); const error = ref();
const isRenote = ref(false); const isRenote = ref(false);
const appearNote = ref<null | misskey.entities.Note>(); const appearNote = ref<null | firefish.entities.Note>();
const prevPagination = { const prevPagination = {
endpoint: "users/notes" as const, endpoint: "users/notes" as const,
@ -136,7 +136,7 @@ function fetchNote() {
note.value.fileIds.length === 0 && note.value.fileIds.length === 0 &&
note.value.poll == null; note.value.poll == null;
appearNote.value = isRenote.value appearNote.value = isRenote.value
? (note.value.renote as misskey.entities.Note) ? (note.value.renote as firefish.entities.Note)
: note.value; : note.value;
Promise.all([ Promise.all([

View File

@ -114,7 +114,7 @@
>{{ i18n.ts._theme.manage >{{ i18n.ts._theme.manage
}}<template #suffix>{{ themesCount }}</template></FormLink }}<template #suffix>{{ themesCount }}</template></FormLink
> >
<FormLink to="https://assets.misskey.io/theme/list" external <FormLink to="https://assets.firefish.io/theme/list" external
><template #icon ><template #icon
><i class="ph-planet ph-bold ph-lg"></i></template ><i class="ph-planet ph-bold ph-lg"></i></template
>{{ i18n.ts._theme.explore }}</FormLink >{{ i18n.ts._theme.explore }}</FormLink

View File

@ -35,7 +35,7 @@ import { computed, ref } from "vue";
// SPECIFICATION: https://misskey-hub.net/docs/features/share-form.html // SPECIFICATION: https://misskey-hub.net/docs/features/share-form.html
import { noteVisibilities } from "firefish-js"; import { noteVisibilities } from "firefish-js";
import * as Acct from "firefish-js/built/acct"; import * as Acct from "firefish-js/built/acct";
import type * as Misskey from "firefish-js"; import type * as firefish from "firefish-js";
import MkButton from "@/components/MkButton.vue"; import MkButton from "@/components/MkButton.vue";
import XPostForm from "@/components/MkPostForm.vue"; import XPostForm from "@/components/MkPostForm.vue";
import * as os from "@/os"; import * as os from "@/os";
@ -52,16 +52,16 @@ const title = ref(urlParams.get("title"));
const text = urlParams.get("text"); const text = urlParams.get("text");
const url = urlParams.get("url"); const url = urlParams.get("url");
const initialText = ref(null as string | null); const initialText = ref(null as string | null);
const reply = ref(null as Misskey.entities.Note | null); const reply = ref(null as firefish.entities.Note | null);
const renote = ref(null as Misskey.entities.Note | null); const renote = ref(null as firefish.entities.Note | null);
const visibility = ref( const visibility = ref(
noteVisibilities.includes(visibilityQuery) ? visibilityQuery : null, noteVisibilities.includes(visibilityQuery) ? visibilityQuery : null,
); );
const localOnly = ref( const localOnly = ref(
localOnlyQuery === "0" ? false : localOnlyQuery === "1" ? true : null, localOnlyQuery === "0" ? false : localOnlyQuery === "1" ? true : null,
); );
const files = ref([] as Misskey.entities.DriveFile[]); const files = ref([] as firefish.entities.DriveFile[]);
const visibleUsers = ref([] as Misskey.entities.User[]); const visibleUsers = ref([] as firefish.entities.User[]);
async function init() { async function init() {
let noteText = ""; let noteText = "";

View File

@ -358,7 +358,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, ref, watch } from "vue"; import { computed, ref, watch } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import MkChart from "@/components/MkChart.vue"; import MkChart from "@/components/MkChart.vue";
import MkObjectView from "@/components/MkObjectView.vue"; import MkObjectView from "@/components/MkObjectView.vue";
import FormTextarea from "@/components/form/textarea.vue"; import FormTextarea from "@/components/form/textarea.vue";
@ -387,7 +387,7 @@ const props = defineProps<{
const tab = ref("overview"); const tab = ref("overview");
const chartSrc = ref("per-user-notes"); const chartSrc = ref("per-user-notes");
const user = ref<null | misskey.entities.UserDetailed>(); const user = ref<null | firefish.entities.UserDetailed>();
const init = ref<ReturnType<typeof createFetcher>>(); const init = ref<ReturnType<typeof createFetcher>>();
const info = ref(); const info = ref();
const ips = ref(null); const ips = ref(null);

View File

@ -25,11 +25,11 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed } from "vue"; import { computed } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import MkPagination from "@/components/MkPagination.vue"; import MkPagination from "@/components/MkPagination.vue";
const props = defineProps<{ const props = defineProps<{
user: misskey.entities.User; user: firefish.entities.User;
}>(); }>();
const pagination = { const pagination = {

View File

@ -24,12 +24,12 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed } from "vue"; import { computed } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import MkUserInfo from "@/components/MkUserInfo.vue"; import MkUserInfo from "@/components/MkUserInfo.vue";
import MkPagination from "@/components/MkPagination.vue"; import MkPagination from "@/components/MkPagination.vue";
const props = defineProps<{ const props = defineProps<{
user: misskey.entities.User; user: firefish.entities.User;
type: "following" | "followers"; type: "following" | "followers";
}>(); }>();

View File

@ -18,7 +18,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, ref, watch } from "vue"; import { computed, ref, watch } from "vue";
import * as Acct from "firefish-js/built/acct"; import * as Acct from "firefish-js/built/acct";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import XFollowList from "./follow-list.vue"; import XFollowList from "./follow-list.vue";
import * as os from "@/os"; import * as os from "@/os";
import { definePageMetadata } from "@/scripts/page-metadata"; import { definePageMetadata } from "@/scripts/page-metadata";
@ -31,7 +31,7 @@ const props = withDefaults(
{}, {},
); );
const user = ref<null | misskey.entities.UserDetailed>(null); const user = ref<null | firefish.entities.UserDetailed>(null);
const error = ref(null); const error = ref(null);
function fetchUser(): void { function fetchUser(): void {

View File

@ -18,7 +18,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, ref, watch } from "vue"; import { computed, ref, watch } from "vue";
import * as Acct from "firefish-js/built/acct"; import * as Acct from "firefish-js/built/acct";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import XFollowList from "./follow-list.vue"; import XFollowList from "./follow-list.vue";
import * as os from "@/os"; import * as os from "@/os";
import { definePageMetadata } from "@/scripts/page-metadata"; import { definePageMetadata } from "@/scripts/page-metadata";
@ -31,7 +31,7 @@ const props = withDefaults(
{}, {},
); );
const user = ref<null | misskey.entities.UserDetailed>(null); const user = ref<null | firefish.entities.UserDetailed>(null);
const error = ref(null); const error = ref(null);
function fetchUser(): void { function fetchUser(): void {

View File

@ -15,13 +15,13 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed } from "vue"; import { computed } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import MkGalleryPostPreview from "@/components/MkGalleryPostPreview.vue"; import MkGalleryPostPreview from "@/components/MkGalleryPostPreview.vue";
import MkPagination from "@/components/MkPagination.vue"; import MkPagination from "@/components/MkPagination.vue";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
user: misskey.entities.User; user: firefish.entities.User;
}>(), }>(),
{}, {},
); );

View File

@ -388,7 +388,7 @@ import {
} from "vue"; } from "vue";
import calcAge from "s-age"; import calcAge from "s-age";
import cityTimezones from "city-timezones"; import cityTimezones from "city-timezones";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import XUserTimeline from "./index.timeline.vue"; import XUserTimeline from "./index.timeline.vue";
import XNote from "@/components/MkNote.vue"; import XNote from "@/components/MkNote.vue";
import MkFollowButton from "@/components/MkFollowButton.vue"; import MkFollowButton from "@/components/MkFollowButton.vue";
@ -411,7 +411,7 @@ const XActivity = defineAsyncComponent(() => import("./index.activity.vue"));
const emit = defineEmits(["refresh"]); const emit = defineEmits(["refresh"]);
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
user: misskey.entities.UserDetailed; user: firefish.entities.UserDetailed;
}>(), }>(),
{}, {},
); );

View File

@ -31,7 +31,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import MkContainer from "@/components/MkContainer.vue"; import MkContainer from "@/components/MkContainer.vue";
import MkChart from "@/components/MkChart.vue"; import MkChart from "@/components/MkChart.vue";
import * as os from "@/os"; import * as os from "@/os";
@ -39,7 +39,7 @@ import { i18n } from "@/i18n";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
user: misskey.entities.User; user: firefish.entities.User;
limit?: number; limit?: number;
}>(), }>(),
{ {

View File

@ -29,7 +29,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { onMounted, ref } from "vue"; import { onMounted, ref } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import { getStaticImageUrl } from "@/scripts/get-static-image-url"; import { getStaticImageUrl } from "@/scripts/get-static-image-url";
import { notePage } from "@/filters/note"; import { notePage } from "@/filters/note";
import * as os from "@/os"; import * as os from "@/os";
@ -39,18 +39,18 @@ import { defaultStore } from "@/store";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
const props = defineProps<{ const props = defineProps<{
user: misskey.entities.UserDetailed; user: firefish.entities.UserDetailed;
}>(); }>();
const fetching = ref(true); const fetching = ref(true);
const images = ref< const images = ref<
{ {
note: misskey.entities.Note; note: firefish.entities.Note;
file: misskey.entities.DriveFile; file: firefish.entities.DriveFile;
}[] }[]
>([]); >([]);
function thumbnail(image: misskey.entities.DriveFile): string { function thumbnail(image: firefish.entities.DriveFile): string {
return defaultStore.state.disableShowingAnimatedImages return defaultStore.state.disableShowingAnimatedImages
? getStaticImageUrl(image.thumbnailUrl) ? getStaticImageUrl(image.thumbnailUrl)
: image.thumbnailUrl; : image.thumbnailUrl;

View File

@ -13,13 +13,13 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, ref } from "vue"; import { computed, ref } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import XNotes from "@/components/MkNotes.vue"; import XNotes from "@/components/MkNotes.vue";
import MkTab from "@/components/MkTab.vue"; import MkTab from "@/components/MkTab.vue";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
const props = defineProps<{ const props = defineProps<{
user: misskey.entities.UserDetailed; user: firefish.entities.UserDetailed;
}>(); }>();
const include = ref<string | null>(null); const include = ref<string | null>(null);

View File

@ -31,7 +31,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, defineAsyncComponent, ref, watch } from "vue"; import { computed, defineAsyncComponent, ref, watch } from "vue";
import * as Acct from "firefish-js/built/acct"; import * as Acct from "firefish-js/built/acct";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import { acct as getAcct } from "@/filters/user"; import { acct as getAcct } from "@/filters/user";
import * as os from "@/os"; import * as os from "@/os";
import { useRouter } from "@/router"; import { useRouter } from "@/router";
@ -58,7 +58,7 @@ const props = withDefaults(
useRouter(); useRouter();
const tab = ref(props.page); const tab = ref(props.page);
const user = ref<null | misskey.entities.UserDetailed>(null); const user = ref<null | firefish.entities.UserDetailed>(null);
const error = ref(null); const error = ref(null);
function fetchUser(): void { function fetchUser(): void {

View File

@ -13,12 +13,12 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed } from "vue"; import { computed } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import MkPagePreview from "@/components/MkPagePreview.vue"; import MkPagePreview from "@/components/MkPagePreview.vue";
import MkPagination from "@/components/MkPagination.vue"; import MkPagination from "@/components/MkPagination.vue";
const props = defineProps<{ const props = defineProps<{
user: misskey.entities.User; user: firefish.entities.User;
}>(); }>();
const pagination = { const pagination = {

View File

@ -25,13 +25,13 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed } from "vue"; import { computed } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import MkPagination from "@/components/MkPagination.vue"; import MkPagination from "@/components/MkPagination.vue";
import MkNote from "@/components/MkNote.vue"; import MkNote from "@/components/MkNote.vue";
import MkReactionIcon from "@/components/MkReactionIcon.vue"; import MkReactionIcon from "@/components/MkReactionIcon.vue";
const props = defineProps<{ const props = defineProps<{
user: misskey.entities.User; user: firefish.entities.User;
}>(); }>();
const pagination = { const pagination = {

View File

@ -1,6 +1,6 @@
import type { Ref } from "vue"; import type { Ref } from "vue";
import { defineAsyncComponent, inject } from "vue"; import { defineAsyncComponent, inject } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import { $i } from "@/account"; import { $i } from "@/account";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import { instance } from "@/instance"; import { instance } from "@/instance";
@ -12,12 +12,12 @@ import { shareAvailable } from "@/scripts/share-available";
import { getUserMenu } from "@/scripts/get-user-menu"; import { getUserMenu } from "@/scripts/get-user-menu";
export function getNoteMenu(props: { export function getNoteMenu(props: {
note: misskey.entities.Note; note: firefish.entities.Note;
menuButton: Ref<HTMLElement | undefined>; menuButton: Ref<HTMLElement | undefined>;
translation: Ref<any>; translation: Ref<any>;
translating: Ref<boolean>; translating: Ref<boolean>;
isDeleted: Ref<boolean>; isDeleted: Ref<boolean>;
currentClipPage?: Ref<misskey.entities.Clip>; currentClipPage?: Ref<firefish.entities.Clip>;
}) { }) {
const isRenote = const isRenote =
props.note.renote != null && props.note.renote != null &&
@ -26,7 +26,7 @@ export function getNoteMenu(props: {
props.note.poll == null; props.note.poll == null;
const appearNote = isRenote const appearNote = isRenote
? (props.note.renote as misskey.entities.Note) ? (props.note.renote as firefish.entities.Note)
: props.note; : props.note;
function del(): void { function del(): void {

View File

@ -1,11 +1,11 @@
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
/** /**
* 稿 * 稿
* @param {*} note (packされた)稿 * @param {*} note (packされた)稿
*/ */
export const getNoteSummary = (note: misskey.entities.Note): string => { export const getNoteSummary = (note: firefish.entities.Note): string => {
/* /*
if (note.deletedAt) { if (note.deletedAt) {
return `(${i18n.ts.deletedNote})`; return `(${i18n.ts.deletedNote})`;

View File

@ -1,4 +1,4 @@
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import type { ComputedRef, Ref } from "vue"; import type { ComputedRef, Ref } from "vue";
import { inject, isRef, onActivated, onMounted, provide, ref } from "vue"; import { inject, isRef, onActivated, onMounted, provide, ref } from "vue";
@ -9,8 +9,8 @@ export interface PageMetadata {
title: string; title: string;
subtitle?: string; subtitle?: string;
icon?: string | null; icon?: string | null;
avatar?: misskey.entities.User | null; avatar?: firefish.entities.User | null;
userName?: misskey.entities.User | null; userName?: firefish.entities.User | null;
bg?: string; bg?: string;
} }

View File

@ -1,5 +1,5 @@
import { reactive, ref } from "vue"; import { reactive, ref } from "vue";
import type * as Misskey from "firefish-js"; import type * as firefish from "firefish-js";
import { readAndCompressImage } from "browser-image-resizer"; import { readAndCompressImage } from "browser-image-resizer";
import { defaultStore } from "@/store"; import { defaultStore } from "@/store";
import { apiUrl } from "@/config"; import { apiUrl } from "@/config";
@ -34,7 +34,7 @@ export function uploadFile(
folder?: any, folder?: any,
name?: string, name?: string,
keepOriginal: boolean = defaultStore.state.keepOriginalUploading, keepOriginal: boolean = defaultStore.state.keepOriginalUploading,
): Promise<Misskey.entities.DriveFile> { ): Promise<firefish.entities.DriveFile> {
if (folder && typeof folder === "object") folder = folder.id; if (folder && typeof folder === "object") folder = folder.id;
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {

View File

@ -1,13 +1,13 @@
import type { Ref } from "vue"; import type { Ref } from "vue";
import { onUnmounted } from "vue"; import { onUnmounted } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import { stream } from "@/stream"; import { stream } from "@/stream";
import { $i } from "@/account"; import { $i } from "@/account";
import * as os from "@/os"; import * as os from "@/os";
export function useNoteCapture(props: { export function useNoteCapture(props: {
rootEl: Ref<HTMLElement>; rootEl: Ref<HTMLElement>;
note: Ref<misskey.entities.Note>; note: Ref<firefish.entities.Note>;
isDeletedRef: Ref<boolean>; isDeletedRef: Ref<boolean>;
}) { }) {
const note = props.note; const note = props.note;

View File

@ -1,10 +1,10 @@
import * as Misskey from "firefish-js"; import * as firefish from "firefish-js";
import { markRaw } from "vue"; import { markRaw } from "vue";
import { $i } from "@/account"; import { $i } from "@/account";
import { url } from "@/config"; import { url } from "@/config";
export const stream = markRaw( export const stream = markRaw(
new Misskey.Stream( new firefish.Stream(
url, url,
$i $i
? { ? {

View File

@ -1,4 +1,4 @@
import type * as Misskey from "firefish-js"; import type * as firefish from "firefish-js";
import type { Ref } from "vue"; import type { Ref } from "vue";
export type MenuAction = (ev: MouseEvent) => void; export type MenuAction = (ev: MouseEvent) => void;
@ -17,7 +17,7 @@ export interface MenuLink {
textStyle?: string; textStyle?: string;
icon?: string; icon?: string;
indicate?: boolean; indicate?: boolean;
avatar?: Misskey.entities.User; avatar?: firefish.entities.User;
} }
export interface MenuA { export interface MenuA {
type: "a"; type: "a";
@ -31,7 +31,7 @@ export interface MenuA {
} }
export interface MenuUser { export interface MenuUser {
type: "user"; type: "user";
user: Misskey.entities.User; user: firefish.entities.User;
active?: boolean; active?: boolean;
indicate?: boolean; indicate?: boolean;
hidden?: boolean; hidden?: boolean;
@ -54,7 +54,7 @@ export interface MenuButton {
accent?: boolean; accent?: boolean;
active?: boolean; active?: boolean;
hidden?: boolean; hidden?: boolean;
avatar?: Misskey.entities.User; avatar?: firefish.entities.User;
action: MenuAction; action: MenuAction;
} }
export interface MenuParent { export interface MenuParent {

View File

@ -40,7 +40,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, defineAsyncComponent, ref, toRef, watch } from "vue"; import { computed, defineAsyncComponent, ref, toRef, watch } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import MarqueeText from "@/components/MkMarquee.vue"; import MarqueeText from "@/components/MkMarquee.vue";
import * as os from "@/os"; import * as os from "@/os";
import { useInterval } from "@/scripts/use-interval"; import { useInterval } from "@/scripts/use-interval";
@ -57,7 +57,7 @@ const props = defineProps<{
refreshIntervalSec?: number; refreshIntervalSec?: number;
}>(); }>();
const instances = ref<misskey.entities.Instance[]>([]); const instances = ref<firefish.entities.Instance[]>([]);
const fetching = ref(true); const fetching = ref(true);
const key = ref(0); const key = ref(0);

View File

@ -35,7 +35,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, defineAsyncComponent, ref, toRef, watch } from "vue"; import { computed, defineAsyncComponent, ref, toRef, watch } from "vue";
import type * as misskey from "firefish-js"; import type * as firefish from "firefish-js";
import MarqueeText from "@/components/MkMarquee.vue"; import MarqueeText from "@/components/MkMarquee.vue";
import * as os from "@/os"; import * as os from "@/os";
import { useInterval } from "@/scripts/use-interval"; import { useInterval } from "@/scripts/use-interval";
@ -51,7 +51,7 @@ const props = defineProps<{
refreshIntervalSec?: number; refreshIntervalSec?: number;
}>(); }>();
const notes = ref<misskey.entities.Note[]>([]); const notes = ref<firefish.entities.Note[]>([]);
const fetching = ref(true); const fetching = ref(true);
const key = ref(0); const key = ref(0);

View File

@ -1,6 +1,6 @@
# Firefish.js # Firefish.js
Fork of Misskey.js for Firefish Fork of firefish.js for Firefish
https://www.npmjs.com/package/firefish-js https://www.npmjs.com/package/firefish-js

File diff suppressed because it is too large Load Diff

View File

@ -1,48 +1,48 @@
import { expectType } from "tsd"; import { expectType } from "tsd";
import * as Misskey from "../src"; import * as firefish from "../src";
describe("API", () => { describe("API", () => {
test("success", async () => { test("success", async () => {
const cli = new Misskey.api.APIClient({ const cli = new firefish.api.APIClient({
origin: "https://firefish.test", origin: "https://firefish.test",
credential: "TOKEN", credential: "TOKEN",
}); });
const res = await cli.request("meta", { detail: true }); const res = await cli.request("meta", { detail: true });
expectType<Misskey.entities.DetailedInstanceMetadata>(res); expectType<firefish.entities.DetailedInstanceMetadata>(res);
}); });
test("conditional respose type (meta)", async () => { test("conditional respose type (meta)", async () => {
const cli = new Misskey.api.APIClient({ const cli = new firefish.api.APIClient({
origin: "https://firefish.test", origin: "https://firefish.test",
credential: "TOKEN", credential: "TOKEN",
}); });
const res = await cli.request("meta", { detail: true }); const res = await cli.request("meta", { detail: true });
expectType<Misskey.entities.DetailedInstanceMetadata>(res); expectType<firefish.entities.DetailedInstanceMetadata>(res);
const res2 = await cli.request("meta", { detail: false }); const res2 = await cli.request("meta", { detail: false });
expectType<Misskey.entities.LiteInstanceMetadata>(res2); expectType<firefish.entities.LiteInstanceMetadata>(res2);
const res3 = await cli.request("meta", {}); const res3 = await cli.request("meta", {});
expectType<Misskey.entities.LiteInstanceMetadata>(res3); expectType<firefish.entities.LiteInstanceMetadata>(res3);
const res4 = await cli.request("meta", { detail: true as boolean }); const res4 = await cli.request("meta", { detail: true as boolean });
expectType< expectType<
| Misskey.entities.LiteInstanceMetadata | firefish.entities.LiteInstanceMetadata
| Misskey.entities.DetailedInstanceMetadata | firefish.entities.DetailedInstanceMetadata
>(res4); >(res4);
}); });
test("conditional respose type (users/show)", async () => { test("conditional respose type (users/show)", async () => {
const cli = new Misskey.api.APIClient({ const cli = new firefish.api.APIClient({
origin: "https://firefish.test", origin: "https://firefish.test",
credential: "TOKEN", credential: "TOKEN",
}); });
const res = await cli.request("users/show", { userId: "xxxxxxxx" }); const res = await cli.request("users/show", { userId: "xxxxxxxx" });
expectType<Misskey.entities.UserDetailed>(res); expectType<firefish.entities.UserDetailed>(res);
const res2 = await cli.request("users/show", { userIds: ["xxxxxxxx"] }); const res2 = await cli.request("users/show", { userIds: ["xxxxxxxx"] });
expectType<Misskey.entities.UserDetailed[]>(res2); expectType<firefish.entities.UserDetailed[]>(res2);
}); });
}); });

View File

@ -1,19 +1,19 @@
import { expectType } from "tsd"; import { expectType } from "tsd";
import * as Misskey from "../src"; import * as firefish from "../src";
describe("Streaming", () => { describe("Streaming", () => {
test("emit type", async () => { test("emit type", async () => {
const stream = new Misskey.Stream("https://firefish.test", { const stream = new firefish.Stream("https://firefish.test", {
token: "TOKEN", token: "TOKEN",
}); });
const mainChannel = stream.useChannel("main"); const mainChannel = stream.useChannel("main");
mainChannel.on("notification", (notification) => { mainChannel.on("notification", (notification) => {
expectType<Misskey.entities.Notification>(notification); expectType<firefish.entities.Notification>(notification);
}); });
}); });
test("params type", async () => { test("params type", async () => {
const stream = new Misskey.Stream("https://firefish.test", { const stream = new firefish.Stream("https://firefish.test", {
token: "TOKEN", token: "TOKEN",
}); });
// TODO: 「stream.useChannel の第二引数として受け入れる型が // TODO: 「stream.useChannel の第二引数として受け入れる型が
@ -26,7 +26,7 @@ describe("Streaming", () => {
otherparty: "aaa", otherparty: "aaa",
}); });
messagingChannel.on("message", (message) => { messagingChannel.on("message", (message) => {
expectType<Misskey.entities.MessagingMessage>(message); expectType<firefish.entities.MessagingMessage>(message);
}); });
}); });
}); });

View File

@ -40,7 +40,7 @@ export default class WebSocket
private _pongWaiting = false; private _pongWaiting = false;
/** /**
* @param url Full url of websocket: e.g. wss://misskey.io/streaming * @param url Full url of websocket: e.g. wss://firefish.io/streaming
* @param channel Channel name is user, localTimeline, hybridTimeline, globalTimeline, conversation or list. * @param channel Channel name is user, localTimeline, hybridTimeline, globalTimeline, conversation or list.
* @param accessToken The access token. * @param accessToken The access token.
* @param listId This parameter is required when you specify list as channel. * @param listId This parameter is required when you specify list as channel.

View File

@ -2,19 +2,19 @@
* Operations * Operations
* *
*/ */
import * as Misskey from "firefish-js"; import * as firefish from "firefish-js";
import type { SwMessage, SwMessageOrderType } from "@/types"; import type { SwMessage, SwMessageOrderType } from "@/types";
import { getAccountFromId } from "@/scripts/get-account-from-id"; import { getAccountFromId } from "@/scripts/get-account-from-id";
import { getUrlWithLoginId } from "@/scripts/login-id"; import { getUrlWithLoginId } from "@/scripts/login-id";
export const cli = new Misskey.api.APIClient({ export const cli = new firefish.api.APIClient({
origin, origin,
fetch: (...args): Promise<Response> => fetch(...args), fetch: (...args): Promise<Response> => fetch(...args),
}); });
export async function api< export async function api<
E extends keyof Misskey.Endpoints, E extends keyof firefish.Endpoints,
O extends Misskey.Endpoints[E]["req"], O extends firefish.Endpoints[E]["req"],
>( >(
endpoint: E, endpoint: E,
userId?: string, userId?: string,
@ -75,8 +75,8 @@ export function openAntenna(
export async function openPost( export async function openPost(
options: { options: {
initialText?: string; initialText?: string;
reply?: Misskey.entities.Note; reply?: firefish.entities.Note;
renote?: Misskey.entities.Note; renote?: firefish.entities.Note;
}, },
loginId?: string, loginId?: string,
): ReturnType<typeof openClient> { ): ReturnType<typeof openClient> {

View File

@ -1,4 +1,4 @@
import * as Misskey from "firefish-js"; import * as firefish from "firefish-js";
export type SwMessageOrderType = "post" | "push"; export type SwMessageOrderType = "post" | "push";
@ -12,10 +12,10 @@ export type SwMessage = {
// Defined also @/services/push-notification.ts#L7-L14 // Defined also @/services/push-notification.ts#L7-L14
type PushNotificationDataSourceMap = { type PushNotificationDataSourceMap = {
notification: Misskey.entities.Notification; notification: firefish.entities.Notification;
unreadAntennaNote: { unreadAntennaNote: {
antenna: { id: string; name: string }; antenna: { id: string; name: string };
note: Misskey.entities.Note; note: firefish.entities.Note;
}; };
readAllNotifications: undefined; readAllNotifications: undefined;
readAllMessagingMessages: undefined; readAllMessagingMessages: undefined;