misc: update imports for types
This commit is contained in:
77 files changed
+88
-76
No files matched your search
@@ -2,7 +2,7 @@ import { profile } from '$lib/auth.svelte'
|
||||
import { DEFAULT_INSTANCE_URL } from '$lib/instance.svelte.js'
|
||||
import { instanceToURL } from '$lib/util.svelte'
|
||||
import { error } from '@sveltejs/kit'
|
||||
import { type GetSiteResponse } from 'lemmy-js-client'
|
||||
import { type GetSiteResponse } from '$lib/client/types'
|
||||
import { LemmyClient } from './lemmy/lemmy'
|
||||
import { PiefedClient } from './piefed/piefed'
|
||||
import { DEFAULT_CLIENT_TYPE, type ClientType } from './base'
|
||||
|
||||
@@ -1546,6 +1546,7 @@ export interface Person {
|
||||
bot_account: boolean
|
||||
ban_expires?: string
|
||||
instance_id: InstanceId
|
||||
flair?: string
|
||||
}
|
||||
|
||||
export interface PersonAggregates {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||
import { getClient } from '$lib/client/lemmy.svelte'
|
||||
import type { Community, ListingType } from 'lemmy-js-client'
|
||||
import type { Community, ListingType } from '$lib/client/types'
|
||||
import { MenuButton, Search } from 'mono-svelte'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import { Icon, ServerStack, XCircle } from 'svelte-hero-icons'
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { instance } from '$lib/instance.svelte'
|
||||
import { client } from '$lib/client/lemmy.svelte'
|
||||
import { instanceToURL } from '$lib/util.svelte'
|
||||
import type { LocalImage, Person } from 'lemmy-js-client'
|
||||
import type { LocalImage, Person } from '$lib/client/types'
|
||||
import { action, Button, modal, toast } from 'mono-svelte'
|
||||
import { ArrowDownTray, Icon, Trash } from 'svelte-hero-icons'
|
||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { userLink } from '$lib/lemmy/generic'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import type { PersonView, SiteView, Tagline } from 'lemmy-js-client'
|
||||
import type { PersonView, SiteView, Tagline } from '$lib/client/types'
|
||||
import { Badge } from 'mono-svelte'
|
||||
import {
|
||||
BuildingOffice,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { deleteItem, save } from '$lib/lemmy/contentview.js'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import type { CommentView } from 'lemmy-js-client'
|
||||
import type { CommentView } from '$lib/client/types'
|
||||
import { Button, Menu, MenuButton } from 'mono-svelte'
|
||||
import {
|
||||
Bookmark,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { getClient, site } from '$lib/client/lemmy.svelte'
|
||||
import { errorMessage } from '$lib/lemmy/error'
|
||||
import { placeholders } from '$lib/util.svelte.js'
|
||||
import type { CommentResponse } from 'lemmy-js-client'
|
||||
import type { CommentResponse } from '$lib/client/types'
|
||||
import { Button, Menu, MenuButton, toast } from 'mono-svelte'
|
||||
import { Icon, Language, XMark } from 'svelte-hero-icons'
|
||||
import type { ClassValue, HTMLTextareaAttributes } from 'svelte/elements'
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import PostMeta from '$lib/components/lemmy/post/PostMeta.svelte'
|
||||
import { publishedToDate } from '$lib/components/util/date.js'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import type { CommentView } from 'lemmy-js-client'
|
||||
import type { CommentView } from '$lib/client/types'
|
||||
import { Button, Material } from 'mono-svelte'
|
||||
import { ArrowUturnUp, Icon } from 'svelte-hero-icons'
|
||||
import type { ClassValue } from 'svelte/elements'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import VirtualList from '$lib/components/render/VirtualList.svelte'
|
||||
import type { Post } from 'lemmy-js-client'
|
||||
import type { Post } from '$lib/client/types'
|
||||
import type { CommentNodeI } from './comments.svelte'
|
||||
import Comments from './CommentTree.svelte'
|
||||
import { onMount } from 'svelte'
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { getClient } from '$lib/client/lemmy.svelte'
|
||||
import { errorMessage } from '$lib/lemmy/error'
|
||||
import type { Post } from 'lemmy-js-client'
|
||||
import type { Post } from '$lib/client/types'
|
||||
import { Button, toast } from 'mono-svelte'
|
||||
import { ArrowDownCircle, Icon } from 'svelte-hero-icons'
|
||||
import Comment from './Comment.svelte'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import type { Comment, CommentView } from 'lemmy-js-client'
|
||||
import type { Comment, CommentView } from '$lib/client/types'
|
||||
import { SvelteMap } from 'svelte/reactivity'
|
||||
|
||||
export interface CommentNodeI {
|
||||
|
||||
@@ -83,7 +83,7 @@
|
||||
import { addSubscription } from '$lib/lemmy/user.js'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import { fullCommunityName } from '$lib/util.svelte.js'
|
||||
import type { CommunityModeratorView, CommunityView } from 'lemmy-js-client'
|
||||
import type { CommunityModeratorView, CommunityView } from '$lib/client/types'
|
||||
import {
|
||||
action,
|
||||
Button,
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
CommunityAggregates,
|
||||
CommunityModeratorView,
|
||||
SubscribedType,
|
||||
} from 'lemmy-js-client'
|
||||
} from '$lib/client/types'
|
||||
import { action, Button, Menu, MenuButton, modal, toast } from 'mono-svelte'
|
||||
import {
|
||||
BuildingOffice2,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import { addSubscription } from '$lib/lemmy/user.js'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import { fullCommunityName, isSubscribed } from '$lib/util.svelte.js'
|
||||
import type { CommunityView } from 'lemmy-js-client'
|
||||
import type { CommunityView } from '$lib/client/types'
|
||||
import { Button, modal } from 'mono-svelte'
|
||||
import type { Snippet } from 'svelte'
|
||||
import {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { communityLink } from '$lib/lemmy/generic'
|
||||
import { settings } from '$lib/settings.svelte.js'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import type { Community } from 'lemmy-js-client'
|
||||
import type { Community } from '$lib/client/types'
|
||||
import { ExclamationTriangle, Icon } from 'svelte-hero-icons'
|
||||
import type { HTMLAnchorAttributes } from 'svelte/elements'
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||
import type { Community } from 'lemmy-js-client'
|
||||
import type { Community } from '$lib/client/types'
|
||||
|
||||
interface Props {
|
||||
community: Community
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||
import type { PrivateMessageView } from 'lemmy-js-client'
|
||||
import type { PrivateMessageView } from '$lib/client/types'
|
||||
|
||||
interface Props {
|
||||
message: PrivateMessageView
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import type { Person } from 'lemmy-js-client'
|
||||
import type { Person } from '$lib/client/types'
|
||||
import { Button, Modal } from 'mono-svelte'
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
||||
import { getClient } from '$lib/client/lemmy.svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import type { Person } from 'lemmy-js-client'
|
||||
import type { Person } from '$lib/client/types'
|
||||
import { Button, Modal, toast } from 'mono-svelte'
|
||||
import { Icon, PaperAirplane } from 'svelte-hero-icons'
|
||||
import { errorMessage } from '$lib/lemmy/error'
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { preventDefault } from 'svelte/legacy'
|
||||
|
||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||
import type { Community, Person } from 'lemmy-js-client'
|
||||
import type { Community, Person } from '$lib/client/types'
|
||||
import { getClient } from '$lib/client/lemmy.svelte'
|
||||
import { toast } from 'mono-svelte'
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import ShieldIcon from '$lib/components/lemmy/moderation/ShieldIcon.svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { isCommentView } from '$lib/lemmy/item.js'
|
||||
import type { CommentView } from 'lemmy-js-client'
|
||||
import type { CommentView } from '$lib/client/types'
|
||||
import { Button, Menu, MenuButton, MenuDivider } from 'mono-svelte'
|
||||
import {
|
||||
ArrowsUpDown,
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import { getClient } from '$lib/client/lemmy.svelte'
|
||||
import { errorMessage } from '$lib/lemmy/error'
|
||||
import { isCommentView, isPostView } from '$lib/lemmy/item.js'
|
||||
import type { CommentView, PostView } from 'lemmy-js-client'
|
||||
import type { CommentView, PostView } from '$lib/client/types'
|
||||
import { Menu, MenuButton, MenuDivider, toast } from 'mono-svelte'
|
||||
import type { Snippet } from 'svelte'
|
||||
import {
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
import { isCommentView, isPostView } from '$lib/lemmy/item.js'
|
||||
import { settings } from '$lib/settings.svelte.js'
|
||||
import { fullCommunityName } from '$lib/util.svelte.js'
|
||||
import type { CommentView, PostView } from 'lemmy-js-client'
|
||||
import type { CommentView, PostView } from '$lib/client/types'
|
||||
import { Button, Modal, Select, Switch, toast } from 'mono-svelte'
|
||||
import Option from 'mono-svelte/forms/select/Option.svelte'
|
||||
import { Fire, Icon, Trash } from 'svelte-hero-icons'
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
CommentView,
|
||||
PostView,
|
||||
PrivateMessageView,
|
||||
} from 'lemmy-js-client'
|
||||
} from '$lib/client/types'
|
||||
import { Button, Modal, toast } from 'mono-svelte'
|
||||
import PrivateMessage from '../inbox/PrivateMessage.svelte'
|
||||
import { errorMessage } from '$lib/lemmy/error'
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { client } from '$lib/client/lemmy.svelte'
|
||||
import { isCommentView, isPostView } from '$lib/lemmy/item'
|
||||
import type { CommentView, PostView, VoteView } from 'lemmy-js-client'
|
||||
import type { CommentView, PostView, VoteView } from '$lib/client/types'
|
||||
import { Button, Modal, Spinner } from 'mono-svelte'
|
||||
import {
|
||||
ArrowDownCircle,
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
} from '$lib/components/lemmy/post/PostMeta.svelte'
|
||||
import { publishedToDate } from '$lib/components/util/date.js'
|
||||
import { settings, type View } from '$lib/settings.svelte.js'
|
||||
import type { PostView } from 'lemmy-js-client'
|
||||
import type { PostView } from '$lib/client/types'
|
||||
import type { ClassValue } from 'svelte/elements'
|
||||
import PostBody from './PostBody.svelte'
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
<script lang="ts">
|
||||
import type { PostView } from 'lemmy-js-client'
|
||||
import type { PostView } from '$lib/client/types'
|
||||
import Post from './Post.svelte'
|
||||
|
||||
interface Props {
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { instance } from '$lib/instance.svelte'
|
||||
import { settings, type View } from '$lib/settings.svelte'
|
||||
import type { Community, Person, SubscribedType } from 'lemmy-js-client'
|
||||
import type { Community, Person, SubscribedType } from '$lib/client/types'
|
||||
import { Badge, modal, Popover } from 'mono-svelte'
|
||||
import {
|
||||
Bookmark,
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
import { vote as voteItem } from '$lib/lemmy/contentview.js'
|
||||
import { errorMessage } from '$lib/lemmy/error'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import type { Post } from 'lemmy-js-client'
|
||||
import type { Post } from '$lib/client/types'
|
||||
import { buttonColor, toast } from 'mono-svelte'
|
||||
import { ChevronDown, ChevronUp, Icon } from 'svelte-hero-icons'
|
||||
import { backOut } from 'svelte/easing'
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { save } from '$lib/lemmy/contentview.js'
|
||||
import { settings, type View } from '$lib/settings.svelte.js'
|
||||
import type { PostView } from 'lemmy-js-client'
|
||||
import type { PostView } from '$lib/client/types'
|
||||
import { Button, Menu, Modal, Spinner } from 'mono-svelte'
|
||||
import {
|
||||
Bookmark,
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import { setSessionStorage } from '$lib/session'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import { instanceToURL } from '$lib/util.svelte'
|
||||
import type { PostView } from 'lemmy-js-client'
|
||||
import type { PostView } from '$lib/client/types'
|
||||
import { Button, Menu, MenuButton, toast } from 'mono-svelte'
|
||||
import {
|
||||
ArrowTopRightOnSquare,
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import Post from '$lib/components/lemmy/post/Post.svelte'
|
||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||
import { settings } from '$lib/settings.svelte.js'
|
||||
import type { PostView } from 'lemmy-js-client'
|
||||
import type { PostView } from '$lib/client/types'
|
||||
import { Button } from 'mono-svelte'
|
||||
import type { Snippet } from 'svelte'
|
||||
import { ArchiveBox, Icon, Plus } from 'svelte-hero-icons'
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
type PostFeedID,
|
||||
} from '$lib/lemmy/postfeed.svelte'
|
||||
import { settings } from '$lib/settings.svelte.js'
|
||||
import type { PostView } from 'lemmy-js-client'
|
||||
import type { PostView } from '$lib/client/types'
|
||||
import { Button } from 'mono-svelte'
|
||||
import { onDestroy, onMount, untrack } from 'svelte'
|
||||
import {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import type { PostView } from 'lemmy-js-client'
|
||||
import type { PostView } from '$lib/client/types'
|
||||
import { SvelteMap, SvelteSet } from 'svelte/reactivity'
|
||||
|
||||
export type PostViewWithCrossposts = PostView & {
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
import { errorMessage } from '$lib/lemmy/error'
|
||||
import { getSessionStorage, setSessionStorage } from '$lib/session.js'
|
||||
import { placeholders } from '$lib/util.svelte.js'
|
||||
import type { Community, Post, PostView } from 'lemmy-js-client'
|
||||
import type { Community, Post, PostView } from '$lib/client/types'
|
||||
import {
|
||||
Button,
|
||||
Modal,
|
||||
|
||||
@@ -2,7 +2,7 @@ import { instance } from '$lib/instance.svelte'
|
||||
import { client } from '$lib/client/lemmy.svelte'
|
||||
import { isImage, isVideo } from '$lib/ui/image'
|
||||
import { canParseUrl, findClosestNumber } from '$lib/util.svelte'
|
||||
import type { CommentView, PersonView, Post } from 'lemmy-js-client'
|
||||
import type { CommentView, PersonView, Post } from '$lib/client/types'
|
||||
|
||||
export const isCommentMutable = (comment: CommentView, me: PersonView) =>
|
||||
me.person.id == comment.creator.id
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { showImage } from '$lib/components/ui/ExpandableImage.svelte'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import type { Post } from 'lemmy-js-client'
|
||||
import type { Post } from '$lib/client/types'
|
||||
import { Button, modal } from 'mono-svelte'
|
||||
import { onMount } from 'svelte'
|
||||
import { bestImageURL, postLink } from '../helpers'
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
} from '$lib/components/lemmy/post/helpers.js'
|
||||
import PostLink from '$lib/components/lemmy/post/link/PostLink.svelte'
|
||||
import { settings, type View } from '$lib/settings.svelte.js'
|
||||
import type { Post } from 'lemmy-js-client'
|
||||
import type { Post } from '$lib/client/types'
|
||||
import PostIframe from './PostIframe.svelte'
|
||||
import PostImage from './PostImage.svelte'
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { showImage } from '$lib/components/ui/ExpandableImage.svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { settings, type View } from '$lib/settings.svelte.js'
|
||||
import type { Post } from 'lemmy-js-client'
|
||||
import type { Post } from '$lib/client/types'
|
||||
import { modal } from 'mono-svelte'
|
||||
import Button from 'mono-svelte/button/Button.svelte'
|
||||
import {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import { profile } from '$lib/auth.svelte'
|
||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||
import { getClient } from '$lib/client/lemmy.svelte'
|
||||
import type { ListingType, Person } from 'lemmy-js-client'
|
||||
import type { ListingType, Person } from '$lib/client/types'
|
||||
import { MenuButton, Search } from 'mono-svelte'
|
||||
import { createEventDispatcher } from 'svelte'
|
||||
import { Icon, XCircle } from 'svelte-hero-icons'
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||
import LabelStat from '$lib/components/ui/LabelStat.svelte'
|
||||
import { userLink } from '$lib/lemmy/generic'
|
||||
import type { PersonView } from 'lemmy-js-client'
|
||||
import type { PersonView } from '$lib/client/types'
|
||||
|
||||
interface Props {
|
||||
user: PersonView
|
||||
|
||||
@@ -51,8 +51,9 @@
|
||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||
import Logo from '$lib/components/ui/Logo.svelte'
|
||||
import { settings } from '$lib/settings.svelte.js'
|
||||
import type { Person } from 'lemmy-js-client'
|
||||
import type { Person } from '$lib/client/types'
|
||||
import { Icon, Language, NoSymbol } from 'svelte-hero-icons'
|
||||
import { Badge } from 'mono-svelte'
|
||||
|
||||
interface Props {
|
||||
user: Person
|
||||
@@ -140,6 +141,9 @@
|
||||
/>
|
||||
{/if}
|
||||
{/if}
|
||||
{#if user.flair}
|
||||
<Badge>{user.flair}</Badge>
|
||||
{/if}
|
||||
{@render extraBadges?.()}
|
||||
{/if}
|
||||
</a>
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import SidebarButton from '$lib/components/ui/sidebar/SidebarButton.svelte'
|
||||
import { addFavorite } from '$lib/lemmy/item'
|
||||
import { hasFavorite } from '$lib/lemmy/user'
|
||||
import type { Community } from 'lemmy-js-client'
|
||||
import type { Community } from '$lib/client/types'
|
||||
import { Button } from 'mono-svelte'
|
||||
import { Icon, Star, Trash } from 'svelte-hero-icons'
|
||||
import { flip } from 'svelte/animate'
|
||||
|
||||
@@ -6,7 +6,7 @@ import type {
|
||||
PostView,
|
||||
Comment,
|
||||
Post,
|
||||
} from 'lemmy-js-client'
|
||||
} from '$lib/client/types'
|
||||
|
||||
export type SubmissionView = PostView | CommentView
|
||||
export type Submission = Post | Comment
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { fullCommunityName } from '$lib/util.svelte'
|
||||
import type { Community, Person } from 'lemmy-js-client'
|
||||
import type { Community, Person } from '$lib/client/types'
|
||||
|
||||
export const communityLink = (community: Community, prefix: string = '') =>
|
||||
`${prefix}/c/${fullCommunityName(community.name, community.actor_id)}`
|
||||
|
||||
@@ -4,7 +4,7 @@ import type {
|
||||
Person,
|
||||
PersonMentionView,
|
||||
PrivateMessageView,
|
||||
} from 'lemmy-js-client'
|
||||
} from '$lib/client/types'
|
||||
|
||||
export type InboxItemView =
|
||||
| PersonMentionView
|
||||
|
||||
@@ -12,7 +12,7 @@ import type {
|
||||
PrivateMessage,
|
||||
PrivateMessageReportView,
|
||||
PrivateMessageView,
|
||||
} from 'lemmy-js-client'
|
||||
} from '$lib/client/types'
|
||||
import { writable } from 'svelte/store'
|
||||
|
||||
export type Result =
|
||||
|
||||
@@ -6,7 +6,7 @@ import type {
|
||||
GetPostsResponse,
|
||||
ListingType,
|
||||
SortType,
|
||||
} from 'lemmy-js-client'
|
||||
} from '$lib/client/types'
|
||||
|
||||
export const shouldReload = (
|
||||
cache: PostFeed | undefined,
|
||||
|
||||
@@ -7,7 +7,7 @@ import type {
|
||||
PostView,
|
||||
PrivateMessage,
|
||||
PrivateMessageReportView,
|
||||
} from 'lemmy-js-client'
|
||||
} from '$lib/client/types'
|
||||
|
||||
interface CommentReport {
|
||||
type: 'comment'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { profile, type ProfileInfo } from '$lib/auth.svelte'
|
||||
import { getClient } from '$lib/client/lemmy.svelte'
|
||||
import { trycatch } from '$lib/util.svelte'
|
||||
import type { Community, MyUserInfo } from 'lemmy-js-client'
|
||||
import type { Community, MyUserInfo } from '$lib/client/types'
|
||||
|
||||
// TODO obliterate this file
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { locale } from '$lib/i18n/translations'
|
||||
import { getContext, type Snippet } from 'svelte'
|
||||
import { getContext, onDestroy, type Snippet } from 'svelte'
|
||||
import type { IconSource } from 'svelte-hero-icons'
|
||||
import type { HTMLOptionAttributes } from 'svelte/elements'
|
||||
|
||||
@@ -42,6 +42,13 @@
|
||||
}
|
||||
}
|
||||
})
|
||||
|
||||
onDestroy(() => {
|
||||
const index = context.options.findIndex(i => i.value == option.value)
|
||||
if (index != -1) {
|
||||
context.options.splice(index, 1)
|
||||
}
|
||||
})
|
||||
</script>
|
||||
|
||||
{#key $locale}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { browser } from '$app/environment'
|
||||
import type { Community } from 'lemmy-js-client'
|
||||
import type { Community } from '$lib/client/types'
|
||||
|
||||
interface SessionStorage {
|
||||
lastSeenCommunity: Community | undefined
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { CommentSortType, ListingType, SortType } from 'lemmy-js-client'
|
||||
import type { CommentSortType, ListingType, SortType } from '$lib/client/types'
|
||||
import { env } from '$env/dynamic/public'
|
||||
import { locale } from './i18n/translations'
|
||||
import { browser } from '$app/environment'
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { goto } from '$app/navigation'
|
||||
import { client } from '$lib/client/lemmy.svelte'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import type { SubscribedType } from 'lemmy-js-client'
|
||||
import type { SubscribedType } from '$lib/client/types'
|
||||
import { toast } from 'mono-svelte'
|
||||
import { t } from './i18n/translations'
|
||||
import { errorMessage } from './lemmy/error'
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@ import { t } from '$lib/i18n/translations.js'
|
||||
import { postFeed } from '$lib/lemmy/postfeed.svelte.js'
|
||||
import { ReactiveState, awaitIfServer } from '$lib/promise.svelte.js'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import type { ListingType, SortType } from 'lemmy-js-client'
|
||||
import type { ListingType, SortType } from '$lib/client/types'
|
||||
import { ChevronDoubleUp } from 'svelte-hero-icons'
|
||||
|
||||
export async function load({ url, fetch }) {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<script lang="ts">
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { Spinner } from 'mono-svelte'
|
||||
import type { ResolveObjectResponse } from 'lemmy-js-client'
|
||||
import type { ResolveObjectResponse } from '$lib/client/types'
|
||||
import CommunityItem from '$lib/components/lemmy/community/CommunityItem.svelte'
|
||||
import UserItem from '$lib/components/lemmy/user/UserItem.svelte'
|
||||
import Post from '$lib/components/lemmy/post/Post.svelte'
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
import type {
|
||||
ApproveRegistrationApplication,
|
||||
RegistrationApplicationView,
|
||||
} from 'lemmy-js-client'
|
||||
} from '$lib/client/types'
|
||||
import { Button, Material, toast } from 'mono-svelte'
|
||||
import {
|
||||
Check,
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
import { t } from '$lib/i18n/translations.js'
|
||||
import { getClient, site } from '$lib/client/lemmy.svelte'
|
||||
import { errorMessage } from '$lib/lemmy/error.js'
|
||||
import type { EditSite } from 'lemmy-js-client'
|
||||
import type { EditSite } from '$lib/client/types'
|
||||
import {
|
||||
Badge,
|
||||
Button,
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import { t } from '$lib/i18n/translations.js'
|
||||
import { getClient } from '$lib/client/lemmy.svelte'
|
||||
import { trycatch } from '$lib/util.svelte.js'
|
||||
import type { Instance } from 'lemmy-js-client'
|
||||
import type { Instance } from '$lib/client/types'
|
||||
import {
|
||||
Button,
|
||||
FileInput,
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||
import { t } from '$lib/i18n/translations.js'
|
||||
import { getClient } from '$lib/client/lemmy.svelte'
|
||||
import type { Tagline } from 'lemmy-js-client'
|
||||
import type { Tagline } from '$lib/client/types'
|
||||
import { Button, toast } from 'mono-svelte'
|
||||
import { Icon, Plus, Trash } from 'svelte-hero-icons'
|
||||
import { errorMessage } from '$lib/lemmy/error.js'
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { postFeed } from '$lib/lemmy/postfeed.svelte.js'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import type { SortType } from 'lemmy-js-client'
|
||||
import type { SortType } from '$lib/client/types'
|
||||
|
||||
export async function load({ params, fetch, url }) {
|
||||
const cursor: string | undefined = url.searchParams.get('cursor') as
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { LINKED_INSTANCE_URL } from '$lib/instance.svelte.js'
|
||||
import { client } from '$lib/client/lemmy.svelte'
|
||||
import { ReactiveState } from '$lib/promise.svelte'
|
||||
import { type ListingType, type SortType } from 'lemmy-js-client'
|
||||
import { type ListingType, type SortType } from '$lib/client/types'
|
||||
|
||||
export async function load({ url, fetch }) {
|
||||
const typeParam = url.searchParams.get('type')
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
CommunityResponse,
|
||||
CommunityView,
|
||||
SubscribedType,
|
||||
} from 'lemmy-js-client'
|
||||
} from '$lib/client/types'
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
import { toast } from 'mono-svelte'
|
||||
import { errorMessage } from '$lib/lemmy/error'
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
import { publishedToDate } from '$lib/components/util/date.js'
|
||||
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
||||
import { t } from '$lib/i18n/translations.js'
|
||||
import type { Person, PrivateMessageView } from 'lemmy-js-client'
|
||||
import type { Person, PrivateMessageView } from '$lib/client/types'
|
||||
import { Button, Modal } from 'mono-svelte'
|
||||
import { ChatBubbleOvalLeftEllipsis, Icon, Inbox } from 'svelte-hero-icons'
|
||||
import { expoOut } from 'svelte/easing'
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
import { client } from '$lib/client/lemmy.svelte'
|
||||
import { errorMessage } from '$lib/lemmy/error'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import type { PrivateMessageResponse } from 'lemmy-js-client'
|
||||
import type { PrivateMessageResponse } from '$lib/client/types'
|
||||
import { Button, Material, TextInput, toast } from 'mono-svelte'
|
||||
import { onDestroy, onMount, tick } from 'svelte'
|
||||
import {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
import { publishedToDate } from '$lib/components/util/date'
|
||||
import RelativeDate from '$lib/components/util/RelativeDate.svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import type { PrivateMessageView } from 'lemmy-js-client'
|
||||
import type { PrivateMessageView } from '$lib/client/types'
|
||||
import { Button, Menu, MenuButton } from 'mono-svelte'
|
||||
import { EllipsisVertical, Flag, Icon, Trash } from 'svelte-hero-icons'
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ import type {
|
||||
ModTransferCommunityView,
|
||||
ModlogActionType,
|
||||
Person,
|
||||
} from 'lemmy-js-client'
|
||||
} from '$lib/client/types'
|
||||
|
||||
export type ActionName =
|
||||
| 'ban'
|
||||
|
||||
@@ -11,7 +11,7 @@ import type {
|
||||
PostView,
|
||||
CommunityModeratorView,
|
||||
CommunityView,
|
||||
} from 'lemmy-js-client'
|
||||
} from '$lib/client/types'
|
||||
|
||||
interface PartialPost {
|
||||
post_view: PostView
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
CommentSortType,
|
||||
GetCommentsResponse,
|
||||
PostView,
|
||||
} from 'lemmy-js-client'
|
||||
} from '$lib/client/types'
|
||||
import { Button, Option, Select } from 'mono-svelte'
|
||||
import { onMount } from 'svelte'
|
||||
import {
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
CommunityBlockView,
|
||||
InstanceBlockView,
|
||||
PersonBlockView,
|
||||
} from 'lemmy-js-client'
|
||||
} from '$lib/client/types'
|
||||
import { Button } from 'mono-svelte'
|
||||
import { Check, Icon, XMark } from 'svelte-hero-icons'
|
||||
import type { PageData } from './$types.js'
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
|
||||
import { t } from '$lib/i18n/translations.js'
|
||||
import { getClient, site } from '$lib/client/lemmy.svelte'
|
||||
import type { SaveUserSettings } from 'lemmy-js-client'
|
||||
import type { SaveUserSettings } from '$lib/client/types'
|
||||
import {
|
||||
Badge,
|
||||
Button,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { getClient } from '$lib/client/lemmy.svelte'
|
||||
import { getItemPublished } from '$lib/lemmy/item.js'
|
||||
import type { SortType } from 'lemmy-js-client'
|
||||
import type { SortType } from '$lib/client/types'
|
||||
|
||||
export async function load({ url, fetch, parent }) {
|
||||
const page = Number(url.searchParams.get('page')) || 1
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||
import { t } from '$lib/i18n/translations.js'
|
||||
import { searchParam } from '$lib/util.svelte.js'
|
||||
import type { CommentView, PostView } from 'lemmy-js-client'
|
||||
import type { CommentView, PostView } from '$lib/client/types'
|
||||
import { Select } from 'mono-svelte'
|
||||
import Option from 'mono-svelte/forms/select/Option.svelte'
|
||||
import {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { profile } from '$lib/auth.svelte'
|
||||
import { client } from '$lib/client/lemmy.svelte'
|
||||
import { error } from '@sveltejs/kit'
|
||||
import type { CommentView, PostView } from 'lemmy-js-client'
|
||||
import type { CommentView, PostView } from '$lib/client/types'
|
||||
|
||||
function getSavedItemPublished(item: PostView | CommentView) {
|
||||
if ('comment' in item) {
|
||||
|
||||
@@ -3,7 +3,7 @@ import { client, getClient } from '$lib/client/lemmy.svelte'
|
||||
import { PiefedClient } from '$lib/client/piefed/piefed.js'
|
||||
import { getItemPublished } from '$lib/lemmy/item.js'
|
||||
import { ReactiveState } from '$lib/promise.svelte.js'
|
||||
import type { ListingType, SearchType, SortType } from 'lemmy-js-client'
|
||||
import type { ListingType, SearchType, SortType } from '$lib/client/types'
|
||||
|
||||
export async function load({ url, fetch }) {
|
||||
const query = url.searchParams.get('q')
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
import { t } from '$lib/i18n/translations.js'
|
||||
import { getClient } from '$lib/client/lemmy.svelte'
|
||||
import { errorMessage } from '$lib/lemmy/error.js'
|
||||
import type { GetCaptchaResponse } from 'lemmy-js-client'
|
||||
import type { GetCaptchaResponse } from '$lib/client/types'
|
||||
import {
|
||||
Button,
|
||||
Checkbox,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { getClient } from '$lib/client/lemmy.svelte'
|
||||
import { getItemPublished } from '$lib/lemmy/item.js'
|
||||
import { ReactiveState } from '$lib/promise.svelte.js'
|
||||
import type { SortType } from 'lemmy-js-client'
|
||||
import type { SortType } from '$lib/client/types'
|
||||
|
||||
export async function load({ params, url, fetch }) {
|
||||
const page = Number(url.searchParams.get('page')) || 1
|
||||
|
||||
Reference in new issue
Block a user