Files
cal.diy/companion/utils/index.ts
T
Dhairyashil ShindeandPeer Richelsen 6650fdb9ef refactor(companion): extract AvailabilityDetailScreen with AppPressable migration (#26106)
* refactor(companion): extract AvailabilityDetailScreen with AppPressable migration

Apply Phases 2, 3, 4 to availability-detail.tsx:
- Phase 2: Extract screen logic (~995 lines) to components/screens/AvailabilityDetailScreen.tsx
- Route file is now a minimal ~35 line wrapper with Stack.Screen config
- Phase 3: ScrollView+map pattern kept (7 days is a fixed small list, FlatList not needed)
- Phase 4: Migrate all TouchableOpacity to AppPressable (63 instances)

Follows the same pattern as EventTypeDetailScreen extraction.

* fix(companion): add GlassView header with Save button to AvailabilityDetailScreen (#26107)

* refactor(companion): extract BookingDetailScreen with AppPressable migration (#26108)

* refactor(companion): extract AvailabilityListScreen with AppPressable migration (#26109)

* fix(companion): add GlassView header with Save button to AvailabilityDetailScreen

* refactor(companion): extract BookingDetailScreen with AppPressable migration

* refactor(companion): extract AvailabilityListScreen with AppPressable migration

* refactor(companion): Standardized error handling with dev-only debug logs (#26110)

* address cubics comments

* address cubics comments

* addressed typecheck erros

* removed localhost from wxt.config for chrome extension

* declare FullScreenModal  FullScreenModalProps

---------

Co-authored-by: Peer Richelsen <[email protected]>

* add loggers for dev env

---------

Co-authored-by: Peer Richelsen <[email protected]>

---------

Co-authored-by: Peer Richelsen <[email protected]>
2025-12-22 22:47:55 +00:00

83 lines
1.9 KiB
TypeScript

/**
* Utils Index
*
* Central export point for all utility functions.
* Import utilities from this file for clean imports:
*
* @example
* ```tsx
* import { formatDuration, secureStorage, parseBufferTime } from '../utils';
* ```
*/
// Formatting utilities
export { formatDuration, truncateTitle, formatAppIdToDisplayName } from "./formatters";
// Storage utilities
export {
secureStorage,
generalStorage,
isChromeStorageAvailable,
type StorageAdapter,
} from "./storage";
// Query persistence utilities
export { createQueryPersister, clearQueryCache, getCacheMetadata } from "./queryPersister";
// Alert utilities
export { showErrorAlert } from "./alerts";
// Browser utilities
export { openInAppBrowser } from "./browser";
// Network utilities
export { isOnline } from "./network";
// Slug utilities
export { slugify } from "./slugify";
// App icon utilities
export { getAppIconUrl } from "./getAppIconUrl";
// Default location utilities
export {
defaultLocations,
getDefaultLocationIconUrl,
isDefaultLocation,
DefaultLocationType,
type DefaultLocation,
} from "./defaultLocations";
// Location helper utilities
export {
formatAppIdToDisplayName as formatAppId, // Alias for backward compatibility
generateLocationId,
mapApiLocationToItem,
mapItemToApiLocation,
getLocationDisplayName,
getLocationIconUrl,
createLocationItemFromOption,
locationRequiresInput,
getLocationInputType,
getLocationInputPlaceholder,
getLocationInputLabel,
validateLocationItem,
buildLocationOptions,
displayNameToLocationValue,
} from "./locationHelpers";
// Event type parser utilities
export {
parseBufferTime,
parseMinimumNotice,
parseFrequencyUnit,
parseSlotInterval,
} from "./eventTypeParsers";
// Gmail Google Chip parser (for extension)
export {
parseGoogleChip,
type GoogleTimeSlot,
type ParsedGoogleChip,
} from "./gmailGoogleChipParser";