mattermost-mobile/types/screens/gallery.ts
Elias Nahum 374f812b98
Update dependencies (#8721)
* update fastlane

* update dev dependencies

* update to eslint 9+

* update testing-library

* update react-intl

* update bottom-sheet

* update expo

* update reanimated

* upgrade msgpack

* upgrade datepicker

* upgrade react-navigation

* update sentry

* update FlasList

* update fuse.js moment-timezone node-html-parser and semver

* update gesture-handler

* update image-picker

* update react-native-keychain

* update react-native-localize

* update react-native-navigation

* update watermelonDB

* update react-native-permissions

* update react-native-safe-area-context and react-native-screens

* update react-native-share and react-native-svg

* update react-native-video and react-native-webrtc

* update @mattermost/rnutils

* update @mattermost/rnshare

* update @mattermost/hardware-keyboard

* fix isMainActivity

* update android dependencies

* fix upload file progress indicator

* fix entry update config & license

* revert to stable version of @sentry/react-native

* update react-intl again

* update moment-timezone

* upgrade @react-native-camera-roll/camera-roll

* update @react-native-clipboard/clipboard

* update @react-navigation again

* update @shopify/flash-list

* update eslint

* update expo again

* update html-entities

* update mime-db

* update react-native-permissions

* Revert "update react-intl again"

This reverts commit e8e6d5a60dfa56b82b810cbbd7cdffec7697ffc7.

* Revert "update react-intl"

This reverts commit c77f329bb38910aeeba03869b72d77a8b0e00ba1.

* update react-native-keychain

* update and patch react-intl

* mend

* feedback during review 1
2025-04-07 09:30:06 +08:00

82 lines
2.3 KiB
TypeScript

// 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<number>;
height: SharedValue<number>;
x: SharedValue<number>;
y: SharedValue<number>;
opacity: SharedValue<number>;
activeIndex: SharedValue<number>;
targetWidth: SharedValue<number>;
targetHeight: SharedValue<number>;
}
export type Context = { [key: string]: any };
export type Handler<T, TContext extends Context> = (
event: T,
context: TContext,
) => void;
export type onEndHandler<T, TContext extends Context> = (
event: T,
context: TContext,
isCanceled: boolean,
) => void;
export type ReturnHandler<T, TContext extends Context, R> = (
event: T,
context: TContext,
) => R;
export interface GestureHandlers<T, TContext extends Context> {
onInit?: Handler<T, TContext>;
onEvent?: Handler<T, TContext>;
shouldHandleEvent?: ReturnHandler<T, TContext, boolean>;
shouldCancel?: ReturnHandler<T, TContext, boolean>;
onGesture?: Handler<T, TContext>;
beforeEach?: Handler<T, TContext>;
afterEach?: Handler<T, TContext>;
onStart?: Handler<T, TContext>;
onActive?: Handler<T, TContext>;
onEnd?: onEndHandler<T, TContext>;
onFail?: Handler<T, TContext>;
onCancel?: Handler<T, TContext>;
onFinish?: (
event: T,
context: TContext,
isCanceledOrFailed: boolean,
) => void;
}
export type OnGestureEvent<T extends GestureHandlerGestureEvent> = (
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<string, unknown> & {captions?: Caption[]};
};
export type GalleryAction = 'none' | 'downloading' | 'copying' | 'sharing' | 'opening' | 'external';