@carbon/react
Version:
React components for the Carbon Design System
26 lines (25 loc) • 858 B
TypeScript
/**
* Copyright IBM Corp. 2025
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/
import { type RefObject } from 'react';
export interface PresenceContext {
/**
* The ref object the presence mode is mounted with
*/
presenceRef: RefObject<HTMLDivElement | null>;
/**
* Indicates whether the ref object is currently exiting
*/
isExiting: boolean;
/**
* Returns if the caller is exclusive to this presence context
*/
isPresenceExclusive: (id: string) => boolean;
}
/**
* Returns if the presence node is present and the context value to be used by a presence context, e.g. ModalPresence.
*/
export declare const usePresenceContext: (open: boolean, initialPresenceId?: string) => readonly [boolean, PresenceContext];