typings / discussions

For discussions and issues with Typings or TypeScript definitions
7 stars 0 forks source link

Where are the docs for writing a typings.json file? #27

Open EisenbergEffect opened 8 years ago

EisenbergEffect commented 8 years ago

I've been poking around but can't seem to find the documentation for writings typings.json files. I've got some basics in place but need to do something a bit different. I need a repo to not have a main but instead a list of d.ts files that it exports. I'm thinking I could add a files property and list them, but I can't find any docs to confirm that.

EisenbergEffect commented 8 years ago

See this repo for reference: https://github.com/aurelia/typings

We'd like to enable someone to install that repo with typings and get all the dts files in the dist folder. I'm just not sure how to author the typings file correctly for this scenario.

blakeembrey commented 8 years ago

@EisenbergEffect There is a section here: https://github.com/typings/typings/blob/master/docs/faq.md#writing-typings-definitions. Here's the definition for files: https://github.com/typings/core/blob/master/src/interfaces/config.ts#L26-L30.

phreed commented 8 years ago

It works for me, here is an example.

{
    "name": "webgme",
    "main": "webgme.d.ts",
    "files":    [
        "./blobjs.d.ts",
        "./pluginjs.d.ts",
        "./webgme.d.ts",
        "./webgmeV1.d.ts"],
    "global": true,
    "dependencies": {
    },
    "devDependencies": {},
    "globalDependencies": {
        "q": "registry:dt/q#0.0.0+20160613154756"
    },
    "globalDevDependencies": {
    }
}

The git repository has each of the *.d.ts files. When typings install retrieves the files they are concatenated into a single 'index.d.ts' file with the main appearing first.

EisenbergEffect commented 8 years ago

@phreed Thanks!