Source: typedef.js

// import {Resource} from './package/resource.js';

/**
 * Linux syslog level 0 - 7
 * @typedef {'emergency'|'critical'|'alert'|'error'|'warning'|'notice'|'info'|'debug'} SyslogLevel
 */

/**
 * Linux syslog level 0 - 7
 * @typedef {0|1|2|3|4|5|6|7} SyslogLevelNum
 */


/**
 * @typedef {Object} LogObject
 * @property {string} msg
 * @property {SyslogLevel} [level=debug]
 * @property {number} [time]
 * @property {Object} [source]
 * @property {UUID} [source.id]
 * @property {string} [source.name]
 * @property {string} [source.type]
 */


/**
 * @typedef {Object} ReportInstruction
 * @property {(function|'console'|URL)} sendTo
 * @property {SyslogLevel} fromLevel
 */


/**
 * Stringified LogObject
 * @typedef {string} LogObjectString
 */

/**
 * Universally unique identifier. 128 bit number of the form
 * "xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx", where x is one of [0-9, a-f]
 * and M is one of [1-5] and N is [8, 9, a, or b]
 * @typedef {string} UUID
 */


/**
 * @typedef {String} Semver 
 */

/**
 * @typedef {('medium')} LoadingQuality
 */

/**
 * @typedef {Object} QualitySource
 * @property {number} sizeBytes
 * @property {string} path - path to file in the package
 */

/**
 * @typedef {Object} QualitySourceMap
 * @property {QualitySource} [high]
 * @property {QualitySource} medium
 * @property {QualitySource} [low]
 */

/**
 * A stringified simple object representing a configuration body
 * @typedef {string} BlockInstanceString
 */

/**
 * A summarized version of a configured product with relevant manufacturer ids, selected fabrics
 * @typedef {Object} ProductSummary
 * @property {UUID} configuration_id
 * @property {Object} products
 */

/**
 * A summarized version of a configuration that can be used by
 * external apps (i.e. a parent window hosting a configurator
 * in an iFrame adding a configured product to a shopping cart).
 * @typedef {Object} ConfigurationSummary
 * @property {Object[]} products
 *
 *  configuration id, price
 */

/**
 * A simple object representing a configuration body
 * @typedef {object} ParsedBlockInstanceString
 * @property {UUID} uuid
 * @property {UUID} templateBlock
 * @property {Array<number>} position
 * @property {Array<number>} rotation                   LETS TURN THIS INTO QUATERNIONS
 */



/**
 * A stringified simple object representing a configuration connector instance
 * @typedef {string} ConnectorInstanceString
 */


/**
 * A simple object representing a configuration connector instance
 * @typedef {object} ParsedConnectorInstanceString
 * @property {UUID} UUID
 * @property {UUID} connector
 * @property {UUID} blockInstance
 */


/**
 * A stringified simple object representing a configuration connection
 * @typedef {string} ConnectionString
 */


/**
 * A simple object representing a configuration connection
 * @typedef {object} ParsedConnectionString
 * @property {UUID} UUID
 * @property {ParsedConnectorInstanceString} from
 * @property {ParsedConnectorInstanceString} to
 */




/**
 * A stringified simple object representing a configuration body
 * @typedef {string} BodyString
 */


/**
 * A simple object representing a configuration body
 * @typedef {object} ParsedBodyString
 * @property {Array<ParsedBlockInstanceString>} blockInstances
 * @property {Array<ParsedConnectionString>} connections
 */




/**
 * @typedef {string} ConfigString
 */

/**
 * @typedef {object} ParsedConfigString
 * @property {Array<ParsedBodyString>} bodies
 * @property {object} materials
 */




 /**
 * @typedef {Object} YoctopusRequest
 * @property {string} method
 * @property {string} endpoint
 * @property {UUID} [id]
 * @property {object} [data]
 */

/**
 * @typedef {Object} YoctopusResponse
 * @property {object} meta
 * @property {UUID} meta.id
 * @property {string} meta.method
 * @property {string} meta.endpoint
 * @property {object} [data]
 */

/**
 * @typedef {Object} YoctopusNotification
 * @property {object} meta
 * @property {UUID} meta.id
 * @property {string} meta.type
 * @property {string} meta.method
 * @property {object} [data]
 */

/**
 * @typedef {Object} ViewPoint
 * @property {'left'|'center'|'right'} x
 * @property {'lower'|'middle'|'upper'} y
 * @property {'front'|'center'|'back'} z
 */

/**
 * @typedef {'GPL'} PackageLicense
 */


/**
 * @typedef {Object} PackageMetadata
 * @property {UUID} id
 * @property {string} name
 * @property {string} [description]
 * @property {string} author
 * @property {PackageLicense} license
 * @property {string} generator
 * @property {string} repository
 */

/**
 * @typedef {Object} ConfigurationOptions
 * @property {Boolean} blockInsert
 * @property {Boolean} blockExtend
 * @property {Boolean} blockReplace
 */

/**
 * @typedef {Object} BlockSetOption
 * @property {('all'|string)} blockSet - name of the block set
 */

/**
 * @typedef {Object} MaterialSetOption
 * @property {('all'|string)} materialSet - name of the material set
 */

/**
 * @typedef {Object} LibraryNavigationItem
 * @property {string} label
 * @property {('presets'|BlockSetOption|MaterialSetOption)} show
 */


/**
 * @typedef {Object} NavigationOptions
 * @property {Array<LibraryNavigationItem>} library
 */


/**
 * @typedef {Object} CommonInformationSourceData
 * @property {UUID} [data.id]
 * @property {string} [data.name]
 * @property {URL} [data.url]
 */



/**
 * @typedef {('LineBasicMaterial'|'LineDashedMaterial'|'MeshBasicMaterial'|'MeshDepthMaterial'|'MeshDistanceMaterial'|'MeshLambertMaterial'|'MeshMatcapMaterial'|'MeshNormalMaterial'|'MeshPhongMaterial'|'MeshPhysicalMaterial'|'MeshStandardMaterial'|'MeshToonMaterial'|'PointsMaterial'|'RawShaderMaterial'|'ShaderMaterial'|'ShadowMaterial'|'SpriteMaterial')} MaterialType
 */


/**
 * @typedef {Object} SourceFile
 * @property {string} inPackageURL
 * @property {number} fileSize
 */



/**
 * @typedef {('main'|'UI'|'specs')} ComponentPart
 */


/**
 * @typedef {('not-loaded'|'partially-loaded'|'loading'|'ready'|'error')} ComponentPartQualityStatus
 */

/**
 * @typedef {Object} ComponentPartStatus
 * @property {ComponentPartQualityStatus} high
 * @property {ComponentPartQualityStatus} medium
 * @property {ComponentPartQualityStatus} low
 */

/**
 * @typedef {Object} ComponentStatus
 * @property {ComponentPartStatus} UI
 * @property {ComponentPartStatus} main
 * @property {ComponentPartStatus} specs
 */


/**
 * @typedef {Object} QualityContent
 * @property {(Object|null)} high
 * @property {(Object|null)} medium
 * @property {(Object|null)} low
 */

/**
 * @typedef {Object} ComponentContent
 * @property {QualityContent} UI
 * @property {QualityContent} main
 * @property {QualityContent} specs
 */



/**
 * @typedef {('dimensions'|'3D')} ViewType
 */

/**
 * @typedef {('parent'|'child'|'none')} ConnectionRole
 */

/**
 * @typedef {('root'|'inline')} ExportLevel
 */

// /**
//  * @typedef {import('./configurator/configuration.js').ConnectInstruction} ConnectInstruction
//  */

//  /**
//  * @typedef {Object} ConnectInstruction
//  * @property {Object} from
//  * @property {(import('./configurator/connectable.js').Connectable|'new')} from.connectable
//  * @property {import('./package/connector/connector.js').Connector} from.connector
//  * @property {Object} to
//  * @property {(import('./configurator/connectable.js').Connectable|'new')} to.connectable
//  * @property {import('./package/connector/connector.js').Connector} to.connector
//  */

// /**
//  * @typedef {Object} InsertOption
//  * @property {import('./package/block/block.js').Block} block
//  * @property {ConnectInstruction} newConnection1
//  * @property {ConnectInstruction} newConnection2
//  * @property {import('./configurator/connection.js').Connection} oldConnection
//  */