// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. // Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved. // See LICENSE.txt for license information. import type {Caption} from '@mattermost/calls/lib/types'; import type {GestureHandlerGestureEvent} from 'react-native-gesture-handler'; import type {SharedValue} from 'react-native-reanimated'; export type GalleryManagerSharedValues = { width: SharedValue; height: SharedValue; x: SharedValue; y: SharedValue; opacity: SharedValue; activeIndex: SharedValue; targetWidth: SharedValue; targetHeight: SharedValue; } export type Context = { [key: string]: any }; export type Handler = ( event: T, context: TContext, ) => void; export type onEndHandler = ( event: T, context: TContext, isCanceled: boolean, ) => void; export type ReturnHandler = ( event: T, context: TContext, ) => R; export interface GestureHandlers { onInit?: Handler; onEvent?: Handler; shouldHandleEvent?: ReturnHandler; shouldCancel?: ReturnHandler; onGesture?: Handler; beforeEach?: Handler; afterEach?: Handler; onStart?: Handler; onActive?: Handler; onEnd?: onEndHandler; onFail?: Handler; onCancel?: Handler; onFinish?: ( event: T, context: TContext, isCanceledOrFailed: boolean, ) => void; } export type OnGestureEvent = ( event: T, ) => void; export type GalleryFileType = 'image' | 'video' | 'file' | 'avatar'; export type GalleryItemType = { type: GalleryFileType; id: string; width: number; height: number; uri: string; lastPictureUpdate: number; name: string; posterUri?: string; extension?: string; mime_type: string; authorId?: string; size?: number; postId?: string; postProps?: Record & {captions?: Caption[]}; }; export type GalleryAction = 'none' | 'downloading' | 'copying' | 'sharing' | 'opening' | 'external';