@livetiles/reach-plugin-types 0.5.0-preview.611 → 0.5.0-preview.613
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/lib/index.d.ts +157 -2
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
|
@@ -2257,8 +2257,8 @@ declare module "libs/reach/util/api-factory/src/useApi" {
|
|
|
2257
2257
|
import { Api } from 'restful.js';
|
|
2258
2258
|
import { ClientFactoryInstance } from "libs/reach/util/api-factory/src/ClientFactoryInstance";
|
|
2259
2259
|
export type ApiErrorHandler = (error: any, config: any) => Promise<boolean>;
|
|
2260
|
-
export function useApiFactory(errorHandler?: ApiErrorHandler): ClientFactoryInstance;
|
|
2261
|
-
export function useApi(errorHandler?: ApiErrorHandler): Api;
|
|
2260
|
+
export function useApiFactory(errorHandler?: ApiErrorHandler, customEndpoint?: string): ClientFactoryInstance;
|
|
2261
|
+
export function useApi(errorHandler?: ApiErrorHandler, customEndpoint?: string): Api;
|
|
2262
2262
|
export function useUnauthorizedApi(): Api;
|
|
2263
2263
|
}
|
|
2264
2264
|
declare module "libs/reach/util/api-factory/src/useBeaconHandler" {
|
|
@@ -10914,6 +10914,161 @@ declare module "libs/reach/feature/content/src/reach-2/comments/CommentCreator"
|
|
|
10914
10914
|
className?: string;
|
|
10915
10915
|
}>;
|
|
10916
10916
|
}
|
|
10917
|
+
declare module "libs/reach/feature/content/src/reach-2/comments/useCommentsQuery" {
|
|
10918
|
+
import { InfiniteData } from '@tanstack/react-query';
|
|
10919
|
+
import { Comment, PaginatedList } from "libs/reach/util/common/src/index";
|
|
10920
|
+
export type CommentWithReplies<TItem extends Comment = Comment> = TItem & {
|
|
10921
|
+
replies?: PaginatedList<Comment>;
|
|
10922
|
+
};
|
|
10923
|
+
type CommentQueryResult<TItem extends Comment = Comment> = {
|
|
10924
|
+
items?: TItem[];
|
|
10925
|
+
pageInfo?: {
|
|
10926
|
+
hasNextPage?: boolean;
|
|
10927
|
+
hasPreviousPage?: boolean;
|
|
10928
|
+
};
|
|
10929
|
+
};
|
|
10930
|
+
export function useCommentsQuery<TItem extends Comment = Comment>(parentItemId: string, pageSize?: number, repliesPageSize?: number): {
|
|
10931
|
+
updateCommentFromState: (commentId: string, updateFn: (item: CommentWithReplies<TItem>) => CommentWithReplies<TItem>) => void;
|
|
10932
|
+
removeCommentFromState: (commentId: string) => void;
|
|
10933
|
+
addCommentToState: (newComment: CommentWithReplies<TItem>) => void;
|
|
10934
|
+
data: undefined;
|
|
10935
|
+
error: unknown;
|
|
10936
|
+
isError: true;
|
|
10937
|
+
isLoading: false;
|
|
10938
|
+
isLoadingError: true;
|
|
10939
|
+
isRefetchError: false;
|
|
10940
|
+
isSuccess: false;
|
|
10941
|
+
status: "error";
|
|
10942
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<CommentQueryResult<CommentWithReplies<TItem>>, unknown>>;
|
|
10943
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<CommentQueryResult<CommentWithReplies<TItem>>, unknown>>;
|
|
10944
|
+
hasNextPage?: boolean;
|
|
10945
|
+
hasPreviousPage?: boolean;
|
|
10946
|
+
isFetchingNextPage: boolean;
|
|
10947
|
+
isFetchingPreviousPage: boolean;
|
|
10948
|
+
dataUpdatedAt: number;
|
|
10949
|
+
errorUpdatedAt: number;
|
|
10950
|
+
failureCount: number;
|
|
10951
|
+
failureReason: unknown;
|
|
10952
|
+
errorUpdateCount: number;
|
|
10953
|
+
isFetched: boolean;
|
|
10954
|
+
isFetchedAfterMount: boolean;
|
|
10955
|
+
isFetching: boolean;
|
|
10956
|
+
isInitialLoading: boolean;
|
|
10957
|
+
isPaused: boolean;
|
|
10958
|
+
isPlaceholderData: boolean;
|
|
10959
|
+
isPreviousData: boolean;
|
|
10960
|
+
isRefetching: boolean;
|
|
10961
|
+
isStale: boolean;
|
|
10962
|
+
refetch: <TPageData>(options?: import("@tanstack/react-query").RefetchOptions & import("@tanstack/react-query").RefetchQueryFilters<TPageData>) => Promise<import("@tanstack/react-query").QueryObserverResult<InfiniteData<CommentQueryResult<CommentWithReplies<TItem>>>, unknown>>;
|
|
10963
|
+
remove: () => void;
|
|
10964
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
10965
|
+
} | {
|
|
10966
|
+
updateCommentFromState: (commentId: string, updateFn: (item: CommentWithReplies<TItem>) => CommentWithReplies<TItem>) => void;
|
|
10967
|
+
removeCommentFromState: (commentId: string) => void;
|
|
10968
|
+
addCommentToState: (newComment: CommentWithReplies<TItem>) => void;
|
|
10969
|
+
data: undefined;
|
|
10970
|
+
error: null;
|
|
10971
|
+
isError: false;
|
|
10972
|
+
isLoading: true;
|
|
10973
|
+
isLoadingError: false;
|
|
10974
|
+
isRefetchError: false;
|
|
10975
|
+
isSuccess: false;
|
|
10976
|
+
status: "loading";
|
|
10977
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<CommentQueryResult<CommentWithReplies<TItem>>, unknown>>;
|
|
10978
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<CommentQueryResult<CommentWithReplies<TItem>>, unknown>>;
|
|
10979
|
+
hasNextPage?: boolean;
|
|
10980
|
+
hasPreviousPage?: boolean;
|
|
10981
|
+
isFetchingNextPage: boolean;
|
|
10982
|
+
isFetchingPreviousPage: boolean;
|
|
10983
|
+
dataUpdatedAt: number;
|
|
10984
|
+
errorUpdatedAt: number;
|
|
10985
|
+
failureCount: number;
|
|
10986
|
+
failureReason: unknown;
|
|
10987
|
+
errorUpdateCount: number;
|
|
10988
|
+
isFetched: boolean;
|
|
10989
|
+
isFetchedAfterMount: boolean;
|
|
10990
|
+
isFetching: boolean;
|
|
10991
|
+
isInitialLoading: boolean;
|
|
10992
|
+
isPaused: boolean;
|
|
10993
|
+
isPlaceholderData: boolean;
|
|
10994
|
+
isPreviousData: boolean;
|
|
10995
|
+
isRefetching: boolean;
|
|
10996
|
+
isStale: boolean;
|
|
10997
|
+
refetch: <TPageData>(options?: import("@tanstack/react-query").RefetchOptions & import("@tanstack/react-query").RefetchQueryFilters<TPageData>) => Promise<import("@tanstack/react-query").QueryObserverResult<InfiniteData<CommentQueryResult<CommentWithReplies<TItem>>>, unknown>>;
|
|
10998
|
+
remove: () => void;
|
|
10999
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
11000
|
+
} | {
|
|
11001
|
+
updateCommentFromState: (commentId: string, updateFn: (item: CommentWithReplies<TItem>) => CommentWithReplies<TItem>) => void;
|
|
11002
|
+
removeCommentFromState: (commentId: string) => void;
|
|
11003
|
+
addCommentToState: (newComment: CommentWithReplies<TItem>) => void;
|
|
11004
|
+
data: InfiniteData<CommentQueryResult<CommentWithReplies<TItem>>>;
|
|
11005
|
+
error: unknown;
|
|
11006
|
+
isError: true;
|
|
11007
|
+
isLoading: false;
|
|
11008
|
+
isLoadingError: false;
|
|
11009
|
+
isRefetchError: true;
|
|
11010
|
+
isSuccess: false;
|
|
11011
|
+
status: "error";
|
|
11012
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<CommentQueryResult<CommentWithReplies<TItem>>, unknown>>;
|
|
11013
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<CommentQueryResult<CommentWithReplies<TItem>>, unknown>>;
|
|
11014
|
+
hasNextPage?: boolean;
|
|
11015
|
+
hasPreviousPage?: boolean;
|
|
11016
|
+
isFetchingNextPage: boolean;
|
|
11017
|
+
isFetchingPreviousPage: boolean;
|
|
11018
|
+
dataUpdatedAt: number;
|
|
11019
|
+
errorUpdatedAt: number;
|
|
11020
|
+
failureCount: number;
|
|
11021
|
+
failureReason: unknown;
|
|
11022
|
+
errorUpdateCount: number;
|
|
11023
|
+
isFetched: boolean;
|
|
11024
|
+
isFetchedAfterMount: boolean;
|
|
11025
|
+
isFetching: boolean;
|
|
11026
|
+
isInitialLoading: boolean;
|
|
11027
|
+
isPaused: boolean;
|
|
11028
|
+
isPlaceholderData: boolean;
|
|
11029
|
+
isPreviousData: boolean;
|
|
11030
|
+
isRefetching: boolean;
|
|
11031
|
+
isStale: boolean;
|
|
11032
|
+
refetch: <TPageData>(options?: import("@tanstack/react-query").RefetchOptions & import("@tanstack/react-query").RefetchQueryFilters<TPageData>) => Promise<import("@tanstack/react-query").QueryObserverResult<InfiniteData<CommentQueryResult<CommentWithReplies<TItem>>>, unknown>>;
|
|
11033
|
+
remove: () => void;
|
|
11034
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
11035
|
+
} | {
|
|
11036
|
+
updateCommentFromState: (commentId: string, updateFn: (item: CommentWithReplies<TItem>) => CommentWithReplies<TItem>) => void;
|
|
11037
|
+
removeCommentFromState: (commentId: string) => void;
|
|
11038
|
+
addCommentToState: (newComment: CommentWithReplies<TItem>) => void;
|
|
11039
|
+
data: InfiniteData<CommentQueryResult<CommentWithReplies<TItem>>>;
|
|
11040
|
+
error: null;
|
|
11041
|
+
isError: false;
|
|
11042
|
+
isLoading: false;
|
|
11043
|
+
isLoadingError: false;
|
|
11044
|
+
isRefetchError: false;
|
|
11045
|
+
isSuccess: true;
|
|
11046
|
+
status: "success";
|
|
11047
|
+
fetchNextPage: (options?: import("@tanstack/react-query").FetchNextPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<CommentQueryResult<CommentWithReplies<TItem>>, unknown>>;
|
|
11048
|
+
fetchPreviousPage: (options?: import("@tanstack/react-query").FetchPreviousPageOptions) => Promise<import("@tanstack/react-query").InfiniteQueryObserverResult<CommentQueryResult<CommentWithReplies<TItem>>, unknown>>;
|
|
11049
|
+
hasNextPage?: boolean;
|
|
11050
|
+
hasPreviousPage?: boolean;
|
|
11051
|
+
isFetchingNextPage: boolean;
|
|
11052
|
+
isFetchingPreviousPage: boolean;
|
|
11053
|
+
dataUpdatedAt: number;
|
|
11054
|
+
errorUpdatedAt: number;
|
|
11055
|
+
failureCount: number;
|
|
11056
|
+
failureReason: unknown;
|
|
11057
|
+
errorUpdateCount: number;
|
|
11058
|
+
isFetched: boolean;
|
|
11059
|
+
isFetchedAfterMount: boolean;
|
|
11060
|
+
isFetching: boolean;
|
|
11061
|
+
isInitialLoading: boolean;
|
|
11062
|
+
isPaused: boolean;
|
|
11063
|
+
isPlaceholderData: boolean;
|
|
11064
|
+
isPreviousData: boolean;
|
|
11065
|
+
isRefetching: boolean;
|
|
11066
|
+
isStale: boolean;
|
|
11067
|
+
refetch: <TPageData>(options?: import("@tanstack/react-query").RefetchOptions & import("@tanstack/react-query").RefetchQueryFilters<TPageData>) => Promise<import("@tanstack/react-query").QueryObserverResult<InfiniteData<CommentQueryResult<CommentWithReplies<TItem>>>, unknown>>;
|
|
11068
|
+
remove: () => void;
|
|
11069
|
+
fetchStatus: import("@tanstack/react-query").FetchStatus;
|
|
11070
|
+
};
|
|
11071
|
+
}
|
|
10917
11072
|
declare module "libs/reach/feature/content/src/reach-2/comments/CommentsList" {
|
|
10918
11073
|
import { FC } from 'react';
|
|
10919
11074
|
import { ConversationScope, ItemResourceTypes } from "libs/reach/util/common/src/index";
|