Refactor repo-projects.ts (#32892)

- Remove jQuery
- Add types to all functions
- Tested all modified functionality

---------

Co-authored-by: Giteabot <teabot@gitea.io>
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
silverwind 2024-12-19 09:37:12 +01:00 committed by GitHub
parent dc8f59baa5
commit 141d782c1a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
8 changed files with 148 additions and 235 deletions

View file

@ -1,6 +1,7 @@
import type {SortableOptions, SortableEvent} from 'sortablejs';
import type SortableType from 'sortablejs';
export async function createSortable(el: Element, opts: {handle?: string} & SortableOptions = {}) {
export async function createSortable(el: Element, opts: {handle?: string} & SortableOptions = {}): Promise<SortableType> {
// @ts-expect-error: wrong type derived by typescript
const {Sortable} = await import(/* webpackChunkName: "sortablejs" */'sortablejs');