66 lines
1.7 KiB
JavaScript
Raw Normal View History

2021-10-28 11:08:58 +02:00
import PropTypes from 'prop-types';
2021-09-16 13:48:21 +02:00
export const AssetType = {
Video: 'video',
Image: 'image',
Document: 'doc',
2022-02-06 11:49:57 +01:00
Audio: 'audio',
2021-09-16 13:48:21 +02:00
};
export const AssetSource = {
Url: 'url',
Computer: 'computer',
};
2021-10-28 11:08:58 +02:00
2022-05-18 09:43:01 +02:00
export const FolderDefinition = PropTypes.shape({
id: PropTypes.number.isRequired,
children: PropTypes.shape({
count: PropTypes.number.isRequired,
}).isRequired,
createdAt: PropTypes.string.isRequired,
createdBy: PropTypes.shape(),
files: PropTypes.shape({
count: PropTypes.number.isRequired,
}).isRequired,
name: PropTypes.string.isRequired,
parent: PropTypes.number,
updatedAt: PropTypes.string.isRequired,
updatedBy: PropTypes.shape(),
uid: PropTypes.string.isRequired,
path: PropTypes.string.isRequired,
});
const FolderStructure = PropTypes.shape({
value: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
label: PropTypes.string.isRequired,
children: PropTypes.array,
});
FolderStructure.children = PropTypes.arrayOf(PropTypes.shape(FolderStructure));
FolderStructure.defaultProps = {
children: undefined,
};
export const FolderStructureDefinition = PropTypes.arrayOf(FolderStructure);
2021-10-28 11:08:58 +02:00
export const AssetDefinition = PropTypes.shape({
id: PropTypes.number,
height: PropTypes.number,
width: PropTypes.number,
size: PropTypes.number,
createdAt: PropTypes.string,
ext: PropTypes.string,
mime: PropTypes.string,
name: PropTypes.string,
url: PropTypes.string,
updatedAt: PropTypes.string,
alternativeText: PropTypes.string,
caption: PropTypes.string,
2022-05-18 09:43:01 +02:00
folder: PropTypes.shape(FolderDefinition),
2021-10-28 11:08:58 +02:00
formats: PropTypes.shape({
thumbnail: PropTypes.shape({
url: PropTypes.string,
}),
}),
});