mirror of
https://github.com/actions/github-script.git
synced 2026-04-07 14:49:25 +00:00
Expose async-function argument type
We are exposing the async-function argument type for jsDoc
type declaration support. This means that we now could do:
"npm i -D @types/github-script@github:actions/github-script"
and the add:
"@param {import('@types/github-script').AsyncFunctionArguments}
AsyncFunctionArguments".
This could obviously be done in other ways too, like using
"@typed-actions/github-script" instead. But it seems better
to use the actual source repository instead of a third-party
library to import the type declaration.
This commit is contained in:
parent
6f00a0b667
commit
56bdc6c318
5 changed files with 197 additions and 2 deletions
|
|
@ -8,7 +8,7 @@ import fetch from 'node-fetch'
|
|||
|
||||
const AsyncFunction = Object.getPrototypeOf(async () => null).constructor
|
||||
|
||||
type AsyncFunctionArguments = {
|
||||
export declare type AsyncFunctionArguments = {
|
||||
context: Context
|
||||
core: typeof core
|
||||
github: InstanceType<typeof GitHub>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue