@teambit/workspace
Version:
28 lines (27 loc) • 2.04 kB
TypeScript
import { ComponentModel } from '@teambit/component';
import { ComponentID } from '@teambit/component-id';
import { Workspace } from './workspace-model';
type UseWorkspaceOptions = {
onComponentAdded?: (component: ComponentModel[]) => void;
onComponentUpdated?: (component: ComponentModel[]) => void;
onComponentRemoved?: (compId: ComponentID[]) => void;
};
export declare function useWorkspace(options?: UseWorkspaceOptions): {
error?: import("@apollo/client").ApolloError | undefined;
client: import("@apollo/client").ApolloClient<any>;
loading: boolean;
variables: import("@apollo/client").OperationVariables | undefined;
startPolling: (pollInterval: number) => void;
stopPolling: () => void;
updateQuery: <TVars = import("@apollo/client").OperationVariables>(mapFn: (previousQueryResult: any, options: Pick<import("@apollo/client").WatchQueryOptions<TVars, any>, "variables">) => any) => void;
reobserve: (newOptions?: Partial<import("@apollo/client").WatchQueryOptions<import("@apollo/client").OperationVariables, any>> | undefined, newNetworkStatus?: import("@apollo/client").NetworkStatus) => Promise<import("@apollo/client").ApolloQueryResult<any>>;
observable: import("@apollo/client").ObservableQuery<any, import("@apollo/client").OperationVariables>;
networkStatus: import("@apollo/client").NetworkStatus;
called: boolean;
previousData?: any;
fetchMore: (options: import("@apollo/client").FetchMoreQueryOptions<import("@apollo/client").OperationVariables, any>) => Promise<import("@apollo/client").ApolloQueryResult<any>>;
refetch: (variables?: Partial<import("@apollo/client").OperationVariables> | undefined) => Promise<import("@apollo/client").ApolloQueryResult<any>>;
workspace: Workspace | undefined;
subscribeToMore: <TSubscriptionData = any, TSubscriptionVariables = import("@apollo/client").OperationVariables>(options: import("@apollo/client").SubscribeToMoreOptions<any, TSubscriptionVariables, TSubscriptionData>) => () => void;
};
export {};