Bluesky app fork with some witchin' additions 馃挮
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

at cope-settings-sync 92 lines 2.8 kB view raw
1import { 2 type AccessibilityProps, 3 type GestureResponderEvent, 4 type ScrollViewProps, 5 type StyleProp, 6 type ViewStyle, 7} from 'react-native' 8 9import {type ViewStyleProp} from '#/alf' 10import {type BottomSheetViewProps} from '../../../modules/bottom-sheet' 11import {type BottomSheetSnapPoint} from '../../../modules/bottom-sheet/src/BottomSheet.types' 12 13type A11yProps = Required<AccessibilityProps> 14 15/** 16 * Mutated by useImperativeHandle to provide a public API for controlling the 17 * dialog. The methods here will actually become the handlers defined within 18 * the `Dialog.Outer` component. 19 * 20 * `Partial<GestureResponderEvent>` here allows us to add this directly to the 21 * `onPress` prop of a button, for example. If this type was not added, we 22 * would need to create a function to wrap `.open()` with. 23 */ 24export type DialogControlRefProps = { 25 open: ( 26 options?: DialogControlOpenOptions & Partial<GestureResponderEvent>, 27 ) => void 28 close: (callback?: () => void) => void 29} 30 31/** 32 * The return type of the useDialogControl hook. 33 */ 34export type DialogControlProps = DialogControlRefProps & { 35 id: string 36 ref: React.RefObject<DialogControlRefProps | null> 37 isOpen?: boolean 38} 39 40export type DialogContextProps = { 41 close: DialogControlProps['close'] 42 isNativeDialog: boolean 43 nativeSnapPoint: BottomSheetSnapPoint 44 disableDrag: boolean 45 setDisableDrag: React.Dispatch<React.SetStateAction<boolean>> 46 // in the event that the hook is used outside of a dialog 47 isWithinDialog: boolean 48 isHeightConstrained: boolean 49} 50 51export type DialogControlOpenOptions = { 52 /** 53 * NATIVE ONLY 54 * 55 * Optional index of the snap point to open the bottom sheet to. Defaults to 56 * 0, which is the first snap point (i.e. "open"). 57 */ 58 index?: number 59} 60 61export type DialogOuterProps = { 62 control: DialogControlProps 63 onClose?: () => void 64 nativeOptions?: Omit<BottomSheetViewProps, 'children'> 65 webOptions?: { 66 alignCenter?: boolean 67 onBackgroundPress?: (e: GestureResponderEvent) => void 68 } 69 testID?: string 70} 71 72type DialogInnerPropsBase<T> = React.PropsWithChildren<ViewStyleProp> & 73 T & { 74 testID?: string 75 } 76export type DialogInnerProps = 77 | DialogInnerPropsBase<{ 78 label?: undefined 79 accessibilityLabelledBy: A11yProps['aria-labelledby'] 80 accessibilityDescribedBy: string 81 keyboardDismissMode?: ScrollViewProps['keyboardDismissMode'] 82 contentContainerStyle?: StyleProp<ViewStyle> 83 header?: React.ReactNode 84 }> 85 | DialogInnerPropsBase<{ 86 label: string 87 accessibilityLabelledBy?: undefined 88 accessibilityDescribedBy?: undefined 89 keyboardDismissMode?: ScrollViewProps['keyboardDismissMode'] 90 contentContainerStyle?: StyleProp<ViewStyle> 91 header?: React.ReactNode 92 }>