engine
engine copied to clipboard
Fix AppOption types
This PR updates AppOption types to class constructors (instead of class instances), which appears to appease typescript.
VSCode shows errors on these now, not sure how to fix that.
I tried few variations of these (not this one yet), and something always does not work.
With the latest update playcanvas.d.ts looks as follows:
lightmapper: any;
/**
* The BatchManager.
*
* @type {typeof BatchManager}
*/
batchManager: any;
/**
* The XrManager.
*
* @type {typeof XrManager}
*/
xr: any;
/**
* The component systems the app requires.
*
* @type {(typeof ComponentSystem)[]}
*/
componentSystems: (typeof ComponentSystem)[];
/**
* The resource handlers the app requires.
*
* @type {(typeof ResourceHandler)[]}
*/
resourceHandlers: (typeof ResourceHandler)[];
resource handler is being recast as an interface in types-fixup.js:
dts = dts.replace('export class ResourceHandler', 'export interface ResourceHandler');
@willeastcott any idea why this is done?
also, try to build API docs from jsdocs locally, I think I had issues with this in the past as well.
Yep, I have a feeling the docs build process fails on those typeof keywords, IIRC.
The latest version (with constructor syntax) seems to work fine when compiling typescript and also generates docs.
CI fails though.
related https://github.com/playcanvas/engine/pull/4324