-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP Playing around with .d.ts generation #4156
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import * as Mocha from './'; | ||
|
||
declare global { | ||
const after: typeof Mocha.after; | ||
const afterEach: typeof Mocha.afterEach; | ||
const before: typeof Mocha.after; | ||
const beforeEach: typeof Mocha.beforeEach; | ||
const describe: typeof Mocha.describe; | ||
const it: typeof Mocha.after; | ||
const xit: typeof Mocha.xit; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
import * as Mocha from './types/mocha'; | ||
export = Mocha; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export interface MochaArgs { | ||
/** Path to `package.json` or `false` to skip */ | ||
config?: string | false; | ||
package?: boolean; | ||
/** Filepath to mocha.opts; defaults to whatever's in `mocharc.opts`, or `false` to skip */ | ||
opts?: string | false; | ||
} | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,7 +29,10 @@ var assign = (exports.assign = require('object.assign').getPolyfill()); | |
* @throws {TypeError} if either constructor is null, or if super constructor | ||
* lacks a prototype. | ||
*/ | ||
exports.inherits = util.inherits; | ||
exports.inherits = function(ctor, superCtor) { | ||
// Wrapper prevents type declarations from referring to @types/node | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. You could also just add a |
||
return util.inherits.call(this, ctor, superCtor); | ||
}; | ||
|
||
/** | ||
* Escape special characters in the given string of html. | ||
|
@@ -708,7 +711,7 @@ exports.isPromise = function isPromise(value) { | |
* Clamps a numeric value to an inclusive range. | ||
* | ||
* @param {number} value - Value to be clamped. | ||
* @param {numer[]} range - Two element array specifying [min, max] range. | ||
* @param {number[]} range - Two element array specifying [min, max] range. | ||
* @returns {number} clamped value | ||
*/ | ||
exports.clamp = function clamp(value, range) { | ||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please do this with a
@typedef
; I really don't want to add any typescript sources.