mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Mark [] and {} in the data option with a more specific type
Signed-off-by: timongh <46739861+timongh@users.noreply.github.com>
This commit is contained in:
parent
f0d24bd652
commit
accae5d047
@ -64,8 +64,8 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
medalList: [],
|
medalList: [] as Medal[],
|
||||||
titleList: [],
|
titleList: [] as Title[],
|
||||||
medalOpen: false,
|
medalOpen: false,
|
||||||
titleOpen: false,
|
titleOpen: false,
|
||||||
grayEffect: true,
|
grayEffect: true,
|
||||||
|
|||||||
@ -49,7 +49,7 @@ export default Vue.extend({
|
|||||||
return {
|
return {
|
||||||
initItems,
|
initItems,
|
||||||
items: getItems(),
|
items: getItems(),
|
||||||
styles: [],
|
styles: [] as string[],
|
||||||
height: CustomNavbarItem.navbarOptions.height,
|
height: CustomNavbarItem.navbarOptions.height,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -36,7 +36,7 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
folders: [],
|
folders: [] as FavoritesFolder[],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
|
|||||||
@ -163,8 +163,8 @@ const ThisComponent = Vue.extend({
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: true,
|
loading: true,
|
||||||
cards: [],
|
cards: [] as FavoritesItemInfo[],
|
||||||
filteredCards: [],
|
filteredCards: [] as FavoritesItemInfo[],
|
||||||
page: 1,
|
page: 1,
|
||||||
hasMorePage: true,
|
hasMorePage: true,
|
||||||
searchPage: 1,
|
searchPage: 1,
|
||||||
|
|||||||
@ -29,20 +29,20 @@ export default Vue.extend({
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: true,
|
loading: true,
|
||||||
rawItems: [],
|
rawItems: [] as unknown[],
|
||||||
hasMorePage: true,
|
hasMorePage: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
cards(): LiveFeedItem[] {
|
cards(): LiveFeedItem[] {
|
||||||
const parseLiveCard = (card: any) => ({
|
const parseLiveCard = (card: unknown) => ({
|
||||||
id: card.roomid,
|
id: card.roomid,
|
||||||
title: card.title,
|
title: card.title,
|
||||||
upFaceUrl: card.face,
|
upFaceUrl: card.face,
|
||||||
upName: card.uname,
|
upName: card.uname,
|
||||||
url: card.link,
|
url: card.link,
|
||||||
})
|
})
|
||||||
return (this.rawItems as any[]).map(parseLiveCard)
|
return this.rawItems.map(parseLiveCard)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
|
|||||||
@ -27,13 +27,13 @@ export const nextPageMixin = <MappedItem extends { id: string }, RawItem>(
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: true,
|
loading: true,
|
||||||
cards: [],
|
cards: [] as MappedItem[],
|
||||||
hasMorePage: true,
|
hasMorePage: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
sortedCards(): MappedItem[] {
|
sortedCards(): MappedItem[] {
|
||||||
return ([...this.cards] as MappedItem[]).sort(descendingStringSort(it => it.id))
|
return [...this.cards].sort(descendingStringSort(it => it.id))
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
async created() {
|
async created() {
|
||||||
|
|||||||
@ -138,8 +138,8 @@ const ThisComponent = Vue.extend({
|
|||||||
types,
|
types,
|
||||||
search: '',
|
search: '',
|
||||||
viewTime: 0,
|
viewTime: 0,
|
||||||
cards: [],
|
cards: [] as HistoryItem[],
|
||||||
groups: [],
|
groups: [] as { name: string; items: HistoryItem[] }[],
|
||||||
loading: true,
|
loading: true,
|
||||||
hasMorePage: true,
|
hasMorePage: true,
|
||||||
paused: false,
|
paused: false,
|
||||||
|
|||||||
@ -95,7 +95,7 @@ export default Vue.extend({
|
|||||||
return {
|
return {
|
||||||
loading: true,
|
loading: true,
|
||||||
hasMorePage: true,
|
hasMorePage: true,
|
||||||
cards: [],
|
cards: [] as any[],
|
||||||
page: 1,
|
page: 1,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -116,7 +116,7 @@ export default Vue.extend({
|
|||||||
}
|
}
|
||||||
const cards = lodash
|
const cards = lodash
|
||||||
.uniqBy(
|
.uniqBy(
|
||||||
(this.cards as any[]).concat(
|
this.cards.concat(
|
||||||
(lodash.get(json, 'data.list') as any[]).map(item => ({
|
(lodash.get(json, 'data.list') as any[]).map(item => ({
|
||||||
title: item.title,
|
title: item.title,
|
||||||
coverUrl: item.square_cover.replace('http:', 'https:'),
|
coverUrl: item.square_cover.replace('http:', 'https:'),
|
||||||
|
|||||||
@ -173,8 +173,8 @@ export default Vue.extend({
|
|||||||
mixins: [popperMixin],
|
mixins: [popperMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
userInfo: {},
|
userInfo: {} as any,
|
||||||
stat: {},
|
stat: {} as any,
|
||||||
isLogin: Boolean(getUID()),
|
isLogin: Boolean(getUID()),
|
||||||
privileges: {
|
privileges: {
|
||||||
bCoin: {
|
bCoin: {
|
||||||
|
|||||||
@ -88,8 +88,8 @@ const ThisComponent = Vue.extend({
|
|||||||
return {
|
return {
|
||||||
watchlaterList,
|
watchlaterList,
|
||||||
loading: true,
|
loading: true,
|
||||||
cards: [],
|
cards: [] as WatchlaterCard[],
|
||||||
filteredCards: [],
|
filteredCards: [] as WatchlaterCard[],
|
||||||
search: '',
|
search: '',
|
||||||
redirect: redirect.enabled && redirect.options.navbar,
|
redirect: redirect.enabled && redirect.options.navbar,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,7 +53,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { VButton, VIcon, DpiImage } from '@/ui'
|
import { VButton, VIcon, DpiImage } from '@/ui'
|
||||||
import { getBlackboards } from './api'
|
import { Blackboard, getBlackboards } from './api'
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
components: {
|
components: {
|
||||||
@ -63,7 +63,7 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
blackboards: [],
|
blackboards: [] as Blackboard[],
|
||||||
timer: 0,
|
timer: 0,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -84,7 +84,7 @@ export default Vue.extend({
|
|||||||
return {
|
return {
|
||||||
tabs,
|
tabs,
|
||||||
selectedTab: tabs[0],
|
selectedTab: tabs[0],
|
||||||
videos: [],
|
videos: [] as VideoCard[],
|
||||||
loading: true,
|
loading: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -22,6 +22,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import type { VideoCard } from '@/components/feeds/video-card'
|
||||||
import { VButton, VIcon } from '@/ui'
|
import { VButton, VIcon } from '@/ui'
|
||||||
import VideoList from '../../VideoList.vue'
|
import VideoList from '../../VideoList.vue'
|
||||||
import { freshHomeOptions } from '../../types'
|
import { freshHomeOptions } from '../../types'
|
||||||
@ -35,7 +36,7 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
videos: [],
|
videos: [] as VideoCard[],
|
||||||
loading: true,
|
loading: true,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -22,7 +22,7 @@ export default Vue.extend({
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: true,
|
loading: true,
|
||||||
cards: [],
|
cards: [] as VideoCard[],
|
||||||
error: false,
|
error: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -23,7 +23,7 @@ export default Vue.extend({
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
loading: true,
|
loading: true,
|
||||||
cards: [],
|
cards: [] as VideoCard[],
|
||||||
error: false,
|
error: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -18,7 +18,7 @@ export const requestMixin = (
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
items: [],
|
items: [] as unknown[],
|
||||||
loading: true,
|
loading: true,
|
||||||
error: false,
|
error: false,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,7 +40,7 @@ export default Vue.extend({
|
|||||||
return {
|
return {
|
||||||
busy: false,
|
busy: false,
|
||||||
autoUpdateComponents: autoUpdateOptions.urls.components,
|
autoUpdateComponents: autoUpdateOptions.urls.components,
|
||||||
sessions: [],
|
sessions: [] as string[],
|
||||||
isConnected: false,
|
isConnected: false,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@ -173,11 +173,11 @@ export default Vue.extend({
|
|||||||
multiple: false,
|
multiple: false,
|
||||||
},
|
},
|
||||||
assets,
|
assets,
|
||||||
qualities: [],
|
qualities: [] as VideoQuality[],
|
||||||
selectedQuality: undefined,
|
selectedQuality: undefined,
|
||||||
inputs: [],
|
inputs: [] as DownloadVideoInput[],
|
||||||
selectedInput: undefined,
|
selectedInput: undefined,
|
||||||
apis: [],
|
apis: [] as DownloadVideoApi[],
|
||||||
selectedApi: undefined,
|
selectedApi: undefined,
|
||||||
outputs,
|
outputs,
|
||||||
selectedOutput: outputs.find(it => it.name === lastOutput) || outputs[0],
|
selectedOutput: outputs.find(it => it.name === lastOutput) || outputs[0],
|
||||||
|
|||||||
@ -72,7 +72,7 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
episodeItems: [],
|
episodeItems: [] as EpisodeItem[],
|
||||||
maxCheckedItems: 32,
|
maxCheckedItems: 32,
|
||||||
lastCheckedEpisodeIndex: -1,
|
lastCheckedEpisodeIndex: -1,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -53,7 +53,7 @@ export default Vue.extend({
|
|||||||
tipText: '',
|
tipText: '',
|
||||||
tipShowing: false,
|
tipShowing: false,
|
||||||
tipHandle: 0,
|
tipHandle: 0,
|
||||||
lists: [],
|
lists: [] as { title: string; id: number }[],
|
||||||
selectedFavorite: '<未选择>',
|
selectedFavorite: '<未选择>',
|
||||||
listShowing: false,
|
listShowing: false,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,7 +47,7 @@ export default Vue.extend({
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
isRecording: true,
|
isRecording: true,
|
||||||
danmakus: [],
|
danmakus: [] as LiveDanmaku[],
|
||||||
opened: false,
|
opened: false,
|
||||||
collapsed: false,
|
collapsed: false,
|
||||||
loading: true,
|
loading: true,
|
||||||
|
|||||||
@ -125,10 +125,11 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { DpiImage, VIcon } from '@/ui'
|
import type { PropType } from 'vue'
|
||||||
|
import { toggleWatchlater, watchlaterList } from '@/components/video/watchlater'
|
||||||
import { getUID } from '@/core/utils'
|
import { getUID } from '@/core/utils'
|
||||||
import { watchlaterList, toggleWatchlater } from '@/components/video/watchlater'
|
import { DpiImage, VIcon } from '@/ui'
|
||||||
import { Cooperation } from './video-card'
|
import type { VideoCard as VideoCardData, Cooperation, Topic } from './video-card'
|
||||||
|
|
||||||
/*
|
/*
|
||||||
============
|
============
|
||||||
@ -143,7 +144,7 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
props: {
|
props: {
|
||||||
data: {
|
data: {
|
||||||
type: Object,
|
type: Object as PropType<VideoCardData>,
|
||||||
required: true,
|
required: true,
|
||||||
},
|
},
|
||||||
orientation: {
|
orientation: {
|
||||||
@ -169,10 +170,10 @@ export default Vue.extend({
|
|||||||
coins: '',
|
coins: '',
|
||||||
favorites: '',
|
favorites: '',
|
||||||
dynamic: '',
|
dynamic: '',
|
||||||
topics: [],
|
topics: [] as Topic[],
|
||||||
upID: 0,
|
upID: 0,
|
||||||
epID: 0,
|
epID: 0,
|
||||||
cooperation: [],
|
cooperation: [] as Cooperation[],
|
||||||
pubTime: 0,
|
pubTime: 0,
|
||||||
pubTimeText: '',
|
pubTimeText: '',
|
||||||
...lodash.omit(this.data, 'watchlater'),
|
...lodash.omit(this.data, 'watchlater'),
|
||||||
|
|||||||
@ -1,3 +1,7 @@
|
|||||||
|
export interface Topic {
|
||||||
|
id: number
|
||||||
|
name: string
|
||||||
|
}
|
||||||
export interface Cooperation {
|
export interface Cooperation {
|
||||||
id: number
|
id: number
|
||||||
name: string
|
name: string
|
||||||
@ -26,10 +30,7 @@ export interface VideoCard {
|
|||||||
favorites?: string
|
favorites?: string
|
||||||
timestamp?: number
|
timestamp?: number
|
||||||
time?: Date
|
time?: Date
|
||||||
topics?: {
|
topics?: Topic[]
|
||||||
id: number
|
|
||||||
name: string
|
|
||||||
}[]
|
|
||||||
type?: string
|
type?: string
|
||||||
points?: number
|
points?: number
|
||||||
watchlater?: boolean
|
watchlater?: boolean
|
||||||
|
|||||||
@ -48,7 +48,7 @@ export default Vue.extend({
|
|||||||
result: '',
|
result: '',
|
||||||
working: false,
|
working: false,
|
||||||
translateProviders,
|
translateProviders,
|
||||||
activeTranslator: {},
|
activeTranslator: {} as MachineTranslateProvider,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|||||||
@ -139,7 +139,10 @@ const ThisComponent = Vue.extend({
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
recommended,
|
recommended,
|
||||||
actions: [],
|
actions: [] as ({
|
||||||
|
key: string
|
||||||
|
provider: LaunchBarActionProvider
|
||||||
|
} & LaunchBarAction)[],
|
||||||
keyword: '',
|
keyword: '',
|
||||||
noActions: false,
|
noActions: false,
|
||||||
}
|
}
|
||||||
|
|||||||
@ -101,7 +101,7 @@ export default Vue.extend({
|
|||||||
components,
|
components,
|
||||||
renderedComponents: components.filter(c => !c.hidden),
|
renderedComponents: components.filter(c => !c.hidden),
|
||||||
selectedComponent: null,
|
selectedComponent: null,
|
||||||
selectedComponents: [],
|
selectedComponents: [] as ComponentMetadata[],
|
||||||
componentDetailOpen: false,
|
componentDetailOpen: false,
|
||||||
collapsed: false,
|
collapsed: false,
|
||||||
peek: false,
|
peek: false,
|
||||||
@ -112,8 +112,7 @@ export default Vue.extend({
|
|||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
isComponentSelected(): (name: string) => boolean {
|
isComponentSelected(): (name: string) => boolean {
|
||||||
return (name: string) =>
|
return (name: string) => this.selectedComponents.some(c => c.name === name)
|
||||||
this.selectedComponents.some((c: ComponentMetadata) => c.name === name)
|
|
||||||
},
|
},
|
||||||
tags(): (ComponentTag & { count: number })[] {
|
tags(): (ComponentTag & { count: number })[] {
|
||||||
const renderedComponents = this.renderedComponents as ComponentMetadata[]
|
const renderedComponents = this.renderedComponents as ComponentMetadata[]
|
||||||
@ -184,7 +183,7 @@ export default Vue.extend({
|
|||||||
this.selectedComponents = list.slice(startIdx, endIdx + 1)
|
this.selectedComponents = list.slice(startIdx, endIdx + 1)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const selectedList = this.selectedComponents as ComponentMetadata[]
|
const selectedList = this.selectedComponents
|
||||||
const selectedComponent = selectedList.find(c => c.name === component.name)
|
const selectedComponent = selectedList.find(c => c.name === component.name)
|
||||||
if (selectedComponent) {
|
if (selectedComponent) {
|
||||||
deleteValue(selectedList, c => c.name === selectedComponent.name)
|
deleteValue(selectedList, c => c.name === selectedComponent.name)
|
||||||
|
|||||||
@ -127,7 +127,7 @@ export default Vue.extend({
|
|||||||
batchAddShow: false,
|
batchAddShow: false,
|
||||||
batchUrl: '',
|
batchUrl: '',
|
||||||
excludeBuiltIn: true,
|
excludeBuiltIn: true,
|
||||||
debouncedList: [],
|
debouncedList: [] as unknown[]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
|
|||||||
@ -43,7 +43,7 @@ export default Vue.extend({
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
removeConfirm: false,
|
removeConfirm: false,
|
||||||
settings: {},
|
settings: {} as { enabled: boolean },
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
|
|||||||
@ -137,10 +137,10 @@ const ThisComponent = Vue.extend({
|
|||||||
searchKeyword: '',
|
searchKeyword: '',
|
||||||
popupOpen: false,
|
popupOpen: false,
|
||||||
loading: false,
|
loading: false,
|
||||||
list: [],
|
list: [] as DocSourceItem[],
|
||||||
itemFilter: ItemFilter.All,
|
itemFilter: ItemFilter.All,
|
||||||
itemFilterOptions,
|
itemFilterOptions,
|
||||||
filteredList: [],
|
filteredList: [] as DocSourceItem[],
|
||||||
// packList: [],
|
// packList: [],
|
||||||
fuse: null,
|
fuse: null,
|
||||||
registryBranches,
|
registryBranches,
|
||||||
|
|||||||
@ -50,7 +50,7 @@ export default Vue.extend({
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
open: false,
|
open: false,
|
||||||
closeListeners: [],
|
closeListeners: [] as (() => void)[],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
@ -5,13 +5,15 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
import type { Toast } from '@/core/toast/index'
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
components: {
|
components: {
|
||||||
ToastCard: () => import('./ToastCard.vue').then(m => m.default),
|
ToastCard: () => import('./ToastCard.vue').then(m => m.default),
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
cards: [],
|
cards: [] as Toast[],
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user