refactor: add typing to emits

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/877/head
Varun Patil 2023-10-15 15:09:43 -07:00
parent 080bf1358d
commit 74b6d9c5f2
29 changed files with 126 additions and 34 deletions

View File

@ -61,6 +61,11 @@ export default defineComponent({
},
},
emits: {
click: (item: ICluster) => true,
plus: () => true,
},
data: () => ({
recyclerWidth: 300,
}),

View File

@ -90,6 +90,10 @@ export default defineComponent({
},
},
emits: {
interactend: () => true,
},
data: () => ({
/** Last known height at adjustment */
lastAdjustHeight: 0,

View File

@ -165,6 +165,10 @@ export default defineComponent({
},
},
emits: {
updateLoading: (delta: number) => true,
},
data: () => ({
show: false,
size: 0,

View File

@ -187,6 +187,10 @@ export default defineComponent({
mixins: [UserConfig],
emits: {
'update:open': (open: boolean) => true,
},
data: () => ({
localFolders: [] as nativex.LocalFolderConfig[],
}),

View File

@ -44,9 +44,9 @@
@click="selectionManager().selectHead(item)"
/>
<template v-else>
<Photo
class="photo"
v-else
v-for="photo of item.photos"
:key="photo.key"
:style="{
@ -63,6 +63,7 @@
@touchmove="selectionManager().touchmovePhoto(photo, $event, index)"
/>
</template>
</template>
</RecycleScroller>
<!-- Managers -->
@ -135,6 +136,10 @@ export default defineComponent({
mixins: [UserConfig],
emits: {
daysLoaded: (stats: { count: number }) => true,
},
data: () => ({
/** Loading days response */
loading: 0,

View File

@ -33,6 +33,10 @@ export default defineComponent({
},
},
emits: {
update: (key: keyof ISystemConfig, value: any) => true,
},
methods: {
update(key: keyof ISystemConfig, value: any = null) {
this.$emit('update', key, value);

View File

@ -62,6 +62,10 @@ export default defineComponent({
},
},
emits: {
click: (item: ICluster) => true,
},
computed: {
previewUrl() {
if (this.error) return errorsvg;

View File

@ -96,6 +96,14 @@ export default defineComponent({
},
},
emits: {
select: (e: PointerEvent) => true,
pointerdown: (e: PointerEvent) => true,
touchstart: (e: TouchEvent) => true,
touchmove: (e: TouchEvent) => true,
touchend: (e: TouchEvent) => true,
},
data: () => ({
touchTimer: 0,
faceSrc: null as string | null,

View File

@ -36,6 +36,10 @@ export default defineComponent({
},
},
emits: {
click: (item: IHeadRow) => true,
},
computed: {
name() {
// Check cache

View File

@ -29,6 +29,11 @@ export default defineComponent({
},
},
emits: {
load: (src: string) => true,
error: (error: Error) => true,
},
data: () => {
return {
dataSrc: BLANK_IMG,

View File

@ -37,6 +37,8 @@ export default defineComponent({
AlbumPicker,
},
emits: [],
data: () => ({
show: false,
photos: [] as IPhoto[],
@ -66,7 +68,6 @@ export default defineComponent({
this.show = false;
this.photos = [];
this.opsTotal = 0;
this.$emit('close');
},
routeIsAlbum(album: IAlbum) {

View File

@ -31,6 +31,8 @@ export default defineComponent({
AlbumForm,
},
emits: [],
data: () => ({
show: false,
album: null as any,
@ -59,7 +61,6 @@ export default defineComponent({
close() {
this.show = false;
this.$emit('close');
},
done({ album }: { album: { basename: string; filename: string } }) {

View File

@ -40,6 +40,8 @@ export default defineComponent({
Modal,
},
emits: [],
data: () => ({
show: false,
user: '',
@ -65,7 +67,6 @@ export default defineComponent({
methods: {
close() {
this.show = false;
this.$emit('close');
},
open() {

View File

@ -124,6 +124,11 @@ export default defineComponent({
},
},
emits: {
done: (album: any) => true,
back: () => true,
},
data: () => ({
collaborators: [],
showCollaboratorView: false,

View File

@ -55,7 +55,7 @@
<span class="remove-notice" v-if="deselection.size > 0">
{{
n('memories', 'Removed from {n} album', 'Removed from {n} albums', deselection.size, {
n: this.deselection.size,
n: deselection.size,
})
}}
</span>
@ -106,6 +106,11 @@ export default defineComponent({
default: false,
},
},
emits: {
select: (selection: IAlbum[], deselection: IAlbum[]) => true,
},
components: {
AlbumForm,
AlbumsList,

View File

@ -47,6 +47,8 @@ export default defineComponent({
AlbumCollaborators,
},
emits: [],
data: () => ({
album: null as any,
show: false,
@ -58,7 +60,6 @@ export default defineComponent({
close() {
this.show = false;
this.album = null;
this.$emit('close');
},
async open() {

View File

@ -63,6 +63,10 @@ export default defineComponent({
},
},
emits: {
click: (item: IAlbum) => true,
},
methods: {
click($event: Event, album: IAlbum) {
if (!this.link) {

View File

@ -50,6 +50,10 @@ export default defineComponent({
},
},
emits: {
save: () => true,
},
data: () => ({
exif: null as Record<keyof IExif, string> | null,
dirty: {} as Record<keyof IExif, boolean>,

View File

@ -35,6 +35,8 @@ export default defineComponent({
Modal,
},
emits: [],
data: () => ({
show: false,
user: '',
@ -54,7 +56,6 @@ export default defineComponent({
methods: {
close() {
this.show = false;
this.$emit('close');
},
open() {

View File

@ -45,6 +45,8 @@ export default defineComponent({
Modal,
},
emits: [],
data: () => ({
show: false,
user: '',
@ -71,7 +73,6 @@ export default defineComponent({
methods: {
close() {
this.show = false;
this.$emit('close');
},
open() {

View File

@ -54,6 +54,10 @@ export default defineComponent({
},
},
emits: {
select: (face: IFace) => true,
},
data: () => ({
user: String(),
name: String(),
@ -80,10 +84,6 @@ export default defineComponent({
},
methods: {
close() {
this.$emit('close');
},
async refreshParams() {
this.user = <string>this.$route.params.user || '';
this.name = <string>this.$route.params.name || '';

View File

@ -48,6 +48,8 @@ export default defineComponent({
FaceList,
},
emits: [],
data: () => ({
processing: 0,
processingTotal: 0,
@ -57,7 +59,6 @@ export default defineComponent({
methods: {
close() {
this.show = false;
this.$emit('close');
},
open() {

View File

@ -41,6 +41,8 @@ export default defineComponent({
FaceList,
},
emits: [],
data: () => ({
show: false,
photos: [] as IPhoto[],
@ -76,7 +78,6 @@ export default defineComponent({
close() {
this.photos = [];
this.show = false;
this.$emit('close');
},
moved(photos: IPhoto[]) {

View File

@ -26,6 +26,8 @@ import { defineComponent } from 'vue';
import * as utils from '../../services/utils';
import type { PropType } from 'vue';
const NcModal = () => import('@nextcloud/vue/dist/Components/NcModal');
export default defineComponent({
@ -40,7 +42,7 @@ export default defineComponent({
default: 'small',
},
sidebar: {
type: String,
type: String as PropType<string | null>,
default: null,
},
},

View File

@ -58,6 +58,10 @@ export default defineComponent({
},
},
emits: {
close: (list: string[]) => true,
},
data: () => ({
show: false,
paths: [] as string[],

View File

@ -1,5 +1,5 @@
<template>
<Modal @close="close" size="normal" v-if="show" :sidebar="!isRoot && !isMobile ? this.filename : null">
<Modal @close="close" size="normal" v-if="show" :sidebar="!isRoot && !isMobile ? filename : null">
<template #title>
{{ t('memories', 'Link Sharing') }}
</template>
@ -102,6 +102,8 @@ export default defineComponent({
mixins: [UserConfig],
emits: [],
data: () => ({
show: false,
filename: '',
@ -158,7 +160,6 @@ export default defineComponent({
close() {
this.show = false;
this.$emit('close');
},
async refreshUrls() {

View File

@ -23,6 +23,10 @@ export default defineComponent({
mixins: [UserMixin],
emits: {
load: () => true,
},
computed: {
currentmatter(): Component | null {
if (this.routeIsFolders) {

View File

@ -59,6 +59,10 @@ export default defineComponent({
RightMoveIcon,
},
emits: {
load: () => true,
},
data: () => ({
years: [] as IYear[],
hasRight: false,

View File

@ -44,6 +44,10 @@ export default defineComponent({
},
},
emits: {
close: () => true,
},
data: () => ({
exif: null as Object | null,
imageEditor: null as FilerobotImageEditor | null,