Add ComfyUI-Manager API types (#2967)

This commit is contained in:
Christian Byrne
2025-03-11 06:45:43 -07:00
committed by GitHub
parent 4123cb611c
commit 46029a5ce3
3 changed files with 197 additions and 10 deletions

View File

@@ -119,7 +119,7 @@ import PackCard from '@/components/dialog/content/manager/packCard/PackCard.vue'
import RegistrySearchBar from '@/components/dialog/content/manager/registrySearchBar/RegistrySearchBar.vue'
import { useResponsiveCollapse } from '@/composables/element/useResponsiveCollapse'
import { useRegistrySearch } from '@/composables/useRegistrySearch'
import type { NodeField, TabItem } from '@/types/comfyManagerTypes'
import type { PackField, TabItem } from '@/types/comfyManagerTypes'
import { components } from '@/types/comfyRegistryTypes'
const DEFAULT_CARD_SIZE = 512
@@ -198,10 +198,10 @@ const showInfoPanel = computed(() => selectedNodePacks.value.length > 0)
const hasMultipleSelections = computed(() => selectedNodePacks.value.length > 1)
const currentFilterBy = ref('all')
const handleSortChange = (sortBy: NodeField) => {
const handleSortChange = (sortBy: PackField) => {
sortField.value = sortBy
}
const handleFilterChange = (filterBy: NodeField) => {
const handleFilterChange = (filterBy: PackField) => {
currentFilterBy.value = filterBy
}
</script>

View File

@@ -44,10 +44,10 @@ import { computed, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import SearchFilterDropdown from '@/components/dialog/content/manager/registrySearchBar/SearchFilterDropdown.vue'
import type { NodeField, SearchOption } from '@/types/comfyManagerTypes'
import type { PackField, SearchOption } from '@/types/comfyManagerTypes'
import { components } from '@/types/comfyRegistryTypes'
const DEFAULT_SORT: NodeField = 'downloads'
const DEFAULT_SORT: PackField = 'downloads'
const DEFAULT_FILTER = 'nodePack'
const props = defineProps<{
@@ -57,12 +57,12 @@ const props = defineProps<{
const { t } = useI18n()
const currentSort = ref<NodeField>(DEFAULT_SORT)
const currentSort = ref<PackField>(DEFAULT_SORT)
const currentFilter = ref<string>(DEFAULT_FILTER)
const emit = defineEmits<{
'update:searchQuery': [value: string]
'update:sortBy': [value: NodeField]
'update:sortBy': [value: PackField]
'update:filterBy': [value: string]
}>()
@@ -70,7 +70,7 @@ const hasResults = computed(
() => props.searchQuery.trim() && props.searchResults?.length
)
const sortOptions: SearchOption<NodeField>[] = [
const sortOptions: SearchOption<PackField>[] = [
{ id: 'downloads', label: t('manager.sort.downloads') },
{ id: 'name', label: t('g.name') },
{ id: 'rating', label: t('manager.sort.rating') },