react-fex-gallery
Version:
React gallery powered by FEX.net API
70 lines (69 loc) • 1.69 kB
TypeScript
import { IContentText, IFexApiResponse, Image, IState } from './interfaces';
import React, { Dispatch } from 'react';
export declare const defaultContentText: IContentText;
export declare type Action = {
type: 'reset-gallery';
} | {
type: 'toggle-show-only-selected';
} | {
type: 'toggle-selected-item';
image: Image;
} | {
type: 'set-search-image-query';
query: string;
} | {
type: 'clear-search-image-query';
} | {
type: 'unselect-all';
} | {
type: 'append-images';
images: Image[];
} | {
type: 'set-images';
images: Image[];
} | {
type: 'append-response';
images: Image[];
pagination: IFexApiResponse['pagination'];
endPoint: string;
setLastIndex?: boolean;
setNextIndex?: boolean;
} | {
type: 'switch-show-info';
infoForImage?: Image;
} | {
type: 'change-show-info';
showInfo: boolean;
infoForImage?: Image;
} | {
type: 'switch-view';
view: IState['view'];
} | {
type: 'set-current-index';
index: number;
} | {
type: 'fetch-more-images';
fetchAll?: boolean;
setNextIndex?: boolean;
} | {
type: 'update-endpoint';
endPoint: string;
} | {
type: 'show-notifier';
message: string;
} | {
type: 'clear-notifier';
} | {
type: 'after-delete-images';
count?: number;
newIndex?: number;
images?: Image[];
} | {
type: 'set-images-count';
imagesCount: number;
};
export declare const useStore: (_state?: IState | undefined) => [IState, Dispatch<Action>];
export declare const AppContext: React.Context<{
state: IState;
dispatch: React.Dispatch<Action>;
}>;