@stream-io/feeds-client 0.1.9 → 0.1.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/@react-bindings/hooks/search-state-hooks/index.ts +3 -0
- package/@react-bindings/index.ts +5 -0
- package/CHANGELOG.md +7 -0
- package/dist/@react-bindings/contexts/StreamSearchContext.d.ts +12 -0
- package/dist/@react-bindings/contexts/StreamSearchResultsContext.d.ts +12 -0
- package/dist/@react-bindings/hooks/search-state-hooks/index.d.ts +3 -0
- package/dist/@react-bindings/hooks/search-state-hooks/useSearchQuery.d.ts +4 -0
- package/dist/@react-bindings/hooks/search-state-hooks/useSearchResult.d.ts +8 -0
- package/dist/@react-bindings/hooks/search-state-hooks/useSearchSources.d.ts +4 -0
- package/dist/@react-bindings/index.d.ts +5 -0
- package/dist/@react-bindings/wrappers/StreamSearch.d.ts +12 -0
- package/dist/@react-bindings/wrappers/StreamSearchResults.d.ts +12 -0
- package/dist/index-react-bindings.browser.cjs +85 -16
- package/dist/index-react-bindings.browser.cjs.map +1 -1
- package/dist/index-react-bindings.browser.js +77 -17
- package/dist/index-react-bindings.browser.js.map +1 -1
- package/dist/index-react-bindings.node.cjs +85 -16
- package/dist/index-react-bindings.node.cjs.map +1 -1
- package/dist/index-react-bindings.node.js +77 -17
- package/dist/index-react-bindings.node.js.map +1 -1
- package/dist/index.browser.cjs +26 -125
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +26 -125
- package/dist/index.browser.js.map +1 -1
- package/dist/index.node.cjs +26 -125
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.js +26 -125
- package/dist/index.node.js.map +1 -1
- package/dist/src/common/BaseSearchSource.d.ts +3 -1
- package/dist/src/common/FeedSearchSource.d.ts +5 -1
- package/dist/src/common/SearchController.d.ts +2 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/common/ActivitySearchSource.ts +5 -15
- package/src/common/BaseSearchSource.ts +9 -9
- package/src/common/FeedSearchSource.ts +20 -65
- package/src/common/SearchController.ts +2 -0
- package/src/common/UserSearchSource.ts +9 -61
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { StateStore } from './StateStore';
|
|
2
2
|
import { type DebouncedFunc } from './utils';
|
|
3
|
-
export type SearchSourceType = '
|
|
3
|
+
export type SearchSourceType = 'activity' | 'user' | 'feed' | (string & {});
|
|
4
4
|
export type QueryReturnValue<T> = {
|
|
5
5
|
items: T[];
|
|
6
6
|
next?: string | null;
|
|
@@ -44,10 +44,12 @@ export type SearchSourceOptions = {
|
|
|
44
44
|
/** The number of milliseconds to debounce the search query. The default interval is 300ms. */
|
|
45
45
|
debounceMs?: number;
|
|
46
46
|
pageSize?: number;
|
|
47
|
+
allowEmptySearchString?: boolean;
|
|
47
48
|
};
|
|
48
49
|
export declare abstract class BaseSearchSource<T> implements SearchSource<T> {
|
|
49
50
|
state: StateStore<SearchSourceState<T>>;
|
|
50
51
|
protected pageSize: number;
|
|
52
|
+
protected allowEmptySearchString: boolean;
|
|
51
53
|
abstract readonly type: SearchSourceType;
|
|
52
54
|
protected searchDebounced: DebouncedExecQueryFunction;
|
|
53
55
|
protected constructor(options?: SearchSourceOptions);
|
|
@@ -2,10 +2,14 @@ import { BaseSearchSource } from './BaseSearchSource';
|
|
|
2
2
|
import type { SearchSourceOptions } from './BaseSearchSource';
|
|
3
3
|
import { FeedsClient } from '../FeedsClient';
|
|
4
4
|
import { Feed } from '../Feed';
|
|
5
|
+
export type FeedSearchSourceOptions = SearchSourceOptions & {
|
|
6
|
+
groupId?: string;
|
|
7
|
+
};
|
|
5
8
|
export declare class FeedSearchSource extends BaseSearchSource<Feed> {
|
|
6
9
|
readonly type: "feed";
|
|
7
10
|
private readonly client;
|
|
8
|
-
|
|
11
|
+
private readonly feedGroupId?;
|
|
12
|
+
constructor(client: FeedsClient, options?: FeedSearchSourceOptions);
|
|
9
13
|
protected query(searchQuery: string): Promise<{
|
|
10
14
|
items: never[];
|
|
11
15
|
next?: undefined;
|
|
@@ -17,6 +17,8 @@ export declare class SearchController {
|
|
|
17
17
|
/**
|
|
18
18
|
* Not intended for direct use by integrators, might be removed without notice resulting in
|
|
19
19
|
* broken integrations.
|
|
20
|
+
*
|
|
21
|
+
* @internal
|
|
20
22
|
*/
|
|
21
23
|
_internalState: StateStore<InternalSearchControllerState>;
|
|
22
24
|
state: StateStore<SearchControllerState>;
|