mirror of
https://github.com/defnull/fediwall.git
synced 2024-11-21 23:23:14 +01:00
Moved common types to separate file
This commit is contained in:
parent
5375a2764a
commit
a0157e508f
@ -1,12 +1,13 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, inject, onBeforeUnmount, onMounted, onUpdated, ref, watch } from 'vue';
|
||||
import Card, { type Post } from './components/Card.vue';
|
||||
import Card from './components/Card.vue';
|
||||
import { useDocumentVisibility, usePreferredDark, useWindowSize, watchDebounced } from '@vueuse/core'
|
||||
import ConfigModal from './components/ConfigModal.vue';
|
||||
import { loadConfig, type Config } from './config';
|
||||
import { loadConfig } from './config';
|
||||
import InfoBar from './components/InfoBar.vue';
|
||||
import { gitVersion } from '@/defaults'
|
||||
import { regexEscape } from '@/utils'
|
||||
import {type Config, type Post} from '@/types';
|
||||
|
||||
const config = ref<Config>();
|
||||
|
||||
|
@ -2,22 +2,7 @@
|
||||
import { useIntervalFn } from '@vueuse/core'
|
||||
import { ref } from 'vue';
|
||||
import moment from 'moment'
|
||||
|
||||
export type Post = {
|
||||
id: string;
|
||||
url: string;
|
||||
content: string;
|
||||
date: string;
|
||||
|
||||
author?: {
|
||||
name: string;
|
||||
avatar?: string;
|
||||
url?: string;
|
||||
};
|
||||
|
||||
media?: string;
|
||||
pinned?: boolean;
|
||||
};
|
||||
import { type Post } from '@/types';
|
||||
|
||||
const props = defineProps<{
|
||||
post: Post
|
||||
|
@ -1,8 +1,9 @@
|
||||
<script setup lang="ts">
|
||||
import { sanatizeConfig, isServer, isLanguage, toQuery, type Config } from '@/config';
|
||||
import { sanatizeConfig, isServer, isLanguage, toQuery } from '@/config';
|
||||
import { computed, ref } from 'vue';
|
||||
import { arrayUnique } from '@/utils';
|
||||
import { useClipboard } from '@vueuse/core'
|
||||
import {type Config} from '@/types';
|
||||
|
||||
const emit = defineEmits(['update:modelValue'])
|
||||
const modalDom = ref(null)
|
||||
|
@ -1,6 +1,5 @@
|
||||
<script setup lang="ts">
|
||||
import { type Config } from '@/config';
|
||||
import { ref } from 'vue';
|
||||
import { type Config } from '@/types';
|
||||
|
||||
const props = defineProps<{
|
||||
config: Config
|
||||
|
@ -1,34 +1,9 @@
|
||||
|
||||
import { arrayUnique, deepClone, isString } from "./utils";
|
||||
import { fallbackConfig, siteConfigUrl } from "@/defaults";
|
||||
import {type Config} from '@/types';
|
||||
|
||||
export type Config = {
|
||||
servers: Array<string>,
|
||||
tags: Array<string>,
|
||||
accounts: Array<string>,
|
||||
|
||||
loadPublic: boolean,
|
||||
loadFederated: boolean,
|
||||
loadTrends: boolean,
|
||||
|
||||
languages: Array<string>,
|
||||
badWords: Array<string>,
|
||||
hideSensitive: boolean,
|
||||
hideBoosts: boolean,
|
||||
hideReplies: boolean,
|
||||
hideBots: boolean,
|
||||
|
||||
limit: number,
|
||||
interval: number,
|
||||
|
||||
title: string,
|
||||
theme: string,
|
||||
showInfobar: boolean,
|
||||
|
||||
showText: boolean,
|
||||
showMedia: boolean,
|
||||
playVideos: boolean,
|
||||
}
|
||||
|
||||
var siteConfig: Config | null = null;
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
|
||||
import type { Config } from "./config"
|
||||
import {type Config} from '@/types';
|
||||
|
||||
// Fallback configuration in case the site config fails to load or is missing required fields.
|
||||
// TODO: Maybe just fail in that case and not hard-code mastodon.social?
|
||||
|
43
src/types.ts
Normal file
43
src/types.ts
Normal file
@ -0,0 +1,43 @@
|
||||
export type Post = {
|
||||
id: string;
|
||||
url: string;
|
||||
content: string;
|
||||
date: string;
|
||||
|
||||
author?: {
|
||||
name: string;
|
||||
avatar?: string;
|
||||
url?: string;
|
||||
};
|
||||
|
||||
media?: string;
|
||||
pinned?: boolean;
|
||||
};
|
||||
|
||||
export type Config = {
|
||||
servers: Array<string>,
|
||||
tags: Array<string>,
|
||||
accounts: Array<string>,
|
||||
|
||||
loadPublic: boolean,
|
||||
loadFederated: boolean,
|
||||
loadTrends: boolean,
|
||||
|
||||
languages: Array<string>,
|
||||
badWords: Array<string>,
|
||||
hideSensitive: boolean,
|
||||
hideBoosts: boolean,
|
||||
hideReplies: boolean,
|
||||
hideBots: boolean,
|
||||
|
||||
limit: number,
|
||||
interval: number,
|
||||
|
||||
title: string,
|
||||
theme: string,
|
||||
showInfobar: boolean,
|
||||
|
||||
showText: boolean,
|
||||
showMedia: boolean,
|
||||
playVideos: boolean,
|
||||
}
|
Loading…
Reference in New Issue
Block a user