refactor: firefish-js & backend-rs imports

This commit is contained in:
naskya 2024-02-13 00:40:46 +09:00
parent 834faaf6de
commit 09396e33a4
No known key found for this signature in database
GPG key ID: 712D413B3A9FED5C
107 changed files with 389 additions and 427 deletions

View file

@ -3,7 +3,7 @@ import {
nativeCreateId, nativeCreateId,
nativeInitIdGenerator, nativeInitIdGenerator,
nativeGetTimestamp, nativeGetTimestamp,
} from "backend-rs/built/index.js"; } from "backend-rs";
const length = Math.min(Math.max(config.cuid?.length ?? 16, 16), 24); const length = Math.min(Math.max(config.cuid?.length ?? 16, 16), 24);
const fingerprint = config.cuid?.fingerprint ?? ""; const fingerprint = config.cuid?.fingerprint ?? "";

View file

@ -1,4 +1,4 @@
import { nativeRandomStr } from "backend-rs/built/index.js"; import { nativeRandomStr } from "backend-rs";
export function secureRndstr(length = 32, _ = true): string { export function secureRndstr(length = 32, _ = true): string {
return nativeRandomStr(length); return nativeRandomStr(length);

View file

@ -23,11 +23,7 @@ import verifyEmail from "./private/verify-email.js";
import { koaBody } from "koa-body"; import { koaBody } from "koa-body";
import { convertAttachment } from "./mastodon/converters.js"; import { convertAttachment } from "./mastodon/converters.js";
// TODO?: should we avoid importing things from built directory? import { convertId, IdConvertType as IdType } from "backend-rs";
import {
convertId,
IdConvertType as IdType,
} from "backend-rs/built/index.js";
// re-export native rust id conversion (function and enum) // re-export native rust id conversion (function and enum)
export { IdType, convertId }; export { IdType, convertId };

View file

@ -2,8 +2,6 @@ process.env.NODE_ENV = "test";
import * as assert from "assert"; import * as assert from "assert";
import { inspect } from "node:util"; import { inspect } from "node:util";
import { DEFAULT_POLICIES } from "@/core/RoleService.js";
import type { Packed } from "@/misc/json-schema.js";
import { import {
signup, signup,
post, post,
@ -12,10 +10,9 @@ import {
startServer, startServer,
api, api,
successfulApiCall, successfulApiCall,
failedApiCall,
uploadFile, uploadFile,
} from "../utils.js"; } from "../utils.js";
import type * as firefish from "firefish-js"; import type { entities } from "firefish-js";
import type { INestApplicationContext } from "@nestjs/common"; import type { INestApplicationContext } from "@nestjs/common";
describe("ユーザー", () => { describe("ユーザー", () => {
@ -34,16 +31,16 @@ describe("ユーザー", () => {
}; };
// BUG misskey-jsとjson-schemaと実際に返ってくるデータが全部違う // BUG misskey-jsとjson-schemaと実際に返ってくるデータが全部違う
type UserLite = firefish.entities.UserLite & { type UserLite = entities.UserLite & {
badgeRoles: any[]; badgeRoles: any[];
}; };
type UserDetailedNotMe = UserLite & type UserDetailedNotMe = UserLite &
firefish.entities.UserDetailed & { entities.UserDetailed & {
roles: any[]; roles: any[];
}; };
type MeDetailed = UserDetailedNotMe & firefish.entities.MeDetailed; type MeDetailed = UserDetailedNotMe & entities.MeDetailed;
type User = MeDetailed & { token: string }; type User = MeDetailed & { token: string };
@ -183,12 +180,12 @@ describe("ユーザー", () => {
let root: User; let root: User;
let alice: User; let alice: User;
let aliceNote: firefish.entities.Note; let aliceNote: entities.Note;
let alicePage: firefish.entities.Page; let alicePage: entities.Page;
let aliceList: firefish.entities.UserList; let aliceList: entities.UserList;
let bob: User; let bob: User;
let bobNote: firefish.entities.Note; let bobNote: entities.Note;
let carol: User; let carol: User;
let dave: User; let dave: User;

View file

@ -5,7 +5,7 @@ import * as http from "node:http";
import * as path from "node:path"; import * as path from "node:path";
import { dirname } from "node:path"; import { dirname } from "node:path";
import { fileURLToPath } from "node:url"; import { fileURLToPath } from "node:url";
import * as firefish from "firefish-js"; import type { endpoints, Entities } from "firefish-js";
import FormData from "form-data"; import FormData from "form-data";
import got from "got"; import got from "got";
import fetch from "node-fetch"; import fetch from "node-fetch";
@ -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?: firefish.Endpoints["notes/create"]["req"], params?: Endpoints["notes/create"]["req"],
): Promise<firefish.entities.Note> => { ): Promise<entities.Note> => {
const q = Object.assign( const q = Object.assign(
{ {
text: "test", text: "test",

View file

@ -1,4 +1,4 @@
import type * as firefish from "firefish-js"; import type { entities } from "firefish-js";
import { defineAsyncComponent } from "vue"; import { defineAsyncComponent } from "vue";
import { i18n } from "./i18n"; import { i18n } from "./i18n";
import { apiUrl } from "@/config"; import { apiUrl } from "@/config";
@ -10,7 +10,7 @@ import { reloadChannel, unisonReload } from "@/scripts/unison-reload";
// TODO: 他のタブと永続化されたstateを同期 // TODO: 他のタブと永続化されたstateを同期
export type Account = firefish.entities.MeDetailed; export type Account = entities.MeDetailed;
export async function signout() { export async function signout() {
waiting(); waiting();
@ -149,8 +149,8 @@ export async function openAccountMenu(
opts: { opts: {
includeCurrentAccount?: boolean; includeCurrentAccount?: boolean;
withExtraOperation: boolean; withExtraOperation: boolean;
active?: firefish.entities.UserDetailed["id"]; active?: entities.UserDetailed["id"];
onChoose?: (account: firefish.entities.UserDetailed) => void; onChoose?: (account: entities.UserDetailed) => void;
}, },
ev: MouseEvent, ev: MouseEvent,
) { ) {
@ -182,7 +182,7 @@ export async function openAccountMenu(
); );
} }
async function switchAccount(account: firefish.entities.UserDetailed) { async function switchAccount(account: 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);
@ -199,7 +199,7 @@ export async function openAccountMenu(
userIds: storedAccounts.map((x) => x.id), userIds: storedAccounts.map((x) => x.id),
}); });
function createItem(account: firefish.entities.UserDetailed) { function createItem(account: 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 firefish from "firefish-js"; import type { entities } 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";
@ -50,7 +50,7 @@ import { i18n } from "@/i18n";
import icon from "@/scripts/icon"; import icon from "@/scripts/icon";
const props = defineProps<{ const props = defineProps<{
user: firefish.entities.User; user: entities.User;
initialComment?: string; initialComment?: string;
}>(); }>();

View file

@ -17,7 +17,7 @@
<span class="name"> <span class="name">
<MkUserName :key="user.id" :user="user" /> <MkUserName :key="user.id" :user="user" />
</span> </span>
<span class="username">@{{ acct(user) }}</span> <span class="username">@{{ acct.toString(user) }}</span>
</li> </li>
<li <li
tabindex="-1" tabindex="-1"
@ -95,7 +95,7 @@ import {
import contains from "@/scripts/contains"; import contains from "@/scripts/contains";
import { char2filePath } from "@/scripts/twemoji-base"; import { char2filePath } from "@/scripts/twemoji-base";
import { getStaticImageUrl } from "@/scripts/get-static-image-url"; import { getStaticImageUrl } from "@/scripts/get-static-image-url";
import { acct } from "@/filters/user"; import { acct } from "firefish-js";
import * as os from "@/os"; import * as os from "@/os";
import { MFM_TAGS } from "@/scripts/mfm-tags"; import { MFM_TAGS } from "@/scripts/mfm-tags";
import { defaultStore } from "@/store"; import { defaultStore } from "@/store";

View file

@ -10,7 +10,7 @@
:to=" :to="
message.groupId message.groupId
? `/my/messaging/group/${message.groupId}` ? `/my/messaging/group/${message.groupId}`
: `/my/messaging/${getAcct( : `/my/messaging/${acct.toString(
isMe(message) ? message.recipient : message.user, isMe(message) ? message.recipient : message.user,
)}` )}`
" "
@ -63,14 +63,11 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import * as Acct from "firefish-js/built/acct";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import { acct } from "@/filters/user"; import { acct } from "firefish-js";
import { $i } from "@/reactiveAccount"; import { $i } from "@/reactiveAccount";
const getAcct = Acct.toString; defineProps<{
const props = defineProps<{
message: Record<string, any>; message: Record<string, any>;
}>(); }>();

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 firefish from "firefish-js"; import type { entities } 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: firefish.entities.DriveFile): void; (ev: "ok", cropped: entities.DriveFile): void;
(ev: "cancel"): void; (ev: "cancel"): void;
(ev: "closed"): void; (ev: "closed"): void;
}>(); }>();
const props = defineProps<{ const props = defineProps<{
file: firefish.entities.DriveFile; file: 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<firefish.entities.DriveFile>(async (res) => { const promise = new Promise<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 firefish from "firefish-js"; import type { entities } 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: firefish.entities.Note; note: entities.Note;
}>(); }>();
const emit = defineEmits<{ const emit = defineEmits<{

View file

@ -203,7 +203,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, onBeforeUnmount, onMounted, ref, shallowRef } from "vue"; import { computed, onBeforeUnmount, onMounted, ref, shallowRef } from "vue";
import * as Acct from "firefish-js/built/acct"; import { acct } from "firefish-js";
import MkModal from "@/components/MkModal.vue"; import MkModal from "@/components/MkModal.vue";
import MkButton from "@/components/MkButton.vue"; import MkButton from "@/components/MkButton.vue";
import MkInput from "@/components/form/input.vue"; import MkInput from "@/components/form/input.vue";
@ -387,7 +387,7 @@ async function openSearchFilters(ev) {
action: () => { action: () => {
os.selectUser().then((user) => { os.selectUser().then((user) => {
inputValue.value = appendFilter( inputValue.value = appendFilter(
"from:@" + Acct.toString(user), "from:@" + acct.toString(user),
); );
}); });
}, },

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 firefish from "firefish-js"; import type { entities } 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";
@ -50,7 +50,7 @@ import icon from "@/scripts/icon";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
file: firefish.entities.DriveFile; file: entities.DriveFile;
isSelected?: boolean; isSelected?: boolean;
selectMode?: boolean; selectMode?: boolean;
}>(), }>(),
@ -61,7 +61,7 @@ const props = withDefaults(
); );
const emit = defineEmits<{ const emit = defineEmits<{
(ev: "chosen", r: firefish.entities.DriveFile): void; (ev: "chosen", r: entities.DriveFile): void;
(ev: "dragstart"): void; (ev: "dragstart"): void;
(ev: "dragend"): void; (ev: "dragend"): void;
}>(); }>();

View file

@ -38,7 +38,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, defineAsyncComponent, ref } from "vue"; import { computed, defineAsyncComponent, ref } from "vue";
import type * as firefish from "firefish-js"; import type { entities } 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";
@ -46,7 +46,7 @@ import icon from "@/scripts/icon";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
folder: firefish.entities.DriveFolder; folder: entities.DriveFolder;
isSelected?: boolean; isSelected?: boolean;
selectMode?: boolean; selectMode?: boolean;
}>(), }>(),
@ -57,11 +57,11 @@ const props = withDefaults(
); );
const emit = defineEmits<{ const emit = defineEmits<{
(ev: "chosen", v: firefish.entities.DriveFolder): void; (ev: "chosen", v: entities.DriveFolder): void;
(ev: "move", v: firefish.entities.DriveFolder): void; (ev: "move", v: entities.DriveFolder): void;
(ev: "upload", file: File, folder: firefish.entities.DriveFolder); (ev: "upload", file: File, folder: entities.DriveFolder);
(ev: "removeFile", v: firefish.entities.DriveFile["id"]): void; (ev: "removeFile", v: entities.DriveFile["id"]): void;
(ev: "removeFolder", v: firefish.entities.DriveFolder["id"]): void; (ev: "removeFolder", v: entities.DriveFolder["id"]): void;
(ev: "dragstart"): void; (ev: "dragstart"): void;
(ev: "dragend"): void; (ev: "dragend"): void;
}>(); }>();

View file

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

View file

@ -145,7 +145,7 @@ import {
ref, ref,
watch, watch,
} from "vue"; } from "vue";
import type * as firefish from "firefish-js"; import type { entities } 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";
@ -159,7 +159,7 @@ import icon from "@/scripts/icon";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
initialFolder?: firefish.entities.DriveFolder; initialFolder?: entities.DriveFolder;
type?: string; type?: string;
multiple?: boolean; multiple?: boolean;
select?: "file" | "folder" | null; select?: "file" | "folder" | null;
@ -173,30 +173,27 @@ const props = withDefaults(
); );
const emit = defineEmits<{ const emit = defineEmits<{
( (ev: "selected", v: entities.DriveFile | entities.DriveFolder): void;
ev: "selected",
v: firefish.entities.DriveFile | firefish.entities.DriveFolder,
): void;
( (
ev: "change-selection", ev: "change-selection",
v: firefish.entities.DriveFile[] | firefish.entities.DriveFolder[], v: entities.DriveFile[] | entities.DriveFolder[],
): void; ): void;
(ev: "move-root"): void; (ev: "move-root"): void;
(ev: "cd", v: firefish.entities.DriveFolder | null): void; (ev: "cd", v: entities.DriveFolder | null): void;
(ev: "open-folder", v: firefish.entities.DriveFolder): void; (ev: "open-folder", v: 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<firefish.entities.DriveFolder | null>(null); const folder = ref<entities.DriveFolder | null>(null);
const files = ref<firefish.entities.DriveFile[]>([]); const files = ref<entities.DriveFile[]>([]);
const folders = ref<firefish.entities.DriveFolder[]>([]); const folders = ref<entities.DriveFolder[]>([]);
const moreFiles = ref(false); const moreFiles = ref(false);
const moreFolders = ref(false); const moreFolders = ref(false);
const hierarchyFolders = ref<firefish.entities.DriveFolder[]>([]); const hierarchyFolders = ref<entities.DriveFolder[]>([]);
const selectedFiles = ref<firefish.entities.DriveFile[]>([]); const selectedFiles = ref<entities.DriveFile[]>([]);
const selectedFolders = ref<firefish.entities.DriveFolder[]>([]); const selectedFolders = ref<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使
@ -220,11 +217,11 @@ const ilFilesObserver = new IntersectionObserver(
watch(folder, () => emit("cd", folder.value)); watch(folder, () => emit("cd", folder.value));
function onStreamDriveFileCreated(file: firefish.entities.DriveFile) { function onStreamDriveFileCreated(file: entities.DriveFile) {
addFile(file, true); addFile(file, true);
} }
function onStreamDriveFileUpdated(file: firefish.entities.DriveFile) { function onStreamDriveFileUpdated(file: 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);
@ -237,15 +234,11 @@ function onStreamDriveFileDeleted(fileId: string) {
removeFile(fileId); removeFile(fileId);
} }
function onStreamDriveFolderCreated( function onStreamDriveFolderCreated(createdFolder: entities.DriveFolder) {
createdFolder: firefish.entities.DriveFolder,
) {
addFolder(createdFolder, true); addFolder(createdFolder, true);
} }
function onStreamDriveFolderUpdated( function onStreamDriveFolderUpdated(updatedFolder: 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) {
removeFolder(updatedFolder); removeFolder(updatedFolder);
@ -389,7 +382,7 @@ function createFolder() {
}); });
} }
function renameFolder(folderToRename: firefish.entities.DriveFolder) { function renameFolder(folderToRename: entities.DriveFolder) {
os.inputText({ os.inputText({
title: i18n.ts.renameFolder, title: i18n.ts.renameFolder,
placeholder: i18n.ts.inputNewFolderName, placeholder: i18n.ts.inputNewFolderName,
@ -406,7 +399,7 @@ function renameFolder(folderToRename: firefish.entities.DriveFolder) {
}); });
} }
function deleteFolder(folderToDelete: firefish.entities.DriveFolder) { function deleteFolder(folderToDelete: entities.DriveFolder) {
os.api("drive/folders/delete", { os.api("drive/folders/delete", {
folderId: folderToDelete.id, folderId: folderToDelete.id,
}) })
@ -439,10 +432,7 @@ function onChangeFileInput() {
} }
} }
function upload( function upload(file: File, folderToUpload?: entities.DriveFolder | null) {
file: File,
folderToUpload?: firefish.entities.DriveFolder | null,
) {
uploadFile( uploadFile(
file, file,
folderToUpload && typeof folderToUpload === "object" folderToUpload && typeof folderToUpload === "object"
@ -455,7 +445,7 @@ function upload(
}); });
} }
function chooseFile(file: firefish.entities.DriveFile) { function chooseFile(file: 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) {
@ -476,7 +466,7 @@ function chooseFile(file: firefish.entities.DriveFile) {
} }
} }
function chooseFolder(folderToChoose: firefish.entities.DriveFolder) { function chooseFolder(folderToChoose: entities.DriveFolder) {
const isAlreadySelected = selectedFolders.value.some( const isAlreadySelected = selectedFolders.value.some(
(f) => f.id === folderToChoose.id, (f) => f.id === folderToChoose.id,
); );
@ -499,7 +489,7 @@ function chooseFolder(folderToChoose: firefish.entities.DriveFolder) {
} }
} }
function move(target?: firefish.entities.DriveFolder) { function move(target?: entities.DriveFolder) {
if (!target) { if (!target) {
goRoot(); goRoot();
return; return;
@ -527,10 +517,7 @@ function move(target?: firefish.entities.DriveFolder) {
}); });
} }
function addFolder( function addFolder(folderToAdd: entities.DriveFolder, unshift = false) {
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;
@ -547,7 +534,7 @@ function addFolder(
} }
} }
function addFile(fileToAdd: firefish.entities.DriveFile, unshift = false) { function addFile(fileToAdd: 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;
@ -564,30 +551,30 @@ function addFile(fileToAdd: firefish.entities.DriveFile, unshift = false) {
} }
} }
function removeFolder(folderToRemove: firefish.entities.DriveFolder | string) { function removeFolder(folderToRemove: 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: firefish.entities.DriveFile | string) { function removeFile(file: 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: firefish.entities.DriveFile) { function appendFile(file: entities.DriveFile) {
addFile(file); addFile(file);
} }
function appendFolder(folderToAppend: firefish.entities.DriveFolder) { function appendFolder(folderToAppend: entities.DriveFolder) {
addFolder(folderToAppend); addFolder(folderToAppend);
} }
/* /*
function prependFile(file: firefish.entities.DriveFile) { function prependFile(file: entities.DriveFile) {
addFile(file, true); addFile(file, true);
} }
function prependFolder(folderToPrepend: firefish.entities.DriveFolder) { function prependFolder(folderToPrepend: entities.DriveFolder) {
addFolder(folderToPrepend, true); addFolder(folderToPrepend, true);
} }
*/ */
@ -717,9 +704,7 @@ function getMenu() {
text: i18n.ts.deleteFolder, text: i18n.ts.deleteFolder,
icon: `${icon("ph-trash")}`, icon: `${icon("ph-trash")}`,
action: () => { action: () => {
deleteFolder( deleteFolder(folder.value as entities.DriveFolder);
folder.value as firefish.entities.DriveFolder,
);
}, },
} }
: undefined, : undefined,

View file

@ -29,12 +29,12 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed } from "vue"; import { computed } from "vue";
import type * as firefish from "firefish-js"; import type { entities } from "firefish-js";
import ImgWithBlurhash from "@/components/MkImgWithBlurhash.vue"; import ImgWithBlurhash from "@/components/MkImgWithBlurhash.vue";
import icon from "@/scripts/icon"; import icon from "@/scripts/icon";
const props = defineProps<{ const props = defineProps<{
file: firefish.entities.DriveFile; file: 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 firefish from "firefish-js"; import type { entities } 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?: firefish.entities.DriveFile[]): void; (ev: "done", r?: entities.DriveFile[]): void;
(ev: "closed"): void; (ev: "closed"): void;
}>(); }>();
const dialog = ref<InstanceType<typeof XModalWindow>>(); const dialog = ref<InstanceType<typeof XModalWindow>>();
const selected = ref<firefish.entities.DriveFile[]>([]); const selected = ref<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: firefish.entities.DriveFile[]) { function onChangeSelection(files: entities.DriveFile[]) {
selected.value = files; selected.value = files;
} }
</script> </script>

View file

@ -14,14 +14,13 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import {} from "vue"; import type { entities } 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?: firefish.entities.DriveFolder; initialFolder?: 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 firefish from "firefish-js"; import type { entities } 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";
@ -242,7 +242,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<firefish.entities.CustomEmoji[]>([]); const searchResultCustom = ref<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");
@ -260,7 +260,7 @@ watch(q, () => {
const searchCustom = () => { const searchCustom = () => {
const max = 100; const max = 100;
const emojis = customEmojis; const emojis = customEmojis;
const matches = new Set<firefish.entities.CustomEmoji>(); const matches = new Set<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);
@ -421,7 +421,7 @@ function reset() {
} }
function getKey( function getKey(
emoji: string | firefish.entities.CustomEmoji | UnicodeEmojiDef, emoji: string | 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 firefish from "firefish-js"; import type { entities } from "firefish-js";
import * as os from "@/os"; import * as os from "@/os";
const meta = ref<firefish.entities.DetailedInstanceMetadata>(); const meta = ref<entities.DetailedInstanceMetadata>();
os.api("meta", { detail: true }).then((gotMeta) => { os.api("meta", { detail: true }).then((gotMeta) => {
meta.value = gotMeta; meta.value = gotMeta;

View file

@ -13,7 +13,7 @@
`${file.type}\n${bytes(file.size)}\n${new Date( `${file.type}\n${bytes(file.size)}\n${new Date(
file.createdAt, file.createdAt,
).toLocaleString()}\nby ${ ).toLocaleString()}\nby ${
file.user ? '@' + Acct.toString(file.user) : 'system' file.user ? '@' + acct.toString(file.user) : 'system'
}` }`
" "
:to="`/admin/file/${file.id}`" :to="`/admin/file/${file.id}`"
@ -52,13 +52,13 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import * as Acct from "firefish-js/built/acct"; import { acct } from "firefish-js";
import MkPagination from "@/components/MkPagination.vue"; import MkPagination from "@/components/MkPagination.vue";
import MkDriveFileThumbnail from "@/components/MkDriveFileThumbnail.vue"; import MkDriveFileThumbnail from "@/components/MkDriveFileThumbnail.vue";
import bytes from "@/filters/bytes"; import bytes from "@/filters/bytes";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
const props = defineProps<{ defineProps<{
pagination: any; pagination: any;
viewMode: "grid" | "list"; viewMode: "grid" | "list";
}>(); }>();

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 firefish from "firefish-js"; import type { entities } 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";
@ -77,7 +77,7 @@ const router = useRouter();
const emit = defineEmits(["refresh"]); const emit = defineEmits(["refresh"]);
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
user: firefish.entities.UserDetailed; user: entities.UserDetailed;
full?: boolean; full?: boolean;
large?: boolean; large?: boolean;
hideMenu?: boolean; hideMenu?: boolean;
@ -108,7 +108,7 @@ if (props.user.isFollowing == null) {
}).then(onFollowChange); }).then(onFollowChange);
} }
function onFollowChange(user: firefish.entities.UserDetailed) { function onFollowChange(user: 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 firefish from "firefish-js"; import type { entities } 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: firefish.entities.DriveFile; image: entities.DriveFile;
}>(), }>(),
{}, {},
); );

View file

@ -26,13 +26,13 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
import type * as firefish from "firefish-js"; import type { entities } 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 { getProxiedImageUrlNullable } from "@/scripts/media-proxy"; import { getProxiedImageUrlNullable } from "@/scripts/media-proxy";
const props = defineProps<{ const props = defineProps<{
instance: firefish.entities.Instance; instance: entities.Instance;
}>(); }>();
const chartValues = ref<number[] | null>(null); const chartValues = ref<number[] | null>(null);

View file

@ -58,21 +58,21 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
import type { Instance } from "firefish-js/built/entities"; import type { entities } from "firefish-js";
import MkInput from "@/components/form/input.vue"; import MkInput from "@/components/form/input.vue";
import XModalWindow from "@/components/MkModalWindow.vue"; import XModalWindow from "@/components/MkModalWindow.vue";
import * as os from "@/os"; import * as os from "@/os";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
const emit = defineEmits<{ const emit = defineEmits<{
(ev: "ok", selected: Instance): void; (ev: "ok", selected: entities.Instance): void;
(ev: "cancel"): void; (ev: "cancel"): void;
(ev: "closed"): void; (ev: "closed"): void;
}>(); }>();
const hostname = ref(""); const hostname = ref("");
const instances: Instance[] = ref([]); const instances = ref<entities.Instance[]>([]);
const selected: Instance | null = ref(null); const selected = ref<entities.Instance | null>();
const dialogEl = ref<InstanceType<typeof XModalWindow>>(); const dialogEl = ref<InstanceType<typeof XModalWindow>>();
let searchOrderLatch = 0; let searchOrderLatch = 0;
@ -97,7 +97,7 @@ const search = () => {
id: x.id, id: x.id,
host: x.host, host: x.host,
iconUrl: x.iconUrl, iconUrl: x.iconUrl,
}) as Instance, }) as entities.Instance,
); );
}); });
}; };

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 firefish from "firefish-js"; import type { entities } 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";
@ -101,7 +101,7 @@ import * as os from "@/os";
import icon from "@/scripts/icon"; import icon from "@/scripts/icon";
const props = defineProps<{ const props = defineProps<{
media: firefish.entities.DriveFile; media: entities.DriveFile;
raw?: boolean; raw?: boolean;
}>(); }>();

View file

@ -58,7 +58,7 @@
<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 firefish from "firefish-js"; import type { entities } 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";
@ -66,7 +66,7 @@ import icon from "@/scripts/icon";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
media: firefish.entities.DriveFile; media: 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 firefish from "firefish-js"; import type { entities } 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: firefish.entities.DriveFile[]; mediaList: entities.DriveFile[];
raw?: boolean; raw?: boolean;
inDm?: boolean; inDm?: boolean;
}>(); }>();
@ -184,7 +184,7 @@ onMounted(() => {
} }
}); });
const previewable = (file: firefish.entities.DriveFile): boolean => { const previewable = (file: 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: firefish.entities.DriveFile): boolean => {
); );
}; };
const isModule = (file: firefish.entities.DriveFile): boolean => { const isModule = (file: entities.DriveFile): boolean => {
return ( return (
FILE_TYPE_TRACKER_MODULES.includes(file.type) || FILE_TYPE_TRACKER_MODULES.includes(file.type) ||
FILE_EXT_TRACKER_MODULES.some((ext) => { FILE_EXT_TRACKER_MODULES.some((ext) => {

View file

@ -107,7 +107,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { nextTick, onDeactivated, onMounted, ref, shallowRef } from "vue"; import { nextTick, onDeactivated, onMounted, ref, shallowRef } from "vue";
import type * as firefish from "firefish-js"; import type { entities } from "firefish-js";
import FormRange from "./form/range.vue"; import FormRange from "./form/range.vue";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import * as os from "@/os"; import * as os from "@/os";
@ -116,7 +116,7 @@ import { ChiptuneJsConfig, ChiptuneJsPlayer } from "@/scripts/chiptune2";
import icon from "@/scripts/icon"; import icon from "@/scripts/icon";
const props = defineProps<{ const props = defineProps<{
module: firefish.entities.DriveFile; module: entities.DriveFile;
}>(); }>();
interface ModRow { interface ModRow {

View file

@ -273,7 +273,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, inject, onMounted, ref } from "vue"; import { computed, inject, onMounted, ref } from "vue";
import type { Ref } from "vue"; import type { Ref } from "vue";
import type * as firefish from "firefish-js"; import type { entities } from "firefish-js";
import MkSubNoteContent from "./MkSubNoteContent.vue"; import MkSubNoteContent from "./MkSubNoteContent.vue";
import MkNoteSub from "@/components/MkNoteSub.vue"; import MkNoteSub from "@/components/MkNoteSub.vue";
import XNoteHeader from "@/components/MkNoteHeader.vue"; import XNoteHeader from "@/components/MkNoteHeader.vue";
@ -306,7 +306,7 @@ import icon from "@/scripts/icon";
const router = useRouter(); const router = useRouter();
const props = defineProps<{ const props = defineProps<{
note: firefish.entities.Note; note: entities.Note;
pinned?: boolean; pinned?: boolean;
detailedView?: boolean; detailedView?: boolean;
collapsedReply?: boolean; collapsedReply?: boolean;
@ -351,7 +351,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 firefish.entities.Note) : note.value, isRenote ? (note.value.renote as entities.Note) : note.value,
); );
const isMyRenote = isSignedIn && $i.id === note.value.userId; const isMyRenote = isSignedIn && $i.id === note.value.userId;
const showContent = ref(false); const showContent = ref(false);
@ -466,7 +466,7 @@ function undoReact(note): void {
}); });
} }
const currentClipPage = inject<Ref<firefish.entities.Clip> | null>( const currentClipPage = inject<Ref<entities.Clip> | null>(
"currentClipPage", "currentClipPage",
null, null,
); );

View file

@ -168,8 +168,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 firefish from "firefish-js"; import type { entities, StreamTypes } from "firefish-js";
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";
import MkNoteSub from "@/components/MkNoteSub.vue"; import MkNoteSub from "@/components/MkNoteSub.vue";
@ -191,7 +190,7 @@ import { stream } from "@/stream";
// import icon from "@/scripts/icon"; // import icon from "@/scripts/icon";
const props = defineProps<{ const props = defineProps<{
note: firefish.entities.Note; note: entities.Note;
pinned?: boolean; pinned?: boolean;
}>(); }>();
@ -242,10 +241,10 @@ const muted = ref(
); );
const translation = ref(null); const translation = ref(null);
const translating = ref(false); const translating = ref(false);
const conversation = ref<null | firefish.entities.Note[]>([]); const conversation = ref<null | entities.Note[]>([]);
const replies = ref<firefish.entities.Note[]>([]); const replies = ref<entities.Note[]>([]);
const directReplies = ref<null | firefish.entities.Note[]>([]); const directReplies = ref<null | entities.Note[]>([]);
const directQuotes = ref<null | firefish.entities.Note[]>([]); const directQuotes = ref<null | entities.Note[]>([]);
const clips = ref(); const clips = ref();
const renotes = ref(); const renotes = ref();
let isScrolling; let isScrolling;
@ -415,7 +414,9 @@ function loadTab() {
} }
} }
async function onNoteUpdated(noteData: NoteUpdatedEvent): Promise<void> { async function onNoteUpdated(
noteData: StreamTypes.NoteUpdatedEvent,
): Promise<void> {
const { type, id, body } = noteData; const { type, id, body } = noteData;
let found = -1; let found = -1;

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 firefish from "firefish-js"; import type { entities } 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";
@ -61,7 +61,7 @@ import { pageWindow } from "@/os";
import icon from "@/scripts/icon"; import icon from "@/scripts/icon";
const props = defineProps<{ const props = defineProps<{
note: firefish.entities.Note; note: 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 firefish from "firefish-js"; import type { entities } 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";
defineProps<{ defineProps<{
note: firefish.entities.Note; note: 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 firefish from "firefish-js"; import type { entities } 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";
import XReactionsViewer from "@/components/MkReactionsViewer.vue"; import XReactionsViewer from "@/components/MkReactionsViewer.vue";
@ -221,8 +221,8 @@ const router = useRouter();
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
note: firefish.entities.Note; note: entities.Note;
conversation?: firefish.entities.Note[]; conversation?: 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 firefish.entities.Note) : note.value, isRenote ? (note.value.renote as 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: firefish.entities.Note[] = const replies: entities.Note[] =
props.conversation props.conversation
?.filter( ?.filter(
(item) => (item) =>
@ -369,7 +369,7 @@ function undoReact(note): void {
}); });
} }
const currentClipPage = inject<Ref<firefish.entities.Clip> | null>( const currentClipPage = inject<Ref<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 firefish from "firefish-js"; import type { entities } 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";
@ -291,7 +291,7 @@ import icon from "@/scripts/icon";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
notification: firefish.entities.Notification; notification: entities.Notification;
withTime?: boolean; withTime?: boolean;
full?: boolean; full?: boolean;
}>(), }>(),

View file

@ -69,7 +69,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 firefish from "firefish-js"; import type { Endpoints } from "firefish-js";
import * as os from "@/os"; import * as os from "@/os";
import { import {
getScrollContainer, getScrollContainer,
@ -81,14 +81,10 @@ import MkButton from "@/components/MkButton.vue";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import { defaultStore } from "@/store"; import { defaultStore } from "@/store";
export interface Paging< export interface Paging<E extends keyof Endpoints = keyof Endpoints> {
E extends keyof firefish.Endpoints = keyof firefish.Endpoints,
> {
endpoint: E; endpoint: E;
limit: number; limit: number;
params?: params?: Endpoints[E]["req"] | ComputedRef<Endpoints[E]["req"]>;
| firefish.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 firefish from "firefish-js"; import type { entities } 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";
@ -62,7 +62,7 @@ import { useInterval } from "@/scripts/use-interval";
import icon from "@/scripts/icon"; import icon from "@/scripts/icon";
const props = defineProps<{ const props = defineProps<{
note: firefish.entities.Note; note: entities.Note;
readOnly?: boolean; readOnly?: boolean;
}>(); }>();

View file

@ -260,12 +260,11 @@ import {
watch, watch,
} from "vue"; } from "vue";
import * as mfm from "mfm-js"; import * as mfm from "mfm-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";
import { toASCII } from "punycode/"; import { toASCII } from "punycode/";
import * as Acct from "firefish-js/built/acct"; import { acct, noteVisibilities, languages, type entities } from "firefish-js";
import { throttle } from "throttle-debounce"; import { throttle } from "throttle-debounce";
import XNoteSimple from "@/components/MkNoteSimple.vue"; import XNoteSimple from "@/components/MkNoteSimple.vue";
import XNotePreview from "@/components/MkNotePreview.vue"; import XNotePreview from "@/components/MkNotePreview.vue";
@ -299,23 +298,23 @@ const modal = inject("modal");
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
reply?: firefish.entities.Note; reply?: entities.Note;
renote?: firefish.entities.Note; renote?: entities.Note;
channel?: any; // TODO channel?: any; // TODO
mention?: firefish.entities.User; mention?: entities.User;
specified?: firefish.entities.User; specified?: entities.User;
initialText?: string; initialText?: string;
initialVisibility?: typeof firefish.noteVisibilities; initialVisibility?: typeof noteVisibilities;
initialLanguage?: typeof firefish.languages; initialLanguage?: typeof languages;
initialFiles?: firefish.entities.DriveFile[]; initialFiles?: entities.DriveFile[];
initialLocalOnly?: boolean; initialLocalOnly?: boolean;
initialVisibleUsers?: firefish.entities.User[]; initialVisibleUsers?: entities.User[];
initialNote?: firefish.entities.Note; initialNote?: entities.Note;
instant?: boolean; instant?: boolean;
fixed?: boolean; fixed?: boolean;
autofocus?: boolean; autofocus?: boolean;
showMfmCheatSheet?: boolean; showMfmCheatSheet?: boolean;
editId?: firefish.entities.Note["id"]; editId?: entities.Note["id"];
}>(), }>(),
{ {
initialVisibleUsers: () => [], initialVisibleUsers: () => [],
@ -358,7 +357,7 @@ const visibility = ref(
((defaultStore.state.rememberNoteVisibility ((defaultStore.state.rememberNoteVisibility
? defaultStore.state.visibility ? defaultStore.state.visibility
: defaultStore.state : defaultStore.state
.defaultNoteVisibility) as (typeof firefish.noteVisibilities)[number]), .defaultNoteVisibility) as (typeof noteVisibilities)[number]),
); );
const visibleUsers = ref([]); const visibleUsers = ref([]);
@ -1090,7 +1089,7 @@ function cancel() {
function insertMention() { function insertMention() {
os.selectUser().then((user) => { os.selectUser().then((user) => {
insertTextAtCursor(textareaEl.value, "@" + Acct.toString(user) + " "); insertTextAtCursor(textareaEl.value, "@" + acct.toString(user) + " ");
}); });
} }
@ -1123,7 +1122,7 @@ function showActions(ev) {
); );
} }
const postAccount = ref<firefish.entities.UserDetailed | null>(null); const postAccount = ref<entities.UserDetailed | null>(null);
function openAccountMenu(ev: MouseEvent) { function openAccountMenu(ev: MouseEvent) {
openAccountMenu_( openAccountMenu_(

View file

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

View file

@ -11,7 +11,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed } from "vue"; import { computed } from "vue";
import type { Note } from "firefish-js/built/entities"; import type { entities } from "firefish-js";
import { pleaseLogin } from "@/scripts/please-login"; import { pleaseLogin } from "@/scripts/please-login";
import * as os from "@/os"; import * as os from "@/os";
import { $i } from "@/reactiveAccount"; import { $i } from "@/reactiveAccount";
@ -20,7 +20,7 @@ import { defaultStore } from "@/store";
import icon from "@/scripts/icon"; import icon from "@/scripts/icon";
const props = defineProps<{ const props = defineProps<{
note: Note; note: entities.Note;
}>(); }>();
const canRenote = computed( const canRenote = computed(

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 firefish from "firefish-js"; import type { entities } 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: firefish.entities.Note["id"]; noteId: entities.Note["id"];
}>(); }>();
const note = ref<firefish.entities.Note>(); const note = ref<entities.Note>();
const tab = ref<string | null>(null); const tab = ref<string | null>(null);
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 firefish from "firefish-js"; import type { entitites } 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: firefish.entities.Note; note: 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 firefish from "firefish-js"; import type { entities } from "firefish-js";
import { $i, isSignedIn } from "@/reactiveAccount"; import { $i, isSignedIn } from "@/reactiveAccount";
import XReaction from "@/components/MkReactionsViewer.reaction.vue"; import XReaction from "@/components/MkReactionsViewer.reaction.vue";
const props = defineProps<{ const props = defineProps<{
note: firefish.entities.Note; note: 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 firefish from "firefish-js"; import type { entities } 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";
@ -36,7 +36,7 @@ import { vibrate } from "@/scripts/vibrate";
import icon from "@/scripts/icon"; import icon from "@/scripts/icon";
const props = defineProps<{ const props = defineProps<{
note: firefish.entities.Note; note: entities.Note;
count: number; count: number;
detailedView?; detailedView?;
}>(); }>();

View file

@ -42,7 +42,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import type { Note } from "firefish-js/built/entities"; import type { entities } from "firefish-js";
import Ripple from "@/components/MkRipple.vue"; import Ripple from "@/components/MkRipple.vue";
import { pleaseLogin } from "@/scripts/please-login"; import { pleaseLogin } from "@/scripts/please-login";
import * as os from "@/os"; import * as os from "@/os";
@ -52,7 +52,7 @@ import { instance } from "@/instance";
import icon from "@/scripts/icon"; import icon from "@/scripts/icon";
const props = defineProps<{ const props = defineProps<{
note: Note; note: entities.Note;
}>(); }>();
function star(ev?: MouseEvent): void { function star(ev?: MouseEvent): void {

View file

@ -39,7 +39,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
import type { Note } from "firefish-js/built/entities"; import type { entities } 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";
@ -50,7 +50,7 @@ import { useTooltip } from "@/scripts/use-tooltip";
import icon from "@/scripts/icon"; import icon from "@/scripts/icon";
const props = defineProps<{ const props = defineProps<{
note: Note; note: entities.Note;
count: number; count: number;
reacted: boolean; reacted: boolean;
}>(); }>();

View file

@ -179,7 +179,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
import type * as firefish from "firefish-js"; import type { entities } 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";
@ -197,7 +197,7 @@ import { defaultStore } from "@/store";
import icon from "@/scripts/icon"; import icon from "@/scripts/icon";
const props = defineProps<{ const props = defineProps<{
note: firefish.entities.Note; note: entities.Note;
parentId?; parentId?;
conversation?; conversation?;
detailed?: boolean; detailed?: boolean;

View file

@ -16,7 +16,9 @@
<div class="body"> <div class="body">
<span class="name"><MkUserName class="name" :user="user" /></span> <span class="name"><MkUserName class="name" :user="user" /></span>
<span class="sub" <span class="sub"
><span class="acct _monospace">@{{ acct(user) }}</span></span ><span class="acct _monospace"
>@{{ acct.toString(user) }}</span
></span
> >
</div> </div>
<MkMiniChart v-if="chartValues" class="chart" :src="chartValues" /> <MkMiniChart v-if="chartValues" class="chart" :src="chartValues" />
@ -26,14 +28,14 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
import type * as firefish from "firefish-js"; import { acct, type entities } 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 { userPage } from "@/filters/user";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
user: firefish.entities.User; user: entities.User;
withChart?: boolean; withChart?: boolean;
showAboutPage?: boolean; showAboutPage?: boolean;
}>(), }>(),

View file

@ -91,7 +91,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
import type * as firefish from "firefish-js"; import type { entities } 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";
@ -100,7 +100,7 @@ import { i18n } from "@/i18n";
import { $i, isSignedIn } from "@/reactiveAccount"; import { $i, isSignedIn } from "@/reactiveAccount";
const props = defineProps<{ const props = defineProps<{
user: firefish.entities.UserDetailed; user: 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 firefish from "firefish-js"; import type { entities } from "firefish-js";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
const props = defineProps<{ const props = defineProps<{
user: firefish.entities.User; user: entities.User;
}>(); }>();
const text = computed(() => { const text = computed(() => {

View file

@ -29,8 +29,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 { acct, type entities } 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";
import { defaultStore } from "@/store"; import { defaultStore } from "@/store";
@ -48,7 +47,7 @@ const emit = defineEmits<{
}>(); }>();
const zIndex = os.claimZIndex("middle"); const zIndex = os.claimZIndex("middle");
const user = ref<firefish.entities.UserDetailed | null>(null); const user = ref<entities.UserDetailed | null>(null);
const top = ref(0); const top = ref(0);
const left = ref(0); const left = ref(0);
@ -57,7 +56,7 @@ onMounted(() => {
user.value = props.q; user.value = props.q;
} else { } else {
const query = props.q.startsWith("@") const query = props.q.startsWith("@")
? Acct.parse(props.q.slice(1)) ? acct.parse(props.q.slice(1))
: { userId: props.q }; : { userId: props.q };
os.api("users/show", query).then((res) => { os.api("users/show", query).then((res) => {

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 firefish from "firefish-js"; import type { entities } 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: firefish.entities.UserDetailed): void; (ev: "ok", selected: 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: firefish.entities.UserDetailed[] = ref([]); const users: entities.UserDetailed[] = ref([]);
const recentUsers: firefish.entities.UserDetailed[] = ref([]); const recentUsers: entities.UserDetailed[] = ref([]);
const selected: firefish.entities.UserDetailed | null = ref(null); const selected: 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 firefish from "firefish-js"; import type { entities } 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: firefish.entities.UserDetailed): void; (ev: "ok", selected: entities.UserDetailed): void;
(ev: "cancel"): void; (ev: "cancel"): void;
(ev: "closed"): void; (ev: "closed"): void;
}>(); }>();
const username = ref(""); const username = ref("");
const users: firefish.entities.UserDetailed[] = ref([]); const users = ref([] as entities.UserDetailed[]);
const recentUsers: firefish.entities.UserDetailed[] = ref([]); const recentUsers = ref([] as entities.UserDetailed[]);
const selected: firefish.entities.UserDetailed | null = ref(null); const selected = ref<entities.UserDetailed | null>(null);
const dialogEl = ref(); const dialogEl = ref();
const search = () => { const search = () => {

View file

@ -125,7 +125,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 firefish from "firefish-js"; import type { noteVisibilities } from "firefish-js";
import MkModal from "@/components/MkModal.vue"; import MkModal from "@/components/MkModal.vue";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import icon from "@/scripts/icon"; import icon from "@/scripts/icon";
@ -134,7 +134,7 @@ const modal = shallowRef<InstanceType<typeof MkModal>>();
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
currentVisibility: (typeof firefish.noteVisibilities)[number]; currentVisibility: (typeof noteVisibilities)[number];
currentLocalOnly: boolean; currentLocalOnly: boolean;
src?: HTMLElement; src?: HTMLElement;
}>(), }>(),
@ -142,10 +142,7 @@ const props = withDefaults(
); );
const emit = defineEmits<{ const emit = defineEmits<{
( (ev: "changeVisibility", v: (typeof noteVisibilities)[number]): void;
ev: "changeVisibility",
v: (typeof firefish.noteVisibilities)[number],
): void;
(ev: "changeLocalOnly", v: boolean): void; (ev: "changeLocalOnly", v: boolean): void;
(ev: "closed"): void; (ev: "closed"): void;
}>(); }>();
@ -157,7 +154,7 @@ watch(localOnly, () => {
emit("changeLocalOnly", localOnly.value); emit("changeLocalOnly", localOnly.value);
}); });
function choose(visibility: (typeof firefish.noteVisibilities)[number]): void { function choose(visibility: (typeof noteVisibilities)[number]): void {
v.value = visibility; v.value = visibility;
emit("changeVisibility", visibility); emit("changeVisibility", visibility);
nextTick(() => { nextTick(() => {

View file

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

View file

@ -8,7 +8,7 @@
square: defaultStore.state.squareAvatars, square: defaultStore.state.squareAvatars,
}" }"
:style="{ color }" :style="{ color }"
:title="acct(user)" :title="acct.toString(user)"
@click="onClick" @click="onClick"
> >
<img class="inner" :src="url" decoding="async" /> <img class="inner" :src="url" decoding="async" />
@ -27,7 +27,7 @@
square: defaultStore.state.squareAvatars, square: defaultStore.state.squareAvatars,
}" }"
:style="{ color }" :style="{ color }"
:title="acct(user)" :title="acct.toString(user)"
ref="gallery" ref="gallery"
@click.stop @click.stop
> >
@ -48,7 +48,7 @@
}" }"
:style="{ color }" :style="{ color }"
:to="userPage(user)" :to="userPage(user)"
:title="acct(user)" :title="acct.toString(user)"
:target="target" :target="target"
@click.stop @click.stop
> >
@ -63,10 +63,10 @@
<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 firefish from "firefish-js"; import { acct, type entities } 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 { userPage } from "@/filters/user";
import MkUserOnlineIndicator from "@/components/MkUserOnlineIndicator.vue"; import MkUserOnlineIndicator from "@/components/MkUserOnlineIndicator.vue";
import { defaultStore } from "@/store"; import { defaultStore } from "@/store";
import PhotoSwipeLightbox from "photoswipe/lightbox"; import PhotoSwipeLightbox from "photoswipe/lightbox";
@ -75,7 +75,7 @@ import "photoswipe/style.css";
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
user: firefish.entities.User; user: entities.User;
target?: string | null; target?: string | null;
disableLink?: boolean; disableLink?: boolean;
showLightBox?: boolean; showLightBox?: boolean;

View file

@ -22,7 +22,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed } from "vue"; import { computed } from "vue";
import type { CustomEmoji } from "firefish-js/built/entities"; import type { entities } from "firefish-js";
import { getStaticImageUrl } from "@/scripts/get-static-image-url"; import { getStaticImageUrl } from "@/scripts/get-static-image-url";
import { char2filePath } from "@/scripts/twemoji-base"; import { char2filePath } from "@/scripts/twemoji-base";
import { defaultStore } from "@/store"; import { defaultStore } from "@/store";
@ -32,7 +32,7 @@ const props = defineProps<{
emoji: string; emoji: string;
normal?: boolean; normal?: boolean;
noStyle?: boolean; noStyle?: boolean;
customEmojis?: CustomEmoji[]; customEmojis?: entities.CustomEmoji[];
isReaction?: boolean; isReaction?: boolean;
}>(); }>();

View file

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

View file

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

View file

@ -1,4 +1,4 @@
import type * as firefish from "firefish-js"; import type { entities } from "firefish-js";
import { computed, reactive } from "vue"; import { computed, reactive } from "vue";
import { api } from "./os"; import { api } from "./os";
@ -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: firefish.entities.DetailedInstanceMetadata = reactive( export const instance: entities.DetailedInstanceMetadata = reactive(
instanceData instanceData
? JSON.parse(instanceData) ? JSON.parse(instanceData)
: { : {

View file

@ -1,7 +1,7 @@
// TODO: なんでもかんでもos.tsに突っ込むのやめたいのでよしなに分割する // TODO: なんでもかんでもos.tsに突っ込むのやめたいのでよしなに分割する
import { EventEmitter } from "eventemitter3"; import { EventEmitter } from "eventemitter3";
import * as firefish from "firefish-js"; import { api as firefishApi, type entities } from "firefish-js";
import insertTextAtCursor from "insert-text-at-cursor"; import insertTextAtCursor from "insert-text-at-cursor";
import type { Component, Ref } from "vue"; import type { Component, Ref } from "vue";
import { defineAsyncComponent, markRaw, ref } from "vue"; import { defineAsyncComponent, markRaw, ref } from "vue";
@ -16,7 +16,7 @@ import type { MenuItem } from "@/types/menu";
export const pendingApiRequestsCount = ref(0); export const pendingApiRequestsCount = ref(0);
const apiClient = new firefish.api.APIClient({ const apiClient = new firefishApi.APIClient({
origin: url, origin: url,
}); });
@ -655,7 +655,7 @@ export async function selectLocalUser() {
}); });
} }
export async function selectInstance(): Promise<firefish.entities.Instance> { export async function selectInstance(): Promise<entities.Instance> {
return new Promise((resolve, reject) => { return new Promise((resolve, reject) => {
popup( popup(
defineAsyncComponent({ defineAsyncComponent({
@ -745,11 +745,11 @@ export async function pickEmoji(src: HTMLElement | null, opts) {
} }
export async function cropImage( export async function cropImage(
image: firefish.entities.DriveFile, image: entities.DriveFile,
options: { options: {
aspectRatio: number; aspectRatio: number;
}, },
): Promise<firefish.entities.DriveFile> { ): Promise<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 firefish from "firefish-js"; import type { entities } 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";
@ -56,7 +56,7 @@ withDefaults(
const loaded = ref(false); const loaded = ref(false);
const serverIsDead = ref(false); const serverIsDead = ref(false);
const meta = ref<firefish.entities.LiteInstanceMetadata | null>(null); const meta = ref<entities.LiteInstanceMetadata | null>(null);
os.api("meta", { os.api("meta", {
detail: false, detail: false,

View file

@ -9,7 +9,9 @@
<div class="body"> <div class="body">
<span class="name"><MkUserName class="name" :user="user" /></span> <span class="name"><MkUserName class="name" :user="user" /></span>
<span class="sub" <span class="sub"
><span class="acct _monospace">@{{ acct(user) }}</span></span ><span class="acct _monospace"
>@{{ acct.toString(user) }}</span
></span
> >
</div> </div>
<MkMiniChart v-if="chart" class="chart" :src="chart.inc" /> <MkMiniChart v-if="chart" class="chart" :src="chart.inc" />
@ -19,13 +21,12 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
import type * as firefish from "firefish-js"; import { acct, type entities } 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";
const props = defineProps<{ const props = defineProps<{
user: firefish.entities.User; user: 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 firefish from "firefish-js"; import type { entities } from "firefish-js";
import XNotes from "@/components/MkNotes.vue"; import XNotes from "@/components/MkNotes.vue";
import { $i, isSignedIn } from "@/reactiveAccount"; import { $i, isSignedIn } from "@/reactiveAccount";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
@ -41,7 +41,7 @@ const props = defineProps<{
clipId: string; clipId: string;
}>(); }>();
const clip = ref<firefish.entities.Clip>(); const clip = ref<entities.Clip>();
const pagination = { const pagination = {
endpoint: "clips/notes" as const, endpoint: "clips/notes" as const,
limit: 10, limit: 10,

View file

@ -38,7 +38,7 @@
><MkUserName :user="req.follower" ><MkUserName :user="req.follower"
/></MkA> /></MkA>
<p class="acct"> <p class="acct">
@{{ acct(req.follower) }} @{{ acct.toString(req.follower) }}
</p> </p>
</div> </div>
<div <div
@ -84,7 +84,8 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, ref } from "vue"; import { computed, ref } from "vue";
import MkPagination from "@/components/MkPagination.vue"; import MkPagination from "@/components/MkPagination.vue";
import { acct, userPage } from "@/filters/user"; import { acct } from "firefish-js";
import { userPage } from "@/filters/user";
import * as os from "@/os"; import * as os from "@/os";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import { definePageMetadata } from "@/scripts/page-metadata"; import { definePageMetadata } from "@/scripts/page-metadata";

View file

@ -3,7 +3,7 @@
</template> </template>
<script lang="ts" setup> <script lang="ts" setup>
import * as Acct from "firefish-js/built/acct"; import { acct } from "firefish-js";
import * as os from "@/os"; import * as os from "@/os";
import { mainRouter } from "@/router"; import { mainRouter } from "@/router";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
@ -50,7 +50,7 @@ if (acct.startsWith("https://")) {
} }
}); });
} else { } else {
promise = os.api("users/show", Acct.parse(acct)); promise = os.api("users/show", acct.parse(acct));
promise.then((user) => { promise.then((user) => {
follow(user); follow(user);
}); });

View file

@ -338,7 +338,7 @@
import { computed, ref, watch } from "vue"; import { computed, ref, watch } from "vue";
import { Virtual } from "swiper/modules"; import { Virtual } from "swiper/modules";
import { Swiper, SwiperSlide } from "swiper/vue"; import { Swiper, SwiperSlide } from "swiper/vue";
import type * as firefish from "firefish-js"; import type { entities } 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 FormLink from "@/components/form/link.vue"; import FormLink from "@/components/form/link.vue";
@ -361,11 +361,11 @@ import icon from "@/scripts/icon";
import "swiper/scss"; import "swiper/scss";
import "swiper/scss/virtual"; import "swiper/scss/virtual";
type AugmentedInstanceMetadata = firefish.entities.DetailedInstanceMetadata & { type AugmentedInstanceMetadata = entities.DetailedInstanceMetadata & {
blockedHosts: string[]; blockedHosts: string[];
silencedHosts: string[]; silencedHosts: string[];
}; };
type AugmentedInstance = firefish.entities.Instance & { type AugmentedInstance = entities.Instance & {
isBlocked: boolean; isBlocked: boolean;
isSilenced: boolean; isSilenced: boolean;
}; };

View file

@ -89,7 +89,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { computed, markRaw, onMounted, onUnmounted, ref, watch } from "vue"; import { computed, markRaw, onMounted, onUnmounted, ref, watch } from "vue";
import * as Acct from "firefish-js/built/acct"; import { acct } from "firefish-js";
import { Virtual } from "swiper/modules"; import { Virtual } from "swiper/modules";
import { Swiper, SwiperSlide } from "swiper/vue"; import { Swiper, SwiperSlide } from "swiper/vue";
import MkButton from "@/components/MkButton.vue"; import MkButton from "@/components/MkButton.vue";
@ -206,7 +206,7 @@ function onRead(ids): void {
async function startUser(): void { async function startUser(): void {
os.selectUser().then((user) => { os.selectUser().then((user) => {
router.push(`/my/messaging/${Acct.toString(user)}`); router.push(`/my/messaging/${acct.toString(user)}`);
}); });
} }

View file

@ -52,7 +52,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 firefish from "firefish-js"; import type { entities } 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";
@ -67,15 +67,15 @@ import { uploadFile } from "@/scripts/upload";
import icon from "@/scripts/icon"; import icon from "@/scripts/icon";
const props = defineProps<{ const props = defineProps<{
user?: firefish.entities.UserDetailed | null; user?: entities.UserDetailed | null;
group?: firefish.entities.UserGroup | null; group?: 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<firefish.entities.DriveFile | null>(null); const file = ref<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 firefish from "firefish-js"; import type { entities } 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";
@ -95,7 +95,7 @@ import { i18n } from "@/i18n";
import icon from "@/scripts/icon"; import icon from "@/scripts/icon";
const props = defineProps<{ const props = defineProps<{
message: firefish.entities.MessagingMessage; message: entities.MessagingMessage;
isGroup?: boolean; isGroup?: boolean;
}>(); }>();

View file

@ -105,8 +105,8 @@ import {
ref, ref,
watch, watch,
} from "vue"; } from "vue";
import type * as firefish from "firefish-js"; import type { entities, Channels, ChannelConnection } from "firefish-js";
import * as Acct from "firefish-js/built/acct"; import { acct } from "firefish-js";
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";
import XList from "@/components/MkDateSeparatedList.vue"; import XList from "@/components/MkDateSeparatedList.vue";
@ -137,12 +137,10 @@ 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<firefish.entities.UserDetailed | null>(null); const user = ref<entities.UserDetailed | null>(null);
const group = ref<firefish.entities.UserGroup | null>(null); const group = ref<entities.UserGroup | null>(null);
const typers = ref<firefish.entities.User[]>([]); const typers = ref<entities.User[]>([]);
const connection: firefish.ChannelConnection< const connection: ChannelConnection<Channels["messaging"]> | null = ref(null);
firefish.Channels["messaging"]
> | null = ref(null);
const showIndicator = ref(false); const showIndicator = ref(false);
const { animation } = defaultStore.reactiveState; const { animation } = defaultStore.reactiveState;
@ -157,10 +155,10 @@ async function fetch() {
fetching.value = true; fetching.value = true;
if (props.userAcct) { if (props.userAcct) {
const acct = Acct.parse(props.userAcct); const account = acct.parse(props.userAcct);
user.value = await os.api("users/show", { user.value = await os.api("users/show", {
username: acct.username, username: account.username,
host: acct.host || undefined, host: account.host || undefined,
}); });
group.value = null; group.value = null;

View file

@ -115,7 +115,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref, watch } from "vue"; import { ref, watch } from "vue";
import * as Acct from "firefish-js/built/acct"; import { acct } from "firefish-js";
import MkButton from "@/components/MkButton.vue"; import MkButton from "@/components/MkButton.vue";
import MkInput from "@/components/form/input.vue"; import MkInput from "@/components/form/input.vue";
import MkTextarea from "@/components/form/textarea.vue"; import MkTextarea from "@/components/form/textarea.vue";
@ -226,7 +226,7 @@ async function deleteAntenna() {
function addUser() { function addUser() {
os.selectUser().then((user) => { os.selectUser().then((user) => {
users.value = users.value.trim(); users.value = users.value.trim();
users.value += `\n@${Acct.toString(user as any)}`; users.value += `\n@${acct.toString(user as any)}`;
users.value = users.value.trim(); users.value = users.value.trim();
}); });
} }

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 firefish from "firefish-js"; import type { entities } 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";
@ -85,14 +85,14 @@ const props = defineProps<{
noteId: string; noteId: string;
}>(); }>();
const note = ref<null | firefish.entities.Note>(); const note = ref<null | 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 | firefish.entities.Note>(); const appearNote = ref<null | entities.Note>();
const prevPagination = { const prevPagination = {
endpoint: "users/notes" as const, endpoint: "users/notes" as const,
@ -138,7 +138,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 firefish.entities.Note) ? (note.value.renote as entities.Note)
: note.value; : note.value;
Promise.all([ Promise.all([

View file

@ -52,7 +52,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
import { toString } from "firefish-js/built/acct"; import { acct } from "firefish-js";
import FormSection from "@/components/form/section.vue"; import FormSection from "@/components/form/section.vue";
import FormInput from "@/components/form/input.vue"; import FormInput from "@/components/form/input.vue";
import FormButton from "@/components/MkButton.vue"; import FormButton from "@/components/MkButton.vue";
@ -73,7 +73,7 @@ async function init() {
const aka = await os.api("users/show", { userIds: $i.alsoKnownAs }); const aka = await os.api("users/show", { userIds: $i.alsoKnownAs });
accountAlias.value = accountAlias.value =
aka && aka.length > 0 aka && aka.length > 0
? aka.map((user) => `@${toString(user)}`) ? aka.map((user) => `@${acct.toString(user)}`)
: [""]; : [""];
} else { } else {
accountAlias.value = [""]; accountAlias.value = [""];

View file

@ -33,9 +33,7 @@
import { computed, ref } from "vue"; 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 { acct, noteVisibilities, type entities } from "firefish-js";
import * as Acct from "firefish-js/built/acct";
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";
@ -53,16 +51,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 firefish.entities.Note | null); const reply = ref(null as entities.Note | null);
const renote = ref(null as firefish.entities.Note | null); const renote = ref(null as 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 firefish.entities.DriveFile[]); const files = ref([] as entities.DriveFile[]);
const visibleUsers = ref([] as firefish.entities.User[]); const visibleUsers = ref([] as entities.User[]);
async function init() { async function init() {
let noteText = ""; let noteText = "";
@ -83,7 +81,7 @@ async function init() {
? visibleUserIds.split(",").map((userId) => ({ userId })) ? visibleUserIds.split(",").map((userId) => ({ userId }))
: []), : []),
...(visibleAccts ...(visibleAccts
? visibleAccts.split(",").map(Acct.parse) ? visibleAccts.split(",").map(acct.parse)
: []), : []),
] ]
// TypeScript // TypeScript

View file

@ -21,7 +21,7 @@
/></span> /></span>
<span class="sub" <span class="sub"
><span class="acct _monospace" ><span class="acct _monospace"
>@{{ acct(user) }}</span >@{{ acct.toString(user) }}</span
></span ></span
> >
<span class="state"> <span class="state">
@ -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 firefish from "firefish-js"; import { acct, type entities } 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";
@ -374,7 +374,7 @@ import MkFileListForAdmin from "@/components/MkFileListForAdmin.vue";
import MkInfo from "@/components/MkInfo.vue"; import MkInfo from "@/components/MkInfo.vue";
import * as os from "@/os"; import * as os from "@/os";
import { url } from "@/config"; import { url } from "@/config";
import { acct, userPage } from "@/filters/user"; import { userPage } from "@/filters/user";
import { definePageMetadata } from "@/scripts/page-metadata"; import { definePageMetadata } from "@/scripts/page-metadata";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import { isAdmin, isModerator } from "@/reactiveAccount"; import { isAdmin, isModerator } from "@/reactiveAccount";
@ -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 | firefish.entities.UserDetailed>(); const user = ref<null | 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);
@ -661,7 +661,7 @@ const headerTabs = computed(() =>
definePageMetadata( definePageMetadata(
computed(() => ({ computed(() => ({
title: user.value ? acct(user.value) : i18n.ts.userInfo, title: user.value ? acct.toString(user.value) : i18n.ts.userInfo,
icon: `${icon("ph-info")}`, icon: `${icon("ph-info")}`,
})), })),
); );

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 firefish from "firefish-js"; import type { entities } from "firefish-js";
import MkPagination from "@/components/MkPagination.vue"; import MkPagination from "@/components/MkPagination.vue";
const props = defineProps<{ const props = defineProps<{
user: firefish.entities.User; user: 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 firefish from "firefish-js"; import type { entities } 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: firefish.entities.User; user: entities.User;
type: "following" | "followers"; type: "following" | "followers";
}>(); }>();

View file

@ -17,8 +17,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 { acct, type entities } 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";
@ -32,13 +31,13 @@ const props = withDefaults(
{}, {},
); );
const user = ref<null | firefish.entities.UserDetailed>(null); const user = ref<null | entities.UserDetailed>(null);
const error = ref(null); const error = ref(null);
function fetchUser(): void { function fetchUser(): void {
if (props.acct == null) return; if (props.acct == null) return;
user.value = null; user.value = null;
os.api("users/show", Acct.parse(props.acct)) os.api("users/show", acct.parse(props.acct))
.then((u) => { .then((u) => {
user.value = u; user.value = u;
}) })

View file

@ -17,8 +17,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 { acct, type entities } 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";
@ -32,13 +31,13 @@ const props = withDefaults(
{}, {},
); );
const user = ref<null | firefish.entities.UserDetailed>(null); const user = ref<null | entities.UserDetailed>(null);
const error = ref(null); const error = ref(null);
function fetchUser(): void { function fetchUser(): void {
if (props.acct == null) return; if (props.acct == null) return;
user.value = null; user.value = null;
os.api("users/show", Acct.parse(props.acct)) os.api("users/show", acct.parse(props.acct))
.then((u) => { .then((u) => {
user.value = u; user.value = u;
}) })

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 firefish from "firefish-js"; import type { entities } 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: firefish.entities.User; user: entities.User;
}>(), }>(),
{}, {},
); );

View file

@ -380,7 +380,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 firefish from "firefish-js"; import type { entities } 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";
@ -406,7 +406,7 @@ const hideFollowButton = defaultStore.state.hideFollowButtons;
const emit = defineEmits(["refresh"]); const emit = defineEmits(["refresh"]);
const props = withDefaults( const props = withDefaults(
defineProps<{ defineProps<{
user: firefish.entities.UserDetailed; user: entities.UserDetailed;
}>(), }>(),
{}, {},
); );

View file

@ -28,7 +28,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import { ref } from "vue"; import { ref } from "vue";
import type * as firefish from "firefish-js"; import type { entities } 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";
@ -37,7 +37,7 @@ import icon from "@/scripts/icon";
withDefaults( withDefaults(
defineProps<{ defineProps<{
user: firefish.entities.User; user: 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 firefish from "firefish-js"; import type { entities } 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";
@ -40,18 +40,18 @@ import { i18n } from "@/i18n";
import icon from "@/scripts/icon"; import icon from "@/scripts/icon";
const props = defineProps<{ const props = defineProps<{
user: firefish.entities.UserDetailed; user: entities.UserDetailed;
}>(); }>();
const fetching = ref(true); const fetching = ref(true);
const images = ref< const images = ref<
{ {
note: firefish.entities.Note; note: entities.Note;
file: firefish.entities.DriveFile; file: entities.DriveFile;
}[] }[]
>([]); >([]);
function thumbnail(image: firefish.entities.DriveFile): string { function thumbnail(image: 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 firefish from "firefish-js"; import type { entities } 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: firefish.entities.UserDetailed; user: entities.UserDetailed;
}>(); }>();
const include = ref<string | null>(null); const include = ref<string | null>(null);

View file

@ -30,9 +30,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 { acct, type entities } from "firefish-js";
import type * as firefish from "firefish-js";
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";
import { definePageMetadata } from "@/scripts/page-metadata"; import { definePageMetadata } from "@/scripts/page-metadata";
@ -59,13 +57,13 @@ const props = withDefaults(
useRouter(); useRouter();
const tab = ref(props.page); const tab = ref(props.page);
const user = ref<null | firefish.entities.UserDetailed>(null); const user = ref<null | entities.UserDetailed>(null);
const error = ref(null); const error = ref(null);
function fetchUser(): void { function fetchUser(): void {
if (props.acct == null) return; if (props.acct == null) return;
user.value = null; user.value = null;
os.api("users/show", Acct.parse(props.acct)) os.api("users/show", acct.parse(props.acct))
.then((u) => { .then((u) => {
user.value = u; user.value = u;
}) })
@ -129,7 +127,7 @@ definePageMetadata(
title: user.value.name title: user.value.name
? `${user.value.name} (@${user.value.username})` ? `${user.value.name} (@${user.value.username})`
: `@${user.value.username}`, : `@${user.value.username}`,
subtitle: `@${getAcct(user.value)}`, subtitle: `@${acct.toString(user.value)}`,
userName: user.value, userName: user.value,
avatar: user.value, avatar: user.value,
path: `/@${user.value.username}`, path: `/@${user.value.username}`,

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 firefish from "firefish-js"; import type { entities } 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: firefish.entities.User; user: 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 firefish from "firefish-js"; import type { entities } 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: firefish.entities.User; user: entities.User;
}>(); }>();
const pagination = { const pagination = {

View file

@ -1,4 +1,4 @@
import type * as firefish from "firefish-js"; import type { entities } from "firefish-js";
export interface Muted { export interface Muted {
muted: boolean; muted: boolean;
@ -9,7 +9,7 @@ export interface Muted {
const NotMuted = { muted: false, matched: [] }; const NotMuted = { muted: false, matched: [] };
function checkLangMute( function checkLangMute(
note: firefish.entities.Note, note: entities.Note,
mutedLangs: Array<string | string[]>, mutedLangs: Array<string | string[]>,
): Muted { ): Muted {
const mutedLangList = new Set( const mutedLangList = new Set(
@ -22,7 +22,7 @@ function checkLangMute(
} }
function checkWordMute( function checkWordMute(
note: firefish.entities.Note, note: entities.Note,
mutedWords: Array<string | string[]>, mutedWords: Array<string | string[]>,
): Muted { ): Muted {
let text = `${note.cw ?? ""} ${note.text ?? ""}`; let text = `${note.cw ?? ""} ${note.text ?? ""}`;

View file

@ -1,4 +1,4 @@
import * as Acct from "firefish-js/built/acct"; import { acct } from "firefish-js";
import { host as localHost } from "@/config"; import { host as localHost } from "@/config";
export async function genSearchQuery(v: any, q: string) { export async function genSearchQuery(v: any, q: string) {
@ -16,7 +16,7 @@ export async function genSearchQuery(v: any, q: string) {
} }
} else { } else {
const user = await v.os const user = await v.os
.api("users/show", Acct.parse(at)) .api("users/show", acct.parse(at))
.catch((x) => null); .catch((x) => null);
if (user) { if (user) {
userId = user.id; userId = user.id;

View file

@ -1,6 +1,6 @@
import type { Ref } from "vue"; import type { Ref } from "vue";
import { defineAsyncComponent } from "vue"; import { defineAsyncComponent } from "vue";
import type * as firefish from "firefish-js"; import type { entities } from "firefish-js";
import { $i, isSignedIn, isModerator } from "@/reactiveAccount"; import { $i, isSignedIn, isModerator } from "@/reactiveAccount";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import { instance } from "@/instance"; import { instance } from "@/instance";
@ -13,12 +13,12 @@ import { getUserMenu } from "@/scripts/get-user-menu";
import icon from "@/scripts/icon"; import icon from "@/scripts/icon";
export function getNoteMenu(props: { export function getNoteMenu(props: {
note: firefish.entities.Note; note: 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<firefish.entities.Clip>; currentClipPage?: Ref<entities.Clip>;
}) { }) {
const isRenote = const isRenote =
props.note.renote != null && props.note.renote != null &&
@ -27,7 +27,7 @@ export function getNoteMenu(props: {
props.note.poll == null; props.note.poll == null;
const appearNote = isRenote const appearNote = isRenote
? (props.note.renote as firefish.entities.Note) ? (props.note.renote as entities.Note)
: props.note; : props.note;
function del(): void { function del(): void {

View file

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

View file

@ -1,4 +1,4 @@
import * as Acct from "firefish-js/built/acct"; import { acct } from "firefish-js";
import { defineAsyncComponent } from "vue"; import { defineAsyncComponent } from "vue";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import copyToClipboard from "@/scripts/copy-to-clipboard"; import copyToClipboard from "@/scripts/copy-to-clipboard";
@ -284,7 +284,7 @@ export function getUserMenu(user, router: Router = mainRouter) {
type: "link", type: "link",
icon: `${icon("ph-chats-teardrop")}`, icon: `${icon("ph-chats-teardrop")}`,
text: i18n.ts.startMessaging, text: i18n.ts.startMessaging,
to: `/my/messaging/${Acct.toString(user)}`, to: `/my/messaging/${acct.toString(user)}`,
} }
: undefined, : undefined,
user.host != null && user.url user.host != null && user.url

View file

@ -1,4 +1,4 @@
import * as Acct from "firefish-js/built/acct"; import { acct } from "firefish-js";
import { i18n } from "@/i18n"; import { i18n } from "@/i18n";
import * as os from "@/os"; import * as os from "@/os";
@ -12,7 +12,7 @@ export async function lookupUser() {
os.pageWindow(`/user-info/${user.id}`); os.pageWindow(`/user-info/${user.id}`);
}; };
const usernamePromise = os.api("users/show", Acct.parse(result)); const usernamePromise = os.api("users/show", acct.parse(result));
const idPromise = os.api("users/show", { userId: result }); const idPromise = os.api("users/show", { userId: result });
let _notFound = false; let _notFound = false;
const notFound = () => { const notFound = () => {

View file

@ -1,4 +1,4 @@
import type * as firefish from "firefish-js"; import type { entities } 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?: firefish.entities.User | null; avatar?: entities.User | null;
userName?: firefish.entities.User | null; userName?: entities.User | null;
bg?: string; bg?: string;
} }

View file

@ -1,5 +1,5 @@
import { ref } from "vue"; import { ref } from "vue";
import type { DriveFile } from "firefish-js/built/entities"; import type { entities } 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";
@ -11,7 +11,7 @@ function select(
src: any, src: any,
label: string | null, label: string | null,
multiple: boolean, multiple: boolean,
): Promise<DriveFile | DriveFile[]> { ): Promise<entities.DriveFile | entities.DriveFile[]> {
return new Promise((res, rej) => { return new Promise((res, rej) => {
const keepOriginal = ref(defaultStore.state.keepOriginalUploading); const keepOriginal = ref(defaultStore.state.keepOriginalUploading);
@ -122,13 +122,13 @@ function select(
export function selectFile( export function selectFile(
src: any, src: any,
label: string | null = null, label: string | null = null,
): Promise<DriveFile> { ): Promise<entities.DriveFile> {
return select(src, label, false) as Promise<DriveFile>; return select(src, label, false) as Promise<entities.DriveFile>;
} }
export function selectFiles( export function selectFiles(
src: any, src: any,
label: string | null = null, label: string | null = null,
): Promise<DriveFile[]> { ): Promise<entities.DriveFile[]> {
return select(src, label, true) as Promise<DriveFile[]>; return select(src, label, true) as Promise<entities.DriveFile[]>;
} }

View file

@ -1,5 +1,5 @@
import { reactive, ref } from "vue"; import { reactive, ref } from "vue";
import type * as firefish from "firefish-js"; import type { entities } 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<firefish.entities.DriveFile> { ): Promise<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 firefish from "firefish-js"; import type { entities } from "firefish-js";
import { stream } from "@/stream"; import { stream } from "@/stream";
import { $i, isSignedIn } from "@/reactiveAccount"; import { $i, isSignedIn } from "@/reactiveAccount";
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<firefish.entities.Note>; note: Ref<entities.Note>;
isDeletedRef: Ref<boolean>; isDeletedRef: Ref<boolean>;
}) { }) {
const note = props.note; const note = props.note;

View file

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

Some files were not shown because too many files have changed in this diff Show more