import * as react from 'react'; import { RefObject, ReactNode, Ref } from 'react'; import { ViewInstance, PopoverHost, PopoverRotation } from '@tastic/hud/chrome'; import { StyleProp, ViewStyle } from 'react-native'; import { SeedColor } from '@rific/auto-paper'; interface ProfilePickerColorSection { value: string; onChange: (hex: string) => void; previewValue?: (hex: string) => string; swatches?: SeedColor[]; label?: string; caption?: string; takenValue?: string; allowSwapTaken?: boolean; } interface ProfilePickerAlignResult { align: 'left' | 'right' | 'center'; verticalAlign: 'below' | 'above'; maxHeight: number; measured: boolean; triggerRef: RefObject; } interface ProfilePickerContentSize { width: number; height: number; } interface OptionPickerOption { value: T; label: string; icon?: string; color?: string; } declare function getOptionPickerContentSize(optionCount: number, colorSection?: Pick): ProfilePickerContentSize; interface OptionPickerProps { id: string; host: PopoverHost; options: OptionPickerOption[]; value: T; onChange: (value: T) => void; color: string; dark: boolean; icon: string; rowIcon?: string; colorSection?: ProfilePickerColorSection; align?: 'left' | 'right' | 'center'; alignOverride?: ProfilePickerAlignResult; rotation?: PopoverRotation; triggerStyle?: StyleProp; } declare function OptionPicker({ id, host, options, value, onChange, color, dark, icon, rowIcon, colorSection, align, alignOverride, rotation, triggerStyle }: OptionPickerProps): react.JSX.Element; interface Profile { id: string; name: string; color: string; tag: string; createdAt: number; updatedAt: number; } interface Props { profile: Profile; size?: number; filled?: boolean; } declare function ProfileChip({ profile, size, filled }: Props): react.JSX.Element; type ProfileSwatchPlace = 'chip' | 'colorRow' | 'colorPage'; type ProfileSwatchRenderer = (color: string, size: number, place: ProfileSwatchPlace) => ReactNode; interface ProfileColorProviderProps { preview?: (hex: string) => string; renderSwatch?: ProfileSwatchRenderer; children: ReactNode; } declare function ProfileColorProvider({ preview, renderSwatch, children }: ProfileColorProviderProps): react.JSX.Element; declare function useProfileColorPreview(): ((hex: string) => string) | undefined; declare function useProfileSwatchRenderer(): ProfileSwatchRenderer | undefined; declare function useProfileDisplayColor(hex: string): string; declare function getProfilePickerContentSize(profileCount: number, hasManageRow?: boolean, colorSection?: Pick): ProfilePickerContentSize; interface ProfilePickerProps

{ idPrefix: string; host: PopoverHost; profiles: P[]; selectedId: string | null; takenId?: string | null; takenIds?: readonly string[]; color: string; dark: boolean; align?: 'left' | 'right' | 'center'; alignOverride?: ProfilePickerAlignResult; rotation?: PopoverRotation; guestLabel: string; nullLabel?: string; nullIcon?: string; onSelect: (profile: P | null) => void; onManage?: () => void; colorSection?: ProfilePickerColorSection; triggerStyle?: StyleProp; } declare function ProfilePicker

({ idPrefix, host, profiles, selectedId, takenId, takenIds, color, dark, align, alignOverride, rotation, guestLabel, nullLabel, nullIcon, onSelect, onManage, colorSection, triggerStyle }: ProfilePickerProps

): react.JSX.Element; type MD3TextVariant$1 = 'displayLarge' | 'displayMedium' | 'displaySmall' | 'headlineLarge' | 'headlineMedium' | 'headlineSmall' | 'titleLarge' | 'titleMedium' | 'titleSmall' | 'labelLarge' | 'labelMedium' | 'labelSmall' | 'bodyLarge' | 'bodyMedium' | 'bodySmall'; interface ProfileEditPatch { name: string; color: string; tag: string; } interface ProfilesManagerHandle { commitPendingEdit: () => void; } interface ProfilesManagerProps { profiles: Profile[]; defaultColor: string; onCreate: (input: ProfileEditPatch) => void; onSave: (id: string, patch: ProfileEditPatch) => void; onDelete: (id: string) => void; headerLeft?: ReactNode; ref?: Ref; fg?: string; fgMuted?: string; titleVariant?: MD3TextVariant$1; colorPreview?: (hex: string) => string; useColorPickerAlign?: (open: boolean, contentWidth: number, contentHeight: number, column: RefObject) => ProfilePickerAlignResult; } declare function ProfilesManager({ profiles, defaultColor, onCreate, onSave, onDelete, headerLeft, ref, fg: fgOverride, fgMuted: fgMutedOverride, titleVariant, colorPreview: colorPreviewProp, useColorPickerAlign }: ProfilesManagerProps): react.JSX.Element; type MD3TextVariant = 'displayLarge' | 'displayMedium' | 'displaySmall' | 'headlineLarge' | 'headlineMedium' | 'headlineSmall' | 'titleLarge' | 'titleMedium' | 'titleSmall' | 'labelLarge' | 'labelMedium' | 'labelSmall' | 'bodyLarge' | 'bodyMedium' | 'bodySmall'; interface ProfilesScreenProps { profiles: Profile[]; defaultColor: string; onCreate: (patch: ProfileEditPatch) => void; onSave: (id: string, patch: ProfileEditPatch) => void; onDelete: (id: string) => void; onBack: () => void; fg?: string; fgMuted?: string; bg?: string; titleVariant?: MD3TextVariant; colorPreview?: (hex: string) => string; useColorPickerAlign?: ProfilesManagerProps['useColorPickerAlign']; } declare function ProfilesScreen({ profiles, defaultColor, onCreate, onSave, onDelete, onBack, fg: fgOverride, fgMuted, bg: bgOverride, titleVariant, colorPreview, useColorPickerAlign }: ProfilesScreenProps): react.JSX.Element; declare const MAX_PROFILE_NAME_LENGTH = 20; declare const MAX_TAG_LENGTH = 3; declare function isValidTag(value: unknown): value is string; declare function isValidProfile(value: unknown): value is Profile; interface ReduxAction

{ payload: P; type: string; } type ActionCreator

= ((payload: P) => ReduxAction

) & { type: string; match: (action: { type: string; }) => action is ReduxAction

; }; interface SetProfileExtensionPayload { extension: TExtension; id: string; } interface ProfileExtensionActions { remove: ActionCreator; set: ActionCreator>; } type ProfileExtensionState = Record; interface ProfileExtensionSlice { actions: ProfileExtensionActions; reducer: (state: ProfileExtensionState | undefined, action: { type: string; }) => ProfileExtensionState; } declare function createProfileExtensionSlice(namespace: string): ProfileExtensionSlice; interface SelectProfilePayload { profileId: string | null; seat: TSeat; } interface ProfileSelectionActions { clearProfile: ActionCreator; pruneToRoster: ActionCreator; select: ActionCreator>; } type ProfileSelectionState = Record; interface ProfileSelectionSlice { actions: ProfileSelectionActions; reducer: (state: ProfileSelectionState | undefined, action: { type: string; payload?: unknown; }) => ProfileSelectionState; } declare function createProfileSelectionSlice(namespace: string, defaultState: ProfileSelectionState, mountKey?: string): ProfileSelectionSlice; interface UpdateProfilePayload { id: string; patch: Partial>; } declare const profilesActions: { add: ActionCreator; remove: ActionCreator; setAll: ActionCreator; update: ActionCreator; }; declare function profilesReducer(state: Profile[] | undefined, action: { type: string; }): Profile[]; interface CreateProfileInput { name: string; color: string; tag: string; } declare function createProfileRecord(input: CreateProfileInput): Profile; declare function resolveInitialProfiles(groupId: string, localFallback: Profile[]): Promise; interface SetLastGuestColorPayload { color: string; seat: TSeat; } interface ProfileColorPick { color: string; profileColor: string; } interface SetProfileColorPayload { profile: Pick; color: string | null; } interface SeatColorsActions { setLastCpuColor: ActionCreator; setLastGuestColor: ActionCreator>; setProfileColor: ActionCreator; } type SeatColorsState = { lastCpuColor: string; lastGuestColor: Record; profileColors: Record; }; interface SeatColorsSlice { actions: SeatColorsActions; reducer: (state: SeatColorsState | undefined, action: { type: string; payload?: unknown; }) => SeatColorsState; } declare function profileSeatColor(profile: Pick, profileColors: Record): string; declare function createSeatColorsSlice(namespace: string, defaultState: SeatColorsState, mountKey?: string): SeatColorsSlice; interface UseSharedProfilesSyncOptions { groupId: string; onRemoteChange: (profiles: Profile[]) => void; } interface UseSharedProfilesSyncResult { syncToShared: (next: Profile[]) => void; } declare function useSharedProfilesSync({ groupId, onRemoteChange }: UseSharedProfilesSyncOptions): UseSharedProfilesSyncResult; declare function avoidSeatColorClash(p1Color: string, p2Color: string, defaults: readonly [p1Default: string, p2Default: string]): string; declare const isSharedProfileStoreAvailable: boolean; declare function readSharedProfiles(groupId: string): Promise; declare function loadSharedProfiles(groupId: string): Promise; declare function saveSharedProfiles(groupId: string, profiles: Profile[]): Promise; declare function subscribeSharedProfiles(groupId: string, listener: (profiles: Profile[]) => void): () => void; export { type CreateProfileInput, MAX_PROFILE_NAME_LENGTH, MAX_TAG_LENGTH, OptionPicker, type OptionPickerOption, type Profile, ProfileChip, type ProfileColorPick, ProfileColorProvider, type ProfileEditPatch, type ProfileExtensionActions, type ProfileExtensionSlice, type ProfileExtensionState, ProfilePicker, type ProfilePickerAlignResult, type ProfilePickerColorSection, type ProfilePickerContentSize, type ProfileSelectionActions, type ProfileSelectionSlice, type ProfileSelectionState, type ProfileSwatchPlace, type ProfileSwatchRenderer, ProfilesManager, type ProfilesManagerHandle, type ProfilesManagerProps, ProfilesScreen, type ProfilesScreenProps, type SeatColorsActions, type SeatColorsSlice, type SeatColorsState, type SelectProfilePayload, type SetLastGuestColorPayload, type SetProfileColorPayload, type SetProfileExtensionPayload, type UpdateProfilePayload, type UseSharedProfilesSyncOptions, type UseSharedProfilesSyncResult, avoidSeatColorClash, createProfileExtensionSlice, createProfileRecord, createProfileSelectionSlice, createSeatColorsSlice, getOptionPickerContentSize, getProfilePickerContentSize, isSharedProfileStoreAvailable, isValidProfile, isValidTag, loadSharedProfiles, profileSeatColor, profilesActions, profilesReducer, readSharedProfiles, resolveInitialProfiles, saveSharedProfiles, subscribeSharedProfiles, useProfileColorPreview, useProfileDisplayColor, useProfileSwatchRenderer, useSharedProfilesSync };