import type TypedEmitter from "typed-emitter"; import type { ConnectedResult } from "./results/ConnectedResult"; import type { ResourceResult } from "./results/ResourceResult"; import type { SubscriptionCallbacks } from "./notifications/NotificationSubscription"; export type ResourceEventEmitter = TypedEmitter<{ update: () => void; notification: () => void; }>; export interface Resource extends ResourceEventEmitter { readonly uri: UriType; readonly type: string; status: ConnectedResult; isLoading(): boolean; isFetched(): boolean; isUnfetched(): boolean; isDoingInitialFetch(): boolean; isPresent(): boolean; isAbsent(): boolean; isSubscribedToNotifications(): boolean; read(): Promise>; readIfAbsent(): Promise>; subscribeToNotifications(callbacks?: SubscriptionCallbacks): Promise; unsubscribeFromNotifications(subscriptionId: string): Promise; unsubscribeFromAllNotifications(): Promise; }