@payfit/unity-illustrations
Version:
31 lines (30 loc) • 989 B
TypeScript
import { UnityTheme } from '@payfit/unity-themes';
declare const __UNITY_ILLUSTRATION: unique symbol;
export interface IllustrationAssetBrand {
readonly [__UNITY_ILLUSTRATION]: true;
}
export type IllustrationAssetUrls = Partial<Record<UnityTheme, string>>;
export interface BaseSvgAsset {
readonly type: 'svg';
readonly url: string;
readonly urls?: IllustrationAssetUrls;
readonly animated: false;
}
export interface BaseImageAsset {
readonly type: 'image';
readonly url: string;
readonly urls?: IllustrationAssetUrls;
readonly animated: boolean;
}
export interface BaseAnimatedImageAsset extends BaseImageAsset {
readonly animated: true;
readonly dimensions: {
readonly width: number;
readonly height: number;
};
readonly category: 'animation';
}
export type IllustrationAsset<T extends (BaseSvgAsset | BaseImageAsset | BaseAnimatedImageAsset) & {
readonly name: string;
}> = T & IllustrationAssetBrand;
export {};