rename foundkey-js imports to foundkey

This commit is contained in:
Johann150 2022-09-11 19:58:16 +02:00
parent fbe3972bc6
commit 677c1df597
Signed by: Johann150
GPG key ID: 9EE6577A2A06F8F1
73 changed files with 242 additions and 242 deletions

View file

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

View file

@ -1,5 +1,5 @@
import { defineAsyncComponent, reactive } from 'vue';
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import { showSuspendedDialog } from './scripts/show-suspended-dialog';
import { i18n } from './i18n';
import { del, get, set } from '@/scripts/idb-proxy';
@ -9,7 +9,7 @@ import { unisonReload, reloadChannel } from '@/scripts/unison-reload';
// TODO: 他のタブと永続化されたstateを同期
type Account = misskey.entities.MeDetailed;
type Account = foundkey.entities.MeDetailed;
const accountData = localStorage.getItem('account');
@ -141,8 +141,8 @@ export async function login(token: Account['token'], redirect?: string) {
export async function openAccountMenu(opts: {
includeCurrentAccount?: boolean;
withExtraOperation: boolean;
active?: misskey.entities.UserDetailed['id'];
onChoose?: (account: misskey.entities.UserDetailed) => void;
active?: foundkey.entities.UserDetailed['id'];
onChoose?: (account: foundkey.entities.UserDetailed) => void;
}, ev: MouseEvent) {
function showSigninDialog() {
popup(defineAsyncComponent(() => import('@/components/signin-dialog.vue')), {}, {
@ -162,7 +162,7 @@ export async function openAccountMenu(opts: {
}, 'closed');
}
async function switchAccount(account: misskey.entities.UserDetailed) {
async function switchAccount(account: foundkey.entities.UserDetailed) {
const storedAccounts = await getAccounts();
const token = storedAccounts.find(x => x.id === account.id).token;
switchAccountWithToken(token);
@ -175,7 +175,7 @@ export async function openAccountMenu(opts: {
const storedAccounts = await getAccounts().then(accounts => accounts.filter(x => x.id !== $i.id));
const accountsPromise = api('users/show', { userIds: storedAccounts.map(x => x.id) });
function createItem(account: misskey.entities.UserDetailed) {
function createItem(account: foundkey.entities.UserDetailed) {
return {
type: 'user',
user: account,

View file

@ -27,7 +27,7 @@
</template>
<script lang="ts" setup>
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import XNoteHeader from './note-header.vue';
import MkNoteSubNoteContent from './sub-note-content.vue';
import XCwButton from './cw-button.vue';
@ -35,8 +35,8 @@ import { notePage } from '@/filters/note';
import { i18n } from '@/i18n';
const props = withDefaults(defineProps<{
note: misskey.entities.Note;
conversation?: misskey.entities.Note[] | null;
note: foundkey.entities.Note;
conversation?: foundkey.entities.Note[] | null;
// how many notes are in between this one and the note being viewed in detail
depth?: number;
@ -46,7 +46,7 @@ const props = withDefaults(defineProps<{
});
let showContent = $ref(false);
const replies: misskey.entities.Note[] = props.conversation?.filter(item => item.replyId === props.note.id || item.renoteId === props.note.id) ?? [];
const replies: foundkey.entities.Note[] = props.conversation?.filter(item => item.replyId === props.note.id || item.renoteId === props.note.id) ?? [];
</script>
<style lang="scss" scoped>

View file

@ -24,7 +24,7 @@
<script setup lang="ts">
import { ref } from 'vue';
import * as Misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import XWindow from '@/components/ui/window.vue';
import MkTextarea from '@/components/form/textarea.vue';
import MkButton from '@/components/ui/button.vue';
@ -32,7 +32,7 @@ import * as os from '@/os';
import { i18n } from '@/i18n';
const props = defineProps<{
user: Misskey.entities.User;
user: foundkey.entities.User;
urls?: string[];
}>();

View file

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

View file

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

View file

@ -16,11 +16,11 @@
<script lang="ts" setup>
import { computed } from 'vue';
import * as Misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import ImgWithBlurhash from '@/components/img-with-blurhash.vue';
const props = defineProps<{
file: Misskey.entities.DriveFile;
file: foundkey.entities.DriveFile;
fit: string;
}>();

View file

@ -20,7 +20,7 @@
<script lang="ts" setup>
import { ref } from 'vue';
import * as Misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import XDrive from './drive.vue';
import XModalWindow from '@/components/ui/modal-window.vue';
import number from '@/filters/number';
@ -34,13 +34,13 @@ withDefaults(defineProps<{
});
const emit = defineEmits<{
(ev: 'done', r?: Misskey.entities.DriveFile[]): void;
(ev: 'done', r?: foundkey.entities.DriveFile[]): void;
(ev: 'closed'): void;
}>();
const dialog = ref<InstanceType<typeof XModalWindow>>();
const selected = ref<Misskey.entities.DriveFile[]>([]);
const selected = ref<foundkey.entities.DriveFile[]>([]);
function ok() {
emit('done', selected.value);
@ -52,7 +52,7 @@ function cancel() {
dialog.value?.close();
}
function onChangeSelection(files: Misskey.entities.DriveFile[]) {
function onChangeSelection(files: foundkey.entities.DriveFile[]) {
selected.value = files;
}
</script>

View file

@ -14,13 +14,13 @@
</template>
<script lang="ts" setup>
import * as Misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import XDrive from './drive.vue';
import XWindow from '@/components/ui/window.vue';
import { i18n } from '@/i18n';
defineProps<{
initialFolder?: Misskey.entities.DriveFolder;
initialFolder?: foundkey.entities.DriveFolder;
}>();
const emit = defineEmits<{

View file

@ -33,7 +33,7 @@
<script lang="ts" setup>
import { computed, defineAsyncComponent, ref } from 'vue';
import * as Misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import MkDriveFileThumbnail from './drive-file-thumbnail.vue';
import copyToClipboard from '@/scripts/copy-to-clipboard';
import bytes from '@/filters/bytes';
@ -43,7 +43,7 @@ import { $i } from '@/account';
import { MenuItem } from '@/types/menu';
const props = withDefaults(defineProps<{
file: Misskey.entities.DriveFile;
file: foundkey.entities.DriveFile;
isSelected?: boolean;
selectMode?: boolean;
}>(), {
@ -52,7 +52,7 @@ const props = withDefaults(defineProps<{
});
const emit = defineEmits<{
(ev: 'chosen', r: Misskey.entities.DriveFile): void;
(ev: 'chosen', r: foundkey.entities.DriveFile): void;
(ev: 'dragstart'): void;
(ev: 'dragend'): void;
}>();

View file

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

View file

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

View file

@ -89,7 +89,7 @@
<script lang="ts" setup>
import { nextTick, onActivated, onBeforeUnmount, onMounted, ref, watch } from 'vue';
import * as Misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import XNavFolder from './drive.nav-folder.vue';
import XFolder from './drive.folder.vue';
import XFile from './drive.file.vue';
@ -101,7 +101,7 @@ import { i18n } from '@/i18n';
import { uploadFile, uploads } from '@/scripts/upload';
const props = withDefaults(defineProps<{
initialFolder?: Misskey.entities.DriveFolder;
initialFolder?: foundkey.entities.DriveFolder;
type?: string;
multiple?: boolean;
select?: 'file' | 'folder' | null;
@ -111,24 +111,24 @@ const props = withDefaults(defineProps<{
});
const emit = defineEmits<{
(ev: 'selected', v: Misskey.entities.DriveFile | Misskey.entities.DriveFolder): void;
(ev: 'change-selection', v: Misskey.entities.DriveFile[] | Misskey.entities.DriveFolder[]): void;
(ev: 'selected', v: foundkey.entities.DriveFile | foundkey.entities.DriveFolder): void;
(ev: 'change-selection', v: foundkey.entities.DriveFile[] | foundkey.entities.DriveFolder[]): void;
(ev: 'move-root'): void;
(ev: 'cd', v: Misskey.entities.DriveFolder | null): void;
(ev: 'open-folder', v: Misskey.entities.DriveFolder): void;
(ev: 'cd', v: foundkey.entities.DriveFolder | null): void;
(ev: 'open-folder', v: foundkey.entities.DriveFolder): void;
}>();
const loadMoreFiles = ref<InstanceType<typeof MkButton>>();
const fileInput = ref<HTMLInputElement>();
const folder = ref<Misskey.entities.DriveFolder | null>(null);
const files = ref<Misskey.entities.DriveFile[]>([]);
const folders = ref<Misskey.entities.DriveFolder[]>([]);
const folder = ref<foundkey.entities.DriveFolder | null>(null);
const files = ref<foundkey.entities.DriveFile[]>([]);
const folders = ref<foundkey.entities.DriveFolder[]>([]);
const moreFiles = ref(false);
const moreFolders = ref(false);
const hierarchyFolders = ref<Misskey.entities.DriveFolder[]>([]);
const selectedFiles = ref<Misskey.entities.DriveFile[]>([]);
const selectedFolders = ref<Misskey.entities.DriveFolder[]>([]);
const hierarchyFolders = ref<foundkey.entities.DriveFolder[]>([]);
const selectedFiles = ref<foundkey.entities.DriveFile[]>([]);
const selectedFolders = ref<foundkey.entities.DriveFolder[]>([]);
const uploadings = uploads;
const connection = stream.useChannel('drive');
const keepOriginal = ref<boolean>(defaultStore.state.keepOriginalUploading); // $ref使
@ -148,11 +148,11 @@ const ilFilesObserver = new IntersectionObserver(
watch(folder, () => emit('cd', folder.value));
function onStreamDriveFileCreated(file: Misskey.entities.DriveFile) {
function onStreamDriveFileCreated(file: foundkey.entities.DriveFile) {
addFile(file, true);
}
function onStreamDriveFileUpdated(file: Misskey.entities.DriveFile) {
function onStreamDriveFileUpdated(file: foundkey.entities.DriveFile) {
const current = folder.value ? folder.value.id : null;
if (current !== file.folderId) {
removeFile(file);
@ -165,11 +165,11 @@ function onStreamDriveFileDeleted(fileId: string) {
removeFile(fileId);
}
function onStreamDriveFolderCreated(createdFolder: Misskey.entities.DriveFolder) {
function onStreamDriveFolderCreated(createdFolder: foundkey.entities.DriveFolder) {
addFolder(createdFolder, true);
}
function onStreamDriveFolderUpdated(updatedFolder: Misskey.entities.DriveFolder) {
function onStreamDriveFolderUpdated(updatedFolder: foundkey.entities.DriveFolder) {
const current = folder.value ? folder.value.id : null;
if (current !== updatedFolder.parentId) {
removeFolder(updatedFolder);
@ -309,7 +309,7 @@ function createFolder() {
});
}
function renameFolder(folderToRename: Misskey.entities.DriveFolder) {
function renameFolder(folderToRename: foundkey.entities.DriveFolder) {
os.inputText({
title: i18n.ts.renameFolder,
placeholder: i18n.ts.inputNewFolderName,
@ -326,7 +326,7 @@ function renameFolder(folderToRename: Misskey.entities.DriveFolder) {
});
}
function deleteFolder(folderToDelete: Misskey.entities.DriveFolder) {
function deleteFolder(folderToDelete: foundkey.entities.DriveFolder) {
os.api('drive/folders/delete', {
folderId: folderToDelete.id,
}).then(() => {
@ -357,13 +357,13 @@ function onChangeFileInput() {
}
}
function upload(file: File, folderToUpload?: Misskey.entities.DriveFolder | null) {
function upload(file: File, folderToUpload?: foundkey.entities.DriveFolder | null) {
uploadFile(file, (folderToUpload && typeof folderToUpload === 'object') ? folderToUpload.id : null, undefined, keepOriginal.value).then(res => {
addFile(res, true);
});
}
function chooseFile(file: Misskey.entities.DriveFile) {
function chooseFile(file: foundkey.entities.DriveFile) {
const isAlreadySelected = selectedFiles.value.some(f => f.id === file.id);
if (props.multiple) {
if (isAlreadySelected) {
@ -382,7 +382,7 @@ function chooseFile(file: Misskey.entities.DriveFile) {
}
}
function chooseFolder(folderToChoose: Misskey.entities.DriveFolder) {
function chooseFolder(folderToChoose: foundkey.entities.DriveFolder) {
const isAlreadySelected = selectedFolders.value.some(f => f.id === folderToChoose.id);
if (props.multiple) {
if (isAlreadySelected) {
@ -401,7 +401,7 @@ function chooseFolder(folderToChoose: Misskey.entities.DriveFolder) {
}
}
function move(target?: string | Misskey.entities.DriveFolder) {
function move(target?: string | foundkey.entities.DriveFolder) {
if (!target) {
goRoot();
return;
@ -429,7 +429,7 @@ function move(target?: string | Misskey.entities.DriveFolder) {
});
}
function addFolder(folderToAdd: Misskey.entities.DriveFolder, unshift = false) {
function addFolder(folderToAdd: foundkey.entities.DriveFolder, unshift = false) {
const current = folder.value ? folder.value.id : null;
if (current !== folderToAdd.parentId) return;
@ -446,7 +446,7 @@ function addFolder(folderToAdd: Misskey.entities.DriveFolder, unshift = false) {
}
}
function addFile(fileToAdd: Misskey.entities.DriveFile, unshift = false) {
function addFile(fileToAdd: foundkey.entities.DriveFile, unshift = false) {
const current = folder.value ? folder.value.id : null;
if (current !== fileToAdd.folderId) return;
@ -463,29 +463,29 @@ function addFile(fileToAdd: Misskey.entities.DriveFile, unshift = false) {
}
}
function removeFolder(folderToRemove: Misskey.entities.DriveFolder | string) {
function removeFolder(folderToRemove: foundkey.entities.DriveFolder | string) {
const folderIdToRemove = typeof folderToRemove === 'object' ? folderToRemove.id : folderToRemove;
folders.value = folders.value.filter(f => f.id !== folderIdToRemove);
}
function removeFile(file: Misskey.entities.DriveFile | string) {
function removeFile(file: foundkey.entities.DriveFile | string) {
const fileId = typeof file === 'object' ? file.id : file;
files.value = files.value.filter(f => f.id !== fileId);
}
function appendFile(file: Misskey.entities.DriveFile) {
function appendFile(file: foundkey.entities.DriveFile) {
addFile(file);
}
function appendFolder(folderToAppend: Misskey.entities.DriveFolder) {
function appendFolder(folderToAppend: foundkey.entities.DriveFolder) {
addFolder(folderToAppend);
}
/*
function prependFile(file: Misskey.entities.DriveFile) {
function prependFile(file: foundkey.entities.DriveFile) {
addFile(file, true);
}
function prependFolder(folderToPrepend: Misskey.entities.DriveFolder) {
function prependFolder(folderToPrepend: foundkey.entities.DriveFolder) {
addFolder(folderToPrepend, true);
}
*/
@ -589,7 +589,7 @@ function getMenu() {
} : undefined, folder.value ? {
text: i18n.ts.deleteFolder,
icon: 'fas fa-trash-alt',
action: () => { deleteFolder(folder.value as Misskey.entities.DriveFolder); },
action: () => { deleteFolder(folder.value as foundkey.entities.DriveFolder); },
} : undefined, {
text: i18n.ts.createFolder,
icon: 'fas fa-folder-plus',

View file

@ -79,7 +79,7 @@
<script lang="ts" setup>
import { ref, computed, watch, onMounted } from 'vue';
import * as Misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import XSection from './emoji-picker.section.vue';
import { emojilist, UnicodeEmojiDef, unicodeEmojiCategories as categories } from '@/scripts/emojilist';
import { getStaticImageUrl } from '@/scripts/get-static-image-url';
@ -124,7 +124,7 @@ const height = computed(() => props.asReactionPicker ? reactionPickerHeight.valu
const customEmojiCategories = emojiCategories;
const customEmojis = instance.emojis;
const q = ref<string | null>(null);
const searchResultCustom = ref<Misskey.entities.CustomEmoji[]>([]);
const searchResultCustom = ref<foundkey.entities.CustomEmoji[]>([]);
const searchResultUnicode = ref<UnicodeEmojiDef[]>([]);
const tab = ref<'index' | 'custom' | 'unicode' | 'tags'>('index');
@ -178,7 +178,7 @@ function reset() {
q.value = '';
}
function getKey(emoji: string | Misskey.entities.CustomEmoji | UnicodeEmojiDef): string {
function getKey(emoji: string | foundkey.entities.CustomEmoji | UnicodeEmojiDef): string {
return typeof emoji === 'string' ? emoji : (emoji.char || `:${emoji.name}:`);
}

View file

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

View file

@ -31,13 +31,13 @@
<script lang="ts" setup>
import { onBeforeUnmount, onMounted } from 'vue';
import * as Misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import * as os from '@/os';
import { stream } from '@/stream';
import { i18n } from '@/i18n';
const props = withDefaults(defineProps<{
user: Misskey.entities.UserDetailed,
user: foundkey.entities.UserDetailed,
full?: boolean,
large?: boolean,
}>(), {
@ -57,7 +57,7 @@ if (props.user.isFollowing == null) {
.then(onFollowChange);
}
function onFollowChange(user: Misskey.entities.UserDetailed) {
function onFollowChange(user: foundkey.entities.UserDetailed) {
if (user.id === props.user.id) {
isFollowing = user.isFollowing;
hasPendingFollowRequestFromYou = user.hasPendingFollowRequestFromYou;

View file

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

View file

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

View file

@ -3,10 +3,10 @@
</template>
<script lang="ts" setup>
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
withDefaults(defineProps<{
user: misskey.entities.User;
user: foundkey.entities.User;
nowrap?: boolean;
}>(), {
nowrap: true,

View file

@ -10,12 +10,12 @@
</template>
<script lang="ts" setup>
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import MkMiniChart from '@/components/mini-chart.vue';
import * as os from '@/os';
const props = defineProps<{
instance: misskey.entities.Instance;
instance: foundkey.entities.Instance;
}>();
let chartValues = $ref<number[] | null>(null);

View file

@ -30,12 +30,12 @@
<script lang="ts" setup>
import { onMounted } from 'vue';
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import { ColdDeviceStorage } from '@/store';
import { i18n } from '@/i18n';
defineProps<{
media: misskey.entities.DriveFile;
media: foundkey.entities.DriveFile;
}>();
const audioEl = $ref<HTMLAudioElement | null>();

View file

@ -37,7 +37,7 @@
<script lang="ts" setup>
import { onBeforeUnmount, onMounted, computed } from 'vue';
import { length } from 'stringz';
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import MkModal from '@/components/ui/modal.vue';
import MkButton from '@/components/ui/button.vue';
import bytes from '@/filters/bytes';
@ -50,7 +50,7 @@ type Input = {
};
const props = withDefaults(defineProps<{
file: misskey.entities.DriveFile;
file: foundkey.entities.DriveFile;
title?: string;
input: Input;
showOkButton: boolean;

View file

@ -22,13 +22,13 @@
<script lang="ts" setup>
import { watch } from 'vue';
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import { getStaticImageUrl } from '@/scripts/get-static-image-url';
import ImgWithBlurhash from '@/components/img-with-blurhash.vue';
import { defaultStore } from '@/store';
const props = defineProps<{
image: misskey.entities.DriveFile;
image: foundkey.entities.DriveFile;
raw?: boolean;
}>();

View file

@ -14,7 +14,7 @@
<script lang="ts" setup>
import { onMounted, ref } from 'vue';
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import PhotoSwipeLightbox from 'photoswipe/lightbox';
import PhotoSwipe from 'photoswipe';
import 'photoswipe/style.css';
@ -25,7 +25,7 @@ import * as os from '@/os';
import { FILE_TYPE_BROWSERSAFE } from '@/const';
const props = defineProps<{
mediaList: misskey.entities.DriveFile[];
mediaList: foundkey.entities.DriveFile[];
raw?: boolean;
}>();
@ -92,7 +92,7 @@ onMounted(() => {
lightbox.init();
});
const previewable = (file: misskey.entities.DriveFile): boolean => {
const previewable = (file: foundkey.entities.DriveFile): boolean => {
if (file.type === 'image/svg+xml') return true; // svgwebpublic/thumbnailpngtrue
// FILE_TYPE_BROWSERSAFE
return (file.type.startsWith('video') || file.type.startsWith('image')) && FILE_TYPE_BROWSERSAFE.includes(file.type);

View file

@ -25,12 +25,12 @@
<script lang="ts" setup>
import { ref } from 'vue';
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import { defaultStore } from '@/store';
import { i18n } from '@/i18n';
const props = defineProps<{
video: misskey.entities.DriveFile;
video: foundkey.entities.DriveFile;
}>();
const hide = ref((defaultStore.state.nsfw === 'force') ? true : props.video.isSensitive && (defaultStore.state.nsfw !== 'ignore'));

View file

@ -115,7 +115,7 @@
<script lang="ts" setup>
import { inject, onMounted, ref } from 'vue';
import * as mfm from 'mfm-js';
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import MkNoteSub from './MkNoteSub.vue';
import XNoteSimple from './note-simple.vue';
import XReactionsViewer from './reactions-viewer.vue';
@ -140,7 +140,7 @@ import { getNoteMenu } from '@/scripts/get-note-menu';
import { useNoteCapture } from '@/scripts/use-note-capture';
const props = defineProps<{
note: misskey.entities.Note;
note: foundkey.entities.Note;
pinned?: boolean;
}>();
@ -171,7 +171,7 @@ const menuButton = ref<HTMLElement>();
const renoteButton = ref<InstanceType<typeof XRenoteButton>>();
const renoteTime = ref<HTMLElement>();
const reactButton = ref<HTMLElement>();
let appearNote = $computed(() => isRenote ? note.renote as misskey.entities.Note : note);
let appearNote = $computed(() => isRenote ? note.renote as foundkey.entities.Note : note);
const isMyRenote = $i && ($i.id === note.userId);
const showContent = ref(false);
const isDeleted = ref(false);
@ -180,9 +180,9 @@ const translation = ref(null);
const translating = ref(false);
const urls = appearNote.text ? extractUrlFromMfm(mfm.parse(appearNote.text)) : null;
const showTicker = (defaultStore.state.instanceTicker === 'always') || (defaultStore.state.instanceTicker === 'remote' && appearNote.user.instance);
const conversation = ref<misskey.entities.Note[]>([]);
const replies = ref<misskey.entities.Note[]>([]);
const directReplies = ref<misskey.entities.Note[]>([]);
const conversation = ref<foundkey.entities.Note[]>([]);
const replies = ref<foundkey.entities.Note[]>([]);
const directReplies = ref<foundkey.entities.Note[]>([]);
const keymap = {
'r': () => reply(true),

View file

@ -15,13 +15,13 @@
</template>
<script lang="ts" setup>
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import MkVisibility from '@/components/visibility.vue';
import { notePage } from '@/filters/note';
import { userPage } from '@/filters/user';
defineProps<{
note: misskey.entities.Note;
note: foundkey.entities.Note;
pinned?: boolean;
}>();
</script>

View file

@ -17,13 +17,13 @@
</template>
<script lang="ts" setup>
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import XNoteHeader from './note-header.vue';
import MkNoteSubNoteContent from './sub-note-content.vue';
import XCwButton from './cw-button.vue';
defineProps<{
note: misskey.entities.Note;
note: foundkey.entities.Note;
pinned?: boolean;
}>();

View file

@ -103,7 +103,7 @@
<script lang="ts" setup>
import { inject, onMounted, ref, Ref } from 'vue';
import * as mfm from 'mfm-js';
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import MkNoteSub from './MkNoteSub.vue';
import XNoteHeader from './note-header.vue';
import XNoteSimple from './note-simple.vue';
@ -129,7 +129,7 @@ import { getNoteMenu } from '@/scripts/get-note-menu';
import { useNoteCapture } from '@/scripts/use-note-capture';
const props = defineProps<{
note: misskey.entities.Note;
note: foundkey.entities.Note;
pinned?: boolean;
}>();
@ -160,7 +160,7 @@ const menuButton = ref<HTMLElement>();
const renoteButton = ref<InstanceType<typeof XRenoteButton>>();
const renoteTime = ref<HTMLElement>();
const reactButton = ref<HTMLElement>();
let appearNote = $computed(() => isRenote ? note.renote as misskey.entities.Note : note);
let appearNote = $computed(() => isRenote ? note.renote as foundkey.entities.Note : note);
const isMyRenote = $i && ($i.id === note.userId);
const showContent = ref(false);
const isLong = (appearNote.cw == null && appearNote.text != null && (
@ -222,7 +222,7 @@ function undoReact(): void {
});
}
const currentClipPage = inject<Ref<misskey.entities.Clip> | null>('currentClipPage', null);
const currentClipPage = inject<Ref<foundkey.entities.Clip> | null>('currentClipPage', null);
function onContextmenu(ev: MouseEvent): void {
const isLink = (el: HTMLElement) => {

View file

@ -76,7 +76,7 @@
<script lang="ts" setup>
import { ref, onMounted, onUnmounted, watch } from 'vue';
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import MkFollowButton from './follow-button.vue';
import XReactionTooltip from './reaction-tooltip.vue';
import { getNoteSummary } from '@/scripts/get-note-summary';
@ -88,7 +88,7 @@ import { stream } from '@/stream';
import { useTooltip } from '@/scripts/use-tooltip';
const props = withDefaults(defineProps<{
notification: misskey.entities.Notification;
notification: foundkey.entities.Notification;
withTime?: boolean;
full?: boolean;
}>(), {

View file

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

View file

@ -63,7 +63,7 @@
<script lang="ts" setup>
import { inject, watch, nextTick, onMounted, defineAsyncComponent } from 'vue';
import * as mfm from 'mfm-js';
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import insertTextAtCursor from 'insert-text-at-cursor';
import { length } from 'stringz';
import { toASCII } from 'punycode/';
@ -91,17 +91,17 @@ import { uploadFile } from '@/scripts/upload';
const modal = inject('modal');
const props = withDefaults(defineProps<{
reply?: misskey.entities.Note;
renote?: misskey.entities.Note;
reply?: foundkey.entities.Note;
renote?: foundkey.entities.Note;
channel?: any; // TODO
mention?: misskey.entities.User;
specified?: misskey.entities.User;
mention?: foundkey.entities.User;
specified?: foundkey.entities.User;
initialText?: string;
initialVisibility?: typeof misskey.noteVisibilities;
initialFiles?: misskey.entities.DriveFile[];
initialVisibility?: typeof foundkey.noteVisibilities;
initialFiles?: foundkey.entities.DriveFile[];
initialLocalOnly?: boolean;
initialVisibleUsers?: misskey.entities.User[];
initialNote?: misskey.entities.Note;
initialVisibleUsers?: foundkey.entities.User[];
initialNote?: foundkey.entities.Note;
instant?: boolean;
fixed?: boolean;
autofocus?: boolean;
@ -134,7 +134,7 @@ let useCw = $ref(false);
let showPreview = $ref(false);
let cw = $ref<string | null>(null);
let localOnly = $ref<boolean>(props.initialLocalOnly ?? defaultStore.state.rememberNoteVisibility ? defaultStore.state.localOnly : defaultStore.state.defaultNoteLocalOnly);
let visibility = $ref(props.initialVisibility ?? (defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility) as typeof misskey.noteVisibilities[number]);
let visibility = $ref(props.initialVisibility ?? (defaultStore.state.rememberNoteVisibility ? defaultStore.state.visibility : defaultStore.state.defaultNoteVisibility) as typeof foundkey.noteVisibilities[number]);
let visibleUsers = $ref([]);
if (props.initialVisibleUsers) {
props.initialVisibleUsers.forEach(pushVisibleUser);
@ -602,7 +602,7 @@ function showActions(ev) {
})), ev.currentTarget ?? ev.target);
}
let postAccount = $ref<misskey.entities.UserDetailed | null>(null);
let postAccount = $ref<foundkey.entities.UserDetailed | null>(null);
function openAccountMenu(ev: MouseEvent) {
openAccountMenu_({

View file

@ -14,7 +14,7 @@
<script lang="ts" setup>
import { computed, onMounted, ref, watch } from 'vue';
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import XDetails from '@/components/reactions-viewer.details.vue';
import * as os from '@/os';
import { useTooltip } from '@/scripts/use-tooltip';
@ -24,7 +24,7 @@ const props = defineProps<{
reaction: string;
count: number;
isInitial: boolean;
note: misskey.entities.Note;
note: foundkey.entities.Note;
}>();
const buttonRef = ref<HTMLElement>();

View file

@ -6,12 +6,12 @@
<script lang="ts" setup>
import { computed } from 'vue';
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import XReaction from './reactions-viewer.reaction.vue';
import { $i } from '@/account';
const props = defineProps<{
note: misskey.entities.Note;
note: foundkey.entities.Note;
}>();
const initialReactions = new Set(Object.keys(props.note.reactions));

View file

@ -24,13 +24,13 @@
</template>
<script lang="ts" setup>
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import XPoll from './poll.vue';
import XMediaList from './media-list.vue';
import { i18n } from '@/i18n';
const props = defineProps<{
note: misskey.entities.Note;
note: foundkey.entities.Note;
}>();
const isLong = (

View file

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

View file

@ -10,13 +10,13 @@
</template>
<script lang="ts" setup>
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import MkMiniChart from '@/components/mini-chart.vue';
import * as os from '@/os';
import { acct } from '@/filters/user';
const props = defineProps<{
user: misskey.entities.User;
user: foundkey.entities.User;
}>();
let chartValues = $ref<number[] | null>(null);

View file

@ -28,13 +28,13 @@
</template>
<script lang="ts" setup>
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import MkFollowButton from './follow-button.vue';
import { userPage } from '@/filters/user';
import { i18n } from '@/i18n';
defineProps<{
user: misskey.entities.UserDetailed;
user: foundkey.entities.UserDetailed;
}>();
</script>

View file

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

View file

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

View file

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

View file

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

View file

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

View file

@ -3,7 +3,7 @@
import { Component, markRaw, Ref, ref, defineAsyncComponent } from 'vue';
import { EventEmitter } from 'eventemitter3';
import insertTextAtCursor from 'insert-text-at-cursor';
import * as Misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import { apiUrl, url } from '@/config';
import MkPostFormDialog from '@/components/post-form-dialog.vue';
import MkWaitingDialog from '@/components/waiting-dialog.vue';
@ -12,7 +12,7 @@ import { $i } from '@/account';
export const pendingApiRequestsCount = ref(0);
const apiClient = new Misskey.api.APIClient({
const apiClient = new foundkey.api.APIClient({
origin: url,
});
@ -434,9 +434,9 @@ export async function pickEmoji(src: HTMLElement | null, opts) {
});
}
export async function cropImage(image: Misskey.entities.DriveFile, options: {
export async function cropImage(image: foundkey.entities.DriveFile, options: {
aspectRatio: number;
}): Promise<Misskey.entities.DriveFile> {
}): Promise<foundkey.entities.DriveFile> {
return new Promise((resolve) => {
popup(defineAsyncComponent(() => import('@/components/cropper-dialog.vue')), {
file: image,

View file

@ -18,7 +18,7 @@
</template>
<script lang="ts" setup>
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import MkButton from '@/components/ui/button.vue';
import { version } from '@/config';
import * as os from '@/os';
@ -34,7 +34,7 @@ withDefaults(defineProps<{
let loaded = $ref(false);
let serverIsDead = $ref(false);
let meta = $ref<misskey.entities.LiteInstanceMetadata | null>(null);
let meta = $ref<foundkey.entities.LiteInstanceMetadata | null>(null);
os.api('meta', {
detail: false,

View file

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

View file

@ -111,7 +111,7 @@
</template>
<script lang="ts" setup>
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import MkChart from '@/components/chart.vue';
import MkObjectView from '@/components/object-view.vue';
import FormLink from '@/components/form/link.vue';
@ -136,8 +136,8 @@ const props = defineProps<{
let tab = $ref('overview');
let chartSrc = $ref('instance-requests');
let meta = $ref<misskey.entities.DetailedInstanceMetadata | null>(null);
let instance = $ref<misskey.entities.Instance | null>(null);
let meta = $ref<foundkey.entities.DetailedInstanceMetadata | null>(null);
let instance = $ref<foundkey.entities.Instance | null>(null);
let suspended = $ref(false);
let isBlocked = $ref(false);

View file

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

View file

@ -37,14 +37,14 @@
<script lang="ts" setup>
import * as mfm from 'mfm-js';
import * as Misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import { extractUrlFromMfm } from '@/scripts/extract-url-from-mfm';
import MkUrlPreview from '@/components/url-preview.vue';
import * as os from '@/os';
import { $i } from '@/account';
const props = defineProps<{
message: Misskey.entities.MessagingMessage;
message: foundkey.entities.MessagingMessage;
isGroup?: boolean;
}>();

View file

@ -51,7 +51,7 @@
<script lang="ts" setup>
import { computed, watch, onMounted, nextTick, onBeforeUnmount } from 'vue';
import * as Misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import * as Acct from 'foundkey-js/built/acct';
import XMessage from './messaging-room.message.vue';
import XForm from './messaging-room.form.vue';
@ -76,10 +76,10 @@ let formEl = $ref<InstanceType<typeof XForm>>();
let pagingComponent = $ref<InstanceType<typeof MkPagination>>();
let fetching = $ref(true);
let user: Misskey.entities.UserDetailed | null = $ref(null);
let group: Misskey.entities.UserGroup | null = $ref(null);
let typers: Misskey.entities.User[] = $ref([]);
let connection: Misskey.ChannelConnection<Misskey.Channels['messaging']> | null = $ref(null);
let user: foundkey.entities.UserDetailed | null = $ref(null);
let group: foundkey.entities.UserGroup | null = $ref(null);
let typers: foundkey.entities.User[] = $ref([]);
let connection: foundkey.ChannelConnection<foundkey.Channels['messaging']> | null = $ref(null);
let showIndicator = $ref(false);
const {
animation,

View file

@ -42,7 +42,7 @@
<script lang="ts" setup>
import { computed, defineComponent, watch } from 'vue';
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import XNote from '@/components/note.vue';
import XNoteDetailed from '@/components/note-detailed.vue';
import XNotes from '@/components/notes.vue';
@ -56,7 +56,7 @@ const props = defineProps<{
noteId: string;
}>();
let note = $ref<null | misskey.entities.Note>();
let note = $ref<null | foundkey.entities.Note>();
let clips = $ref();
let hasPrev = $ref(false);
let hasNext = $ref(false);

View file

@ -27,7 +27,7 @@
import { noteVisibilities } from 'foundkey-js';
import * as Acct from 'foundkey-js/built/acct';
import * as Misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import MkButton from '@/components/ui/button.vue';
import XPostForm from '@/components/post-form.vue';
import * as os from '@/os';
@ -44,12 +44,12 @@ let title = $ref(urlParams.get('title'));
const text = urlParams.get('text');
const url = urlParams.get('url');
let initialText = $ref(null as string | null);
let reply = $ref(null as Misskey.entities.Note | null);
let renote = $ref(null as Misskey.entities.Note | null);
let reply = $ref(null as foundkey.entities.Note | null);
let renote = $ref(null as foundkey.entities.Note | null);
let visibility = $ref(noteVisibilities.includes(visibilityQuery) ? visibilityQuery : null);
let localOnly = $ref(localOnlyQuery === '0' ? false : localOnlyQuery === '1' ? true : null);
let files = $ref([] as Misskey.entities.DriveFile[]);
let visibleUsers = $ref([] as Misskey.entities.User[]);
let files = $ref([] as foundkey.entities.DriveFile[]);
let visibleUsers = $ref([] as foundkey.entities.User[]);
async function init() {
let noteText = '';

View file

@ -102,7 +102,7 @@
<script lang="ts" setup>
import { computed, defineAsyncComponent, defineComponent, watch } from 'vue';
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import MkChart from '@/components/chart.vue';
import MkObjectView from '@/components/object-view.vue';
import FormTextarea from '@/components/form/textarea.vue';
@ -129,7 +129,7 @@ const props = defineProps<{
let tab = $ref('overview');
let chartSrc = $ref('per-user-notes');
let user = $ref<null | misskey.entities.UserDetailed>();
let user = $ref<null | foundkey.entities.UserDetailed>();
let init = $ref();
let info = $ref();
let ap = $ref(null);

View file

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

View file

@ -16,7 +16,7 @@
<script lang="ts" setup>
import { defineAsyncComponent, computed, inject, onMounted, onUnmounted, watch } from 'vue';
import * as Acct from 'foundkey-js/built/acct';
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import XFollowList from './follow-list.vue';
import * as os from '@/os';
import { definePageMetadata } from '@/scripts/page-metadata';
@ -27,7 +27,7 @@ const props = withDefaults(defineProps<{
}>(), {
});
let user = $ref<null | misskey.entities.UserDetailed>(null);
let user = $ref<null | foundkey.entities.UserDetailed>(null);
let error = $ref(null);
function fetchUser(): void {

View file

@ -16,7 +16,7 @@
<script lang="ts" setup>
import { defineAsyncComponent, computed, inject, onMounted, onUnmounted, watch } from 'vue';
import * as Acct from 'foundkey-js/built/acct';
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import XFollowList from './follow-list.vue';
import * as os from '@/os';
import { definePageMetadata } from '@/scripts/page-metadata';
@ -27,7 +27,7 @@ const props = withDefaults(defineProps<{
}>(), {
});
let user = $ref<null | misskey.entities.UserDetailed>(null);
let user = $ref<null | foundkey.entities.UserDetailed>(null);
let error = $ref(null);
function fetchUser(): void {

View file

@ -10,12 +10,12 @@
<script lang="ts" setup>
import { computed } from 'vue';
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import MkGalleryPostPreview from '@/components/gallery-post-preview.vue';
import MkPagination from '@/components/ui/pagination.vue';
const props = withDefaults(defineProps<{
user: misskey.entities.User;
user: foundkey.entities.User;
}>(), {
});

View file

@ -109,7 +109,7 @@
<script lang="ts" setup>
import { defineAsyncComponent, onMounted, onUnmounted } from 'vue';
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import XUserTimeline from './index.timeline.vue';
import XNote from '@/components/note.vue';
import MkBirthdayDate from '@/components/birthday-date.vue';
@ -129,7 +129,7 @@ const XPhotos = defineAsyncComponent(() => import('./index.photos.vue'));
const XActivity = defineAsyncComponent(() => import('./index.activity.vue'));
const props = withDefaults(defineProps<{
user: misskey.entities.UserDetailed;
user: foundkey.entities.UserDetailed;
}>(), {
});

View file

@ -14,14 +14,14 @@
</template>
<script lang="ts" setup>
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import MkContainer from '@/components/ui/container.vue';
import MkChart from '@/components/chart.vue';
import * as os from '@/os';
import { i18n } from '@/i18n';
const props = withDefaults(defineProps<{
user: misskey.entities.User;
user: foundkey.entities.User;
limit?: number;
}>(), {
limit: 50,

View file

@ -11,14 +11,14 @@
<script lang="ts" setup>
import { ref, computed } from 'vue';
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import XNotes from '@/components/notes.vue';
import MkTab from '@/components/tab.vue';
import * as os from '@/os';
import { i18n } from '@/i18n';
const props = defineProps<{
user: misskey.entities.UserDetailed;
user: foundkey.entities.UserDetailed;
}>();
const include = ref<string | null>(null);

View file

@ -20,7 +20,7 @@
<script lang="ts" setup>
import { defineAsyncComponent, computed, watch } from 'vue';
import * as Acct from 'foundkey-js/built/acct';
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import { getUserMenu } from '@/scripts/get-user-menu';
import { acct as getAcct } from '@/filters/user';
import * as os from '@/os';
@ -45,7 +45,7 @@ const props = withDefaults(defineProps<{
const router = useRouter();
let tab = $ref(props.page);
let user = $ref<null | misskey.entities.UserDetailed>(null);
let user = $ref<null | foundkey.entities.UserDetailed>(null);
let error = $ref(null);
function fetchUser(): void {

View file

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

View file

@ -15,12 +15,12 @@
<script lang="ts" setup>
import { computed } from 'vue';
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import MkPagination from '@/components/ui/pagination.vue';
import MkNote from '@/components/note.vue';
const props = defineProps<{
user: misskey.entities.User;
user: foundkey.entities.User;
}>();
const pagination = {

View file

@ -1,5 +1,5 @@
import { defineAsyncComponent, Ref } from 'vue';
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import { $i } from '@/account';
import { i18n } from '@/i18n';
import { instance } from '@/instance';
@ -9,12 +9,12 @@ import { url } from '@/config';
import { noteActions } from '@/store';
export function getNoteMenu(props: {
note: misskey.entities.Note;
note: foundkey.entities.Note;
menuButton: Ref<HTMLElement>;
translation: Ref<any>;
translating: Ref<boolean>;
isDeleted: Ref<boolean>;
currentClipPage?: Ref<misskey.entities.Clip>;
currentClipPage?: Ref<foundkey.entities.Clip>;
}) {
const isRenote = (
props.note.renote != null &&
@ -23,7 +23,7 @@ export function getNoteMenu(props: {
props.note.poll == null
);
const appearNote = isRenote ? props.note.renote as misskey.entities.Note : props.note;
const appearNote = isRenote ? props.note.renote as foundkey.entities.Note : props.note;
function del(): void {
os.confirm({

View file

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

View file

@ -1,4 +1,4 @@
import * as misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import { ComputedRef, inject, isRef, onActivated, onMounted, provide, ref, Ref } from 'vue';
export const setPageMetadata = Symbol('setPageMetadata');
@ -8,8 +8,8 @@ export type PageMetadata = {
title: string;
subtitle?: string;
icon?: string | null;
avatar?: misskey.entities.User | null;
userName?: misskey.entities.User | null;
avatar?: foundkey.entities.User | null;
userName?: foundkey.entities.User | null;
bg?: string;
};

View file

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

View file

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

View file

@ -1,8 +1,8 @@
import * as Misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import { markRaw } from 'vue';
import { $i } from '@/account';
import { url } from '@/config';
export const stream = markRaw(new Misskey.Stream(url, $i ? {
export const stream = markRaw(new foundkey.Stream(url, $i ? {
token: $i.token,
} : null));

View file

@ -1,4 +1,4 @@
import * as Misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import { Ref } from 'vue';
export type MenuAction = (ev: MouseEvent) => void;
@ -6,11 +6,11 @@ export type MenuAction = (ev: MouseEvent) => void;
export type MenuDivider = null;
export type MenuNull = undefined;
export type MenuLabel = { type: 'label', text: string };
export type MenuLink = { type: 'link', to: string, text: string, icon?: string, indicate?: boolean, avatar?: Misskey.entities.User };
export type MenuLink = { type: 'link', to: string, text: string, icon?: string, indicate?: boolean, avatar?: foundkey.entities.User };
export type MenuA = { type: 'a', href: string, target?: string, download?: string, text: string, icon?: string, indicate?: boolean };
export type MenuUser = { type: 'user', user: Misskey.entities.User, active?: boolean, indicate?: boolean, action: MenuAction };
export type MenuUser = { type: 'user', user: foundkey.entities.User, active?: boolean, indicate?: boolean, action: MenuAction };
export type MenuSwitch = { type: 'switch', ref: Ref<boolean>, text: string, disabled?: boolean };
export type MenuButton = { type?: 'button', text: string, icon?: string, indicate?: boolean, danger?: boolean, active?: boolean, avatar?: Misskey.entities.User; action: MenuAction };
export type MenuButton = { type?: 'button', text: string, icon?: string, indicate?: boolean, danger?: boolean, active?: boolean, avatar?: foundkey.entities.User; action: MenuAction };
export type MenuPending = { type: 'pending' };

View file

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

View file

@ -4,15 +4,15 @@
*/
declare var self: ServiceWorkerGlobalScope;
import * as Misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
import { SwMessage, swMessageOrderType } from '@/types';
import { acct as getAcct } from '@/filters/user';
import { getAccountFromId } from '@/scripts/get-account-from-id';
import { getUrlWithLoginId } from '@/scripts/login-id';
export const cli = new Misskey.api.APIClient({ origin, fetch: (...args) => fetch(...args) });
export const cli = new foundkey.api.APIClient({ origin, fetch: (...args) => fetch(...args) });
export async function api<E extends keyof Misskey.Endpoints>(endpoint: E, userId: string, options?: Misskey.Endpoints[E]['req']) {
export async function api<E extends keyof foundkey.Endpoints>(endpoint: E, userId: string, options?: foundkey.Endpoints[E]['req']) {
const account = await getAccountFromId(userId);
if (!account) return;

View file

@ -1,4 +1,4 @@
import * as Misskey from 'foundkey-js';
import * as foundkey from 'foundkey-js';
export type swMessageOrderType = 'post' | 'push';
@ -12,8 +12,8 @@ export type SwMessage = {
// Defined also @/services/push-notification.ts#L7-L14
type pushNotificationDataSourceMap = {
notification: Misskey.entities.Notification;
unreadMessagingMessage: Misskey.entities.MessagingMessage;
notification: foundkey.entities.Notification;
unreadMessagingMessage: foundkey.entities.MessagingMessage;
readNotifications: { notificationIds: string[] };
readAllNotifications: undefined;
readAllMessagingMessages: undefined;