Skip to content

Commit ff40301

Browse files
author
Nikos Vasileiou
authored
Merge pull request #155 from transifex/update-api-ts
Update @transifex/api d.ts
2 parents ba58ea0 + 1290133 commit ff40301

1 file changed

Lines changed: 16 additions & 16 deletions

File tree

packages/api/src/transifexApi.d.ts

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,21 @@ declare class JsonApiResource {
1515
});
1616
get(key: string): any;
1717
set(key: string, value: any): void;
18-
async reload(include: string[]): null;
19-
static async get(arg:string | AnyDict): JsonApiResource;
20-
async fetch(relationshipName: string, force: boolean): JsonApiResource | Collection;
21-
async save(arg: AnyDict | string[]): null;
22-
static async create({
18+
reload(include: string[]): Promise<void>;
19+
static get(arg:string | AnyDict): Promise<JsonApiResource>;
20+
fetch(relationshipName: string, force: boolean): Promise<JsonApiResource | Collection>;
21+
save(arg: AnyDict | string[]): Promise<void>;
22+
static create({
2323
id: string,
2424
attributes: AnyDict,
2525
relationships: AnyDict,
2626
links: StringDict,
27-
}): JsonApiResource;
28-
async delete(): void;
29-
async change(field: string, value:JsonApiResource | null): void;
30-
async add(field: string, values: JsonApiResource[]): null;
31-
async reset(field: string, values: JsonApiResource[]): null;
32-
async remove(field: string, values: JsonApiResource[]): null;
27+
}): Promise<JsonApiResource>;
28+
delete(): Promise<void>;
29+
change(field: string, value:JsonApiResource | null): Promise<void>;
30+
add(field: string, values: JsonApiResource[]): Promise<void>;
31+
reset(field: string, values: JsonApiResource[]): Promise<void>;
32+
remove(field: string, values: JsonApiResource[]): Promise<void>;
3333
static list(): Collection;
3434
static extra(AnyDict): Collection;
3535
static filter(filters: AnyDict): Collection;
@@ -42,9 +42,9 @@ declare class JsonApiResource {
4242
}
4343

4444
declare class Collection {
45-
async fetch(): void;
46-
async getNext(): Collection
47-
async getPrevious(): Collection
45+
fetch(): Promise<void>;
46+
getNext(): Promise<Collection>;
47+
getPrevious(): Promise<Collection>;
4848
extra(AnyDict): Collection;
4949
filter(filters: AnyDict): Collection;
5050
page(arg: AnyDict | string): Collection;
@@ -58,7 +58,7 @@ declare class Collection {
5858
type AuthFunction = () => string;
5959
type AuthArgument = string | AuthFunction;
6060

61-
declare export class TransifexApi {
61+
export declare class TransifexApi {
6262
constructor({ host: string, auth: AuthArgument });
6363
setup({ host: string, auth: AuthArgument }): void;
6464

@@ -117,4 +117,4 @@ declare export class TransifexApi {
117117
resource_strings_revisions: typeof JsonApiResource;
118118
}
119119

120-
declare export var transifexApi: TransifexApi;
120+
export declare var transifexApi: TransifexApi;

0 commit comments

Comments
 (0)