Current Behavior
When fetching projects from an organization with await organization.fetch('projects'); (see for example this line in documentation) Typescript will throw an error like this:
Expected 2 arguments, but got 1.ts(2554)
transifexApi.d.ts(20, 35): An argument for 'force' was not provided.
(method) JsonApiResource.fetch(relationshipName: string, force: boolean): Promise<JsonApiResource | Collection>
Expected Behavior
As force is an optional parameter that defaults to false, the end developer should not be required to provide a value simply to satisfy the typechecker.
Steps to Reproduce
In a TypeScript module working with @transifex/api package, add this line and you should see the error while typechecking.
const projects = await organization.fetch('projects');
Possible Solution
Update this line in transifexApi.d.ts so that force is optional: https://github.com/transifex/transifex-javascript/blob/master/packages/api/src/transifexApi.d.ts#L20
old:
fetch(relationshipName: string, force: boolean): Promise<JsonApiResource | Collection>;
new:
fetch(relationshipName: string, force?: boolean): Promise<JsonApiResource | Collection>;
Possible Implementation
n/a
Current Behavior
When fetching projects from an organization with
await organization.fetch('projects');(see for example this line in documentation) Typescript will throw an error like this:Expected Behavior
As
forceis an optional parameter that defaults tofalse, the end developer should not be required to provide a value simply to satisfy the typechecker.Steps to Reproduce
In a TypeScript module working with
@transifex/apipackage, add this line and you should see the error while typechecking.Possible Solution
Update this line in
transifexApi.d.tsso thatforceis optional: https://github.com/transifex/transifex-javascript/blob/master/packages/api/src/transifexApi.d.ts#L20old:
new:
Possible Implementation
n/a