Checklist
Environment
Versions
├── @octokit/auth-app@3.6.0
├── @octokit/rest@18.9.1
What happened?
The params object type for rest.issues.setLabels requires the labels attribute to be of type string[] & { name: string; }[] I have not found a value that allows this type signature to be satisfied, and I think it is incorrect.
Minimal test case to reproduce the problem
export const setIssueLabels = async (
context: Context,
labels: string[]
): Promise<void> => {
await context.client.rest.issues.setLabels({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
labels: labels,
});
};
Causes the following TypeScript error:
Type 'string[]' is not assignable to type 'string[] & { name: string; }[]'.
Type 'string[]' is not assignable to type '{ name: string; }[]'.
Type 'string' is not assignable to type '{ name: string; }'
The error also occurs when attempting to pass in an array of { name: string }
I know that using a string[] is valid, the above code works, it just requires casting the labels to any.
What did you expect to happen?
string[] to be an allowed type of labels attribute
What the problem might be
The type of labels attribute should be string[] | { name: string; }[]
Checklist
Environment
Versions
What happened?
The params object type for
rest.issues.setLabelsrequires thelabelsattribute to be of typestring[] & { name: string; }[]I have not found a value that allows this type signature to be satisfied, and I think it is incorrect.Minimal test case to reproduce the problem
Causes the following TypeScript error:
The error also occurs when attempting to pass in an array of
{ name: string }I know that using a string[] is valid, the above code works, it just requires casting the labels to any.
What did you expect to happen?
string[]to be an allowed type oflabelsattributeWhat the problem might be
The type of
labelsattribute should bestring[] | { name: string; }[]