mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 02:46:04 +01:00 
			
		
		
		
	Add types to various low-level functions (#31781)
Adds types to various low-level modules. All changes are type-only, no runtime changes. `tsc` now reports 38 less errors. One problem was that `@types/sortablejs` does not accept promise return in its functions which triggered the linter, so I disabled the rules on those line.
This commit is contained in:
		| @@ -1,4 +1,6 @@ | ||||
| export async function createSortable(el, opts = {}) { | ||||
| import type {SortableOptions} from 'sortablejs'; | ||||
|  | ||||
| export async function createSortable(el, opts: {handle?: string} & SortableOptions = {}) { | ||||
|   const {Sortable} = await import(/* webpackChunkName: "sortablejs" */'sortablejs'); | ||||
|  | ||||
|   return new Sortable(el, { | ||||
| @@ -15,5 +17,5 @@ export async function createSortable(el, opts = {}) { | ||||
|       opts.onUnchoose?.(e); | ||||
|     }, | ||||
|     ...opts, | ||||
|   }); | ||||
|   } satisfies SortableOptions); | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user