Skip to content

Commit

Permalink
chore: Add JDoc type declaration for client.getStackClient()
Browse files Browse the repository at this point in the history
  • Loading branch information
Ldoppea authored and Crash-- committed Sep 22, 2022
1 parent 2447efe commit 928529d
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
5 changes: 5 additions & 0 deletions packages/cozy-client/src/CozyClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -1632,6 +1632,11 @@ instantiation of the client.`
return this.getStackClient()
}

/**
* Retrieve the CozyStackClient instance used by CozyClient
*
* @returns {CozyStackClient} - CozyStackClient instance
*/
getStackClient() {
if (!this.stackClient) {
this.createClient()
Expand Down
12 changes: 9 additions & 3 deletions packages/cozy-client/types/CozyClient.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ declare class CozyClient {
* @returns {DocumentCollection} Collection corresponding to the doctype
*/
collection(doctype: string): DocumentCollection;
fetch(method: any, path: any, body: any, options?: {}): any;
fetch(method: any, path: any, body: any, options?: {}): Promise<object>;
all(doctype: any): QueryDefinition;
find(doctype: any, selector?: any): QueryDefinition;
get(doctype: any, id: any): QueryDefinition;
Expand Down Expand Up @@ -660,8 +660,13 @@ declare class CozyClient {
createClient(): void;
stackClient: any;
client: any;
getClient(): any;
getStackClient(): any;
getClient(): CozyStackClient;
/**
* Retrieve the CozyStackClient instance used by CozyClient
*
* @returns {CozyStackClient} - CozyStackClient instance
*/
getStackClient(): CozyStackClient;
reducer(): (state: {
documents: {};
queries: {};
Expand Down Expand Up @@ -733,6 +738,7 @@ import { OpenURLCallback } from "./types";
import { SessionCode } from "./types";
import { PKCECodes } from "./types";
import { ReduxStore } from "./types";
import CozyStackClient from "cozy-stack-client";
import { CozyClient as SnapshotClient } from "./testing/snapshots";
import { OldCozyClient } from "./types";
import { NodeEnvironment } from "./types";
Expand Down

0 comments on commit 928529d

Please sign in to comment.