@payfit/unity-illustrations
Version:
40 lines (32 loc) • 1.05 kB
text/typescript
// AUTO-GENERATED FILE. DO NOT EDIT.
import type { UnityTheme } from '@payfit/unity-themes'
// Brand symbol for type safety
declare const __UNITY_ILLUSTRATION: unique symbol
export interface IllustrationAssetBrand {
readonly [__UNITY_ILLUSTRATION]: true
}
export type IllustrationAssetUrls = Partial<Record<UnityTheme, string>>
// Base interfaces
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'
}
// Branded wrapper type
export type IllustrationAsset<T extends (BaseSvgAsset | BaseImageAsset | BaseAnimatedImageAsset) & { readonly name: string }> =
T & IllustrationAssetBrand