mirror of
https://github.com/misskey-dev/misskey.git
synced 2026-05-20 05:55:29 +02:00
refactor: make noImplicitAny true (#17083)
* wip * Update emojis.emoji.vue * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * Update manager.ts * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * wip * Update analytics.ts
This commit is contained in:
@@ -46,6 +46,6 @@ const parsed = computed(() => {
|
||||
});
|
||||
|
||||
const render = () => {
|
||||
return h(props.tag, parsed.value.map(x => typeof x === 'string' ? (props.textTag ? h(props.textTag, x) : x) : slots[x.arg]()));
|
||||
return h(props.tag, parsed.value.map(x => typeof x === 'string' ? (props.textTag ? h(props.textTag, x) : x) : (slots as any)[x.arg]()));
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -48,7 +48,7 @@ const active = computed(() => {
|
||||
return resolved.route.name === router.currentRoute.value.name;
|
||||
});
|
||||
|
||||
function onContextmenu(ev) {
|
||||
function onContextmenu(ev: PointerEvent) {
|
||||
const selection = window.getSelection();
|
||||
if (selection && selection.toString() !== '') return;
|
||||
os.contextMenu([{
|
||||
@@ -85,7 +85,7 @@ function openWindow() {
|
||||
os.pageWindow(props.to);
|
||||
}
|
||||
|
||||
function nav(ev: MouseEvent) {
|
||||
function nav(ev: PointerEvent) {
|
||||
// 制御キーとの組み合わせは無視(shiftを除く)
|
||||
if (ev.metaKey || ev.altKey || ev.ctrlKey) return;
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ const props = withDefaults(defineProps<{
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
(ev: 'click', v: MouseEvent): void;
|
||||
(ev: 'click', v: PointerEvent): void;
|
||||
}>();
|
||||
|
||||
const showDecoration = props.forceShowDecoration || prefer.s.showAvatarDecorations;
|
||||
@@ -91,7 +91,7 @@ const url = computed(() => {
|
||||
return props.user.avatarUrl;
|
||||
});
|
||||
|
||||
function onClick(ev: MouseEvent): void {
|
||||
function onClick(ev: PointerEvent): void {
|
||||
if (props.link) return;
|
||||
emit('click', ev);
|
||||
}
|
||||
|
||||
@@ -23,8 +23,8 @@ const observer = new ResizeObserver((entries) => {
|
||||
transform: string;
|
||||
}[] = [];
|
||||
for (const entry of entries) {
|
||||
const content = (entry.target[contentSymbol] ? entry.target : entry.target.firstElementChild) as HTMLSpanElement;
|
||||
const props: Required<Props> = content[contentSymbol];
|
||||
const content = ((entry.target as any)[contentSymbol] ? entry.target : entry.target.firstElementChild) as HTMLSpanElement;
|
||||
const props: Required<Props> = (content as any)[contentSymbol];
|
||||
const container = content.parentElement as HTMLSpanElement;
|
||||
const contentWidth = content.getBoundingClientRect().width;
|
||||
const containerWidth = container.getBoundingClientRect().width;
|
||||
@@ -46,15 +46,15 @@ const props = withDefaults(defineProps<Props>(), {
|
||||
const content = ref<HTMLSpanElement>();
|
||||
|
||||
watch(content, (value, oldValue) => {
|
||||
if (oldValue) {
|
||||
delete oldValue[contentSymbol];
|
||||
if (oldValue != null) {
|
||||
delete (oldValue as any)[contentSymbol];
|
||||
observer.unobserve(oldValue);
|
||||
if (oldValue.parentElement) {
|
||||
observer.unobserve(oldValue.parentElement);
|
||||
}
|
||||
}
|
||||
if (value) {
|
||||
value[contentSymbol] = props;
|
||||
if (value != null) {
|
||||
(value as any)[contentSymbol] = props;
|
||||
observer.observe(value);
|
||||
if (value.parentElement) {
|
||||
observer.observe(value.parentElement);
|
||||
|
||||
@@ -102,7 +102,7 @@ const url = computed(() => {
|
||||
const alt = computed(() => `:${customEmojiName.value}:`);
|
||||
const errored = ref(url.value == null);
|
||||
|
||||
function onClick(ev: MouseEvent) {
|
||||
function onClick(ev: PointerEvent) {
|
||||
if (props.menu) {
|
||||
const menuItems: MenuItem[] = [];
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ function unmute() {
|
||||
});
|
||||
}
|
||||
|
||||
function onClick(ev: MouseEvent) {
|
||||
function onClick(ev: PointerEvent) {
|
||||
if (props.menu) {
|
||||
const menuItems: MenuItem[] = [];
|
||||
|
||||
|
||||
@@ -319,7 +319,7 @@ export default function (props: MfmProps, { emit }: { emit: SetupContext<MfmEven
|
||||
]);
|
||||
}
|
||||
case 'clickable': {
|
||||
return h('span', { onClick(ev: MouseEvent): void {
|
||||
return h('span', { onClick(ev: PointerEvent): void {
|
||||
ev.stopPropagation();
|
||||
ev.preventDefault();
|
||||
const clickEv = typeof token.props.args.ev === 'string' ? token.props.args.ev : '';
|
||||
|
||||
@@ -46,7 +46,7 @@ SPDX-License-Identifier: AGPL-3.0-only
|
||||
<script lang="ts">
|
||||
export type Tab = {
|
||||
key: string;
|
||||
onClick?: (ev: MouseEvent) => void;
|
||||
onClick?: (ev: PointerEvent) => void;
|
||||
iconOnly?: boolean;
|
||||
title: string;
|
||||
icon?: string;
|
||||
@@ -70,8 +70,8 @@ const props = withDefaults(defineProps<{
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
(ev: 'update:tab', key: string);
|
||||
(ev: 'tabClick', key: string);
|
||||
(ev: 'update:tab', key: string): void;
|
||||
(ev: 'tabClick', key: string): void;
|
||||
}>();
|
||||
|
||||
const el = useTemplateRef('el');
|
||||
@@ -96,7 +96,7 @@ function onTabMousedown(tab: Tab, ev: MouseEvent): void {
|
||||
}
|
||||
}
|
||||
|
||||
function onTabClick(t: Tab, ev: MouseEvent): void {
|
||||
function onTabClick(t: Tab, ev: PointerEvent): void {
|
||||
emit('tabClick', t.key);
|
||||
|
||||
if (t.onClick) {
|
||||
|
||||
@@ -61,7 +61,6 @@ export type PageHeaderProps = {
|
||||
import { onMounted, onUnmounted, ref, inject, useTemplateRef, computed } from 'vue';
|
||||
import { scrollToTop } from '@@/js/scroll.js';
|
||||
import XTabs from './MkPageHeader.tabs.vue';
|
||||
import { globalEvents } from '@/events.js';
|
||||
import { getAccountMenu } from '@/accounts.js';
|
||||
import { $i } from '@/i.js';
|
||||
import { DI } from '@/di.js';
|
||||
@@ -72,7 +71,7 @@ const props = withDefaults(defineProps<PageHeaderProps>(), {
|
||||
});
|
||||
|
||||
const emit = defineEmits<{
|
||||
(ev: 'update:tab', key: string);
|
||||
(ev: 'update:tab', key: string): void;
|
||||
}>();
|
||||
|
||||
//const viewId = inject(DI.viewId);
|
||||
@@ -100,7 +99,7 @@ const top = () => {
|
||||
}
|
||||
};
|
||||
|
||||
async function openAccountMenu(ev: MouseEvent) {
|
||||
async function openAccountMenu(ev: PointerEvent) {
|
||||
const menuItems = await getAccountMenu({
|
||||
withExtraOperation: true,
|
||||
});
|
||||
|
||||
@@ -32,7 +32,7 @@ function _closeTip() {
|
||||
closeTip(props.k);
|
||||
}
|
||||
|
||||
function showMenu(ev: MouseEvent) {
|
||||
function showMenu(ev: PointerEvent) {
|
||||
os.popupMenu([{
|
||||
icon: 'ti ti-bulb-off',
|
||||
text: i18n.ts.hideAllTips,
|
||||
|
||||
Reference in New Issue
Block a user