Skip to content

Commit

Permalink
fix(javascript): expose sub algoliasearch client's type (#873)
Browse files Browse the repository at this point in the history
  • Loading branch information
shortcuts committed Jul 27, 2022
1 parent 0d988f9 commit b7e3c64
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@ export * from './models';

export const apiClientVersion = searchClientVersion;

/**
* The client type.
*/
export type Algoliasearch = ReturnType<typeof algoliasearch>;

Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ export * from '{{{npmNamespace}}}/client-personalization/model';
export * from '{{{npmNamespace}}}/client-analytics/model';
export * from '{{{npmNamespace}}}/client-abtesting/model';

export { SearchClient } from '{{{npmNamespace}}}/client-search';
export { PersonalizationClient } from '{{{npmNamespace}}}/client-personalization';
export { AnalyticsClient } from '{{{npmNamespace}}}/client-analytics';
export { AbtestingClient } from '{{{npmNamespace}}}/client-abtesting';

export { ErrorBase, PutProps, PostProps, DelProps, GetProps };

export type CommonClientOptions = { requester?: Requester; hosts?: Host[] };
Expand Down
3 changes: 3 additions & 0 deletions templates/javascript/clients/api-single.mustache
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,9 @@ export function create{{capitalizedApiName}}({
};
}

/**
* The client type.
*/
export type {{capitalizedApiName}} = ReturnType<typeof create{{capitalizedApiName}}>;

{{/operations}}

0 comments on commit b7e3c64

Please sign in to comment.