mattermost-mobile/types/screens/gallery.d.ts
Elias Nahum dbd7bc8a51
Gallery Improvements (#4837)
* Open/Close Gallery transitions

* Include postId in file info & disable opening the gallery in some cases

* Add progress bar component

* Transition to gallery based on platform

* Improve getting the filename for non attachments

* Patch RNFetchBlob TS definition

* Add gallery types

* fix unit tests for message and post attachment

* add getLocalPath method

* Add react-native-share dependency

* Re-style gallery footer

* Refactor Gallery screen

* Double tap zoom in/out and translate

* Make android activity "transparent"

* Do not animate to height on dismissing gallery

* Open gallery for file uploads

* Fix borderRadius for gallery action button

* Use progress bar for file uploads

* Replace progress bar for file attachment document

* Upgrade RNN to 7.1.0 to fix share elements transitions

* Fix Gallery unit tests

* translate down when popping screen on iOS

* Swipe, Pan & Tap fixes

* fix gallery footer avatar eslint

* Fix gallery snapshot tests

* Use CompassIcon in Gallery

* Feedback from UX review

* Fix gallery UI for other file types

* Set other file type gallery button to 48pt
2020-11-06 21:17:27 -03:00

116 lines
2.6 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {intlShape} from 'react-intl';
import {StyleProp, ViewStyle} from 'react-native';
import Animated from 'react-native-reanimated';
import type {FileInfo} from '@mm-redux/types/files';
import type {Theme} from '@mm-redux/types/preferences';
export interface ActionCallback {
(callback: CallbackFunctionWithoutArguments): void;
}
export interface ActionProps {
action: (callback: CallbackFunctionWithoutArguments) => void;
children: React.ReactNode;
style?: StyleProp<ViewStyle>;
visible: boolean;
}
export interface ActionsProps {
canDownloadFiles: boolean;
downloadAction: ActionCallback;
file: FileInfo;
linkAction: ActionCallback;
}
export interface AvatarProps {
avatarUri?: string;
theme: Theme;
}
export interface CallbackFunctionWithoutArguments {
(): void;
}
export interface DetailsProps {
channel?: string;
isDirect?: boolean;
ownPost?: boolean;
user?: string;
}
export interface PrepareFileRef {
start(file: FileInfo, share?: boolean): Promise<string | undefined>;
}
export interface FooterProps {
intl: typeof intlShape;
file: FileInfo;
}
export interface FooterRef {
toggle(): boolean;
isVisible(): boolean;
}
export interface GalleryProps {
files: Array<FileInfo>;
footerVisible: boolean;
height: number;
initialIndex: number;
isLandscape: boolean;
onClose: CallbackFunctionWithoutArguments;
onPageSelected: (index: number) => void;
onTap: CallbackFunctionWithoutArguments;
width: number;
theme: Theme;
}
export interface GalleryItemProps {
file: FileInfo;
deviceHeight: number;
deviceWidth: number;
intl?: typeof intlShape;
isActive?: boolean;
onDoubleTap?: CallbackFunctionWithoutArguments;
style?: StyleProp<Animated.AnimateStyle>;
theme?: Theme;
}
export interface ManagedConfig {
[key: string]: string;
}
export interface ShowToast {
(text: string, duration?: number, callback?: () => void): void;
}
export interface SummaryProps {
avatarUri?: string;
channelName?: string;
copyPublicLink: ActionCallback;
displayName?: string;
dowloadFile: ActionCallback;
file: FileInfo;
isDirectChannel: boolean;
isLandscape: boolean;
ownPost: boolean;
theme: Theme;
}
export interface ToastProps {
theme: Theme;
}
export interface ToastRef {
show: ShowToast
}
export interface ToastState {
animation?: CompositeAnimation,
duration?: number;
callback?: () => void;
}