import { getGUID } from "@pnp/common" ; import { params } from "../services/Parameters" ; import { CustomWebpartSource } from './Enums' ; export interface IChoice { key : string ; text : string ; } export interface ISubject { Id : string ; Name : string ; } export interface ITechnology { Id : string ; Name : string ; Subjects : ISubject [ ] ; } export interface IMetadataEntry { Id : string ; Name : string ; } export interface IMultilingualString { LanguageCode : string ; Text : string ; } export class MultilingualString implements IMultilingualString { constructor ( public LanguageCode = params . defaultLanguage , public Text = "" ) { } } export interface ICategory { Id : string ; Name : string | IMultilingualString [ ] ; Image : string | IMultilingualString [ ] ; TechnologyId : string ; SubjectId : string ; Source : string ; SubCategories : ICategory [ ] ; Path ? : string [ ] ; Count ? : number ; } export class SubCat implements ICategory { constructor ( public Id = getGUID ( ) , public Name = [ new MultilingualString ( ) ] , public Image = [ new MultilingualString ( params . defaultLanguage , `${ params . baseCdnPath }${ params . defaultLanguage }/images/categories/customfeatured.png` ) ] , public TechnologyId = "" , public SubjectId = "" , public Source = CustomWebpartSource . Tenant , public SubCategories = [ ] , public Path = [ ] , public Count = 0 ) { } } export interface IListing { heading : ICategory ; playlists : IPlaylist [ ] ; } export interface IVersion { Manifest : string ; ManifestMinWebPart : string ; CurrentWebPart : string ; RepoURL : string ; } export interface IContentPack { Id : string ; Name : string ; Description : string ; Image : string ; ProvisionUrl : string ; CdnBase : string ; } export interface IManifest { Telemetry : { AppInsightKey : string ; } ; Version : IVersion ; ContentPacks : IContentPack [ ] ; AssetOrigins : string [ ] ; Languages : string [ ] ; } export interface IMetadata { Technologies : ITechnology [ ] ; Categories : ICategory [ ] ; Audiences : IMetadataEntry [ ] ; Sources : string [ ] ; Levels : IMetadataEntry [ ] ; StatusTags : IMetadataEntry [ ] ; Telemetry : { AppInsightKey : string ; } ; Version : IVersion ; ContentPacks : IContentPack [ ] ; } export interface ICustomizations { Id : number ; eTag : string ; CustomSubcategories : ICategory [ ] ; HiddenTechnology : string [ ] ; HiddenSubject : string [ ] ; HiddenPlaylistsIds : string [ ] ; HiddenSubCategories : string [ ] ; } export class Customizations implements ICustomizations { constructor ( public Id = 0 , public eTag = "" , public CustomSubcategories = [ ] , public HiddenTechnology = [ ] , public HiddenSubject = [ ] , public HiddenPlaylistsIds = [ ] , public HiddenSubCategories = [ ] ) { } } export interface ICacheConfig { Id : number ; eTag : string ; Categories : ICategory [ ] ; Technologies : ITechnology [ ] ; CachedPlaylists : IPlaylist [ ] ; CachedAssets : IAsset [ ] ; AssetOrigins : string [ ] ; TelemetryKey : string ; LastUpdated : Date ; ManifestVersion : string ; WebPartVersion : string ; } export class CacheConfig implements ICacheConfig { constructor ( public Id = 0 , public eTag = "" , public Categories = [ ] , public Technologies = [ ] , public CachedPlaylists = [ ] , public CachedAssets = [ ] , public AssetOrigins = [ ] , public TelemetryKey = "" , public LastUpdated = null , public ManifestVersion = "" , public WebPartVersion = "4.0.0" ) { } } export interface ICDN { Id : string ; Name : string ; Base : string ; } export class CDN implements ICDN { constructor ( public Id = getGUID ( ) , public Name = "" , public Base = "" ) { } } export interface ICustomCDN { Id : number ; eTag : string ; CDNs : ICDN [ ] ; } export class CustomCDN implements ICustomCDN { constructor ( public Id = 0 , public eTag = "" , public CDNs = [ ] ) { } } export interface IPlaylist { [ '@odata.etag' ] ? : string ; Id : string ; Title : string | IMultilingualString [ ] ; Image : string | IMultilingualString [ ] ; LevelId : string ; LevelValue : IMetadataEntry ; AudienceId : string ; AudienceValue : IMetadataEntry ; TechnologyId : string ; SubjectId : string ; Source : string ; CatId : string ; Description : string | IMultilingualString [ ] ; StatusTagId : string ; StatusNote : string ; Assets : string [ ] ; } export class Playlist implements IPlaylist { constructor ( public Id = "0" , public Title = [ new MultilingualString ( ) ] , public Image = [ new MultilingualString ( ) ] , public LevelId = "" , public LevelValue = null , public AudienceId = "" , public AudienceValue = null , public TechnologyId = "" , public SubjectId = "" , public Source = CustomWebpartSource . Tenant , public CatId = "" , public Description = [ new MultilingualString ( ) ] , public StatusTagId = "" , public StatusNote = "" , public Assets = [ ] ) { } } export interface IPlaylistTranslation { LanguageCode : string ; Title : string ; Image : string ; Description : string ; Url : string ; } export class PlaylistTranslation implements IPlaylistTranslation { constructor ( public LanguageCode = "" , public Title = "" , public Image = "" , public Description = "" , public Url = "" ) { } } export interface IAsset { [ '@odata.etag' ] ? : string ; Id : string ; Title : string | IMultilingualString [ ] ; Url : string | IMultilingualString [ ] ; TechnologyId : string ; SubjectId : string ; Source : string ; StatusTagId : string ; StatusNote : string ; } export class Asset implements IAsset { constructor ( public Id = "0" , public Title = [ new MultilingualString ( ) ] , public Url = [ new MultilingualString ( ) ] , public TechnologyId = "" , public SubjectId = "" , public Source = CustomWebpartSource . Tenant , public StatusTagId = "" , public StatusNote = "" ) { } } export interface IFilter { Audience : string [ ] ; Level : string [ ] ; } export class Filter implements IFilter { constructor ( public Audience = [ ] , public Level = [ ] ) { } } export interface IFilterValue { Type : string ; Key : string ; Value : string ; } export class FilterValue implements IFilterValue { constructor ( public Type = "" , public Key = "" , public Value = "" ) { } } export interface IHistoryItem { Id : string ; Name : string ; Template : string ; } export class HistoryItem implements IHistoryItem { constructor ( public Id = null , public Name = null , public Template = null ) { } } export interface IButtonType { Class : string ; SVG : string ; } export interface ISearchResult { Type : string ; Parent : IPlaylist | ICategory ; Result : IPlaylist | IAsset ; } export interface ILocale { localeId : number ; description : string ; code : string ; }