Skip to content

Commit

Permalink
feat: includes the item's thumbnails in PackedItem (#660)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReidyT authored Sep 24, 2024
1 parent 17dd9b8 commit 433d047
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,11 @@ export * from './enums/alignment.js';
*/
export { type DiscriminatedItem, getMimetype } from './item/item.js';
export * from './item/itemSettings.js';
export { type PackedItem } from './item/packedItem.js';
export {
type PackedItem,
ThumbnailSizeInPackedItem,
type ThumbnailsBySize,
} from './item/packedItem.js';
export * from './item/itemType.js';
export * from './item/itemUtils.js';
export * from './item/events/itemFeedbackOperationEvent.js';
Expand Down
11 changes: 11 additions & 0 deletions src/item/packedItem.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,23 @@
import { ItemMembership } from '../itemMembership/itemMembership.js';
import { DiscriminatedItem } from './item.js';
import { ItemSettings } from './itemSettings.js';
import { ThumbnailSize } from '@/enums/thumbnailSizes.js';
import { ItemTag } from '@/itemTag/itemTag.js';
import { UnionOfConst } from '@/typeUtils.js';

export const ThumbnailSizeInPackedItem = {
[ThumbnailSize.Small]: ThumbnailSize.Small,
[ThumbnailSize.Medium]: ThumbnailSize.Medium,
} as const;
export type ThumbnailsBySize = {
[thumbnailSize in UnionOfConst<typeof ThumbnailSizeInPackedItem>]: string;
};

export type PackedInformation = {
permission: ItemMembership['permission'] | null;
hidden?: ItemTag;
public?: ItemTag;
thumbnails?: ThumbnailsBySize;
};

/**
Expand Down

0 comments on commit 433d047

Please sign in to comment.