@sberdevices/plasma-temple
Version:
SberDevices CanvasApp Templates.
28 lines • 1.12 kB
TypeScript
import React from 'react';
import { AnyObject } from '../../types';
import { GalleryCardParams, GalleryCardProps } from '../GalleryCard/types';
export interface WithNavigationProps {
axis?: 'x' | 'y';
activeIndex?: number;
}
declare type GalleryClassNameProps<T> = T & {
className?: string;
};
export interface GalleryPropsWithChildren {
children: React.ReactNode;
items?: never;
onItemFocus?: never;
onItemClick?: never;
Component?: never;
}
export interface GalleryPropsWithComponent<T extends AnyObject = AnyObject> {
items: GalleryCardParams<T>[];
onItemFocus?: () => void;
onItemClick: (val: GalleryCardParams<T>, index: number) => void;
Component?: React.ComponentType<GalleryCardProps<T>>;
children?: never;
}
export declare type GalleryProps<T extends AnyObject = AnyObject> = GalleryClassNameProps<GalleryPropsWithChildren | GalleryPropsWithComponent<T>>;
export declare type GalleryWithNavigationProps<T extends AnyObject = AnyObject> = WithNavigationProps & GalleryProps<T> & React.RefAttributes<HTMLDivElement>;
export {};
//# sourceMappingURL=types.d.ts.map