Skip to content
This repository has been archived by the owner on Sep 14, 2019. It is now read-only.

add typescript typings #19

Closed
akosyakov opened this issue Sep 11, 2018 · 4 comments · Fixed by #33
Closed

add typescript typings #19

akosyakov opened this issue Sep 11, 2018 · 4 comments · Fixed by #33
Labels

Comments

@akosyakov
Copy link

No description provided.

@TimonVS
Copy link
Contributor

TimonVS commented Jun 24, 2019

I already created a PR to fix this, but if in the meantime you're struggling with this, do the following:

Configure typeroots in ./tsconfig.json:

{
  "compilerOptions": {
    "allowJs": false,
    "lib": ["es2015", "es2017"],
    "module": "commonjs",
    "moduleResolution": "node",
    "target": "es5",
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true,
    "noUnusedLocals": true,
    "pretty": true,
    "strict": true,
    "sourceMap": true,
    "outDir": "./lib",
    "skipLibCheck": true,
    "noImplicitAny": true,
    "esModuleInterop": true,
    "declaration": true,
+   "typeRoots" : ["./node_modules/@types", "./typings"]
  },
  "include": [
    "src/**/*"
  ],
  "compileOnSave": false
}

Add ./typings/probot-config/index.d.ts:

declare module 'probot-config' {
  import { Context } from 'probot'
  import { Options as DeepMergeOptions } from 'deepmerge'

  export default function getConfig<T>(
    context: Context,
    fileName: string,
    defaultConfig?: T,
    deepMergeOptions?: DeepMergeOptions
  ): Promise<T>
}

@gr2m gr2m closed this as completed in #33 Jun 24, 2019
@TimonVS
Copy link
Contributor

TimonVS commented Jun 26, 2019

@gr2m Should we do a 1.0.2 release to make the typings available? :)

@gr2m
Copy link
Contributor

gr2m commented Jun 26, 2019

Hmm yes it should have done that automatically, looks like I didn’t setup semantic-release yet

@probotbot
Copy link

🎉 This issue has been resolved in version 1.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants