Add deprecated annotations to old functions

This commit is contained in:
Daniel Imms 2024-04-03 06:32:03 -07:00
parent 85fb8cb6fd
commit 815dcf06b5
No known key found for this signature in database
GPG key ID: E5CF412B63651C69
2 changed files with 9 additions and 0 deletions

View file

@ -23,6 +23,10 @@ export function setHoverDelegateFactory(hoverDelegateProvider: ((placement: 'mou
hoverDelegateFactory = hoverDelegateProvider;
}
/**
* @deprecated If in the `base/` layer use `getBaseLayerHoverDelegate` instead, if in `platform/`
* and higher use `IHoverService.setupUpdatableHover` instead.
*/
export function getDefaultHoverDelegate(placement: 'mouse' | 'element'): IHoverDelegate {
if (placement === 'element') {
return defaultHoverDelegateElement.value;
@ -30,6 +34,7 @@ export function getDefaultHoverDelegate(placement: 'mouse' | 'element'): IHoverD
return defaultHoverDelegateMouse.value;
}
// TODO: Create equivalent in IHoverService
export function createInstantHoverDelegate(): IScopedHoverDelegate {
// Creates a hover delegate with instant hover enabled.
// This hover belongs to the consumer and requires the them to dispose it.

View file

@ -17,6 +17,7 @@ import type { IHoverWidget, IUpdatableHover, IUpdatableHoverContent, IUpdatableH
type IUpdatableHoverResolvedContent = IMarkdownString | string | HTMLElement | undefined;
// TODO: Create equivalent in IHoverService
export function setupNativeHover(htmlElement: HTMLElement, tooltip: string | IUpdatableHoverTooltipMarkdownString | undefined): void {
if (isString(tooltip)) {
// Icons don't render in the native hover so we strip them out
@ -130,6 +131,9 @@ function getHoverTargetElement(element: HTMLElement, stopElement?: HTMLElement):
return element;
}
/**
* @deprecated Use `IHoverService.createUpdatableHover` instead.
*/
export function setupCustomHover(hoverDelegate: IHoverDelegate, htmlElement: HTMLElement, content: IUpdatableHoverContentOrFactory, options?: IUpdatableHoverOptions): IUpdatableHover {
htmlElement.setAttribute('custom-hover', 'true');