UNPKG

@gmetrixr/rjson

Version:
95 lines (94 loc) 3.53 kB
import { ElementProperty } from "../../recordTypes/Element"; import { ItemProperty } from "../../recordTypes/Item"; import { ICogObjectDefinition } from "../BaseCogObject"; export interface IElementDefinition extends ICogObjectDefinition { element_type: ElementType; elementDefaultName: string; properties: Array<ElementProperty>; defaultOverrides: Partial<Record<ElementProperty, unknown>>; itemProperties?: Array<ItemProperty>; itemDefaultOverrides?: Partial<Record<ItemProperty, unknown>>; } export declare enum ElementType { basic_element = "basic_element", image_flat = "image_flat", video_flat = "video_flat", audio = "audio", audio_ssml = "audio_ssml", text = "text", object_3d = "object_3d", collider_mesh = "collider_mesh", score = "score", timer = "timer", menu = "menu", gif = "gif", pano_image = "pano_image", pano_video = "pano_video", polygon = "polygon", cube = "cube", sphere = "sphere", cone = "cone", torus = "torus", cylinder = "cylinder", carousel = "carousel", wayfinder = "wayfinder", icon = "icon", speech = "speech", actionbar = "actionbar", product_card = "product_card", quiz = "quiz", group = "group", qrcode_browser = "qrcode_browser", qrcode_matcher = "qrcode_matcher", media_upload = "media_upload", web_state = "web_state", capture_input = "capture_input", share = "share", embed_html = "embed_html", ar = "ar", embed_scorm = "embed_scorm", instruction = "instruction", shopping_item = "shopping_item", popup = "popup", light = "light", hotspot = "hotspot", environment = "environment", zone = "zone", collider_box = "collider_box", collider_volume = "collider_volume", workspace_logo = "workspace_logo", screenshare = "screenshare", character = "character", embed_3d = "embed_3d" } export declare const elementDisplayNames: Record<ElementType, string>; export declare enum ElementCategory { panorama = "panorama", standard = "standard", audio = "audio", three_d = "three_d", spatial = "spatial", gamification = "gamification", user_input = "user_input", user_interface = "user_interface", connect = "connect", ecommerce = "ecommerce" } export declare const elementCategoryDisplayNames: Record<ElementCategory, string>; export declare const elementsWithLinkedVariables: ElementType[]; export declare const elementTypeByCategory: Record<ElementCategory, ElementType[]>; /** * https://www.typescriptlang.org/docs/handbook/2/narrowing.html#using-type-predicates * Useful while trying to use the ".type" property of an "untyped" json */ export declare function isElementType(type: string): type is ElementType; export declare const BasicElement: IElementDefinition; /** A list of properties that contain the type en.Source or en.Source[] */ export declare const sourcePropertyNames: { /** A list of all ElementProperties that end with the word "source". Use to understand which properties contain file source objects */ elementProperties: ElementProperty[]; /** A list of all ElementProperties that end with the word "sources". Use to understand which properties contain file source object arrays */ elementArrayProperties: ElementProperty[]; /** A list of all ItemProperties that end with the word "source". Use to understand which properties contain file source objects */ itemProperties: ItemProperty[]; };