microsoft / vss-web-extension-sdk

Visual Studio Teams Service Web Extension SDK
https://www.visualstudio.com/docs/integrate/extensions/overview
MIT License
133 stars 87 forks source link

ModuleLoaderConfiguration typing definition all properties required #90

Open damienpontifex opened 6 years ago

damienpontifex commented 6 years ago

The ModuleLoadConfiguration defined in vss.d.ts L2519-2528 has all properties as non-optional. This is contrary to samples which only setup init like so:

VSS.init({
    explicitNotifyLoaded: true,
    moduleLoaderConfig: {
        paths: {
            "scripts": "scripts"
        }
    }
});

// Wait for the SDK to be initialized, then require the script, then signal load complete
VSS.ready(function () {
    require(["./scripts/actions"], function (actions) {
        VSS.notifyLoadSucceeded();
    });
});

Should the interface be updated to:

interface ModuleLoaderConfiguration {
    baseUrl?: string;
    contributionPaths?: { [key: string]: ContributionPath; };
    paths?: { [key: string]: string; };
    shim?: { [key: string]: ModuleLoaderShimConfiguration; };
    /**
    * The maximum amount of time (in seconds) the AMD loader will wait for scripts to load.
    */
    waitSeconds?: number;
}
VAllens commented 4 years ago

I agree with that. Because in TypeScript's intelliSense perception, it caused me a misunderstanding.