Skip to content
This repository has been archived by the owner on Nov 9, 2024. It is now read-only.

Commit

Permalink
Add destroy() argument type for Delegate
Browse files Browse the repository at this point in the history
  • Loading branch information
atomiks committed Nov 2, 2019
1 parent 199ae62 commit 5fe9918
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,17 @@ declare const tippy: Tippy;
export type HideAll = (options: HideAllOptions) => void;
declare const hideAll: HideAll;

export interface DelegateInstance<TProps = Props> extends Instance<TProps> {
destroy(shouldDestroyTargetInstances?: boolean): void;
}

export interface Delegate<TProps = Props> {
(
targets: SingleTarget,
props: Partial<TProps> & {target: string},
/** @deprecated use Props.plugins */
plugins?: Plugin[],
): Instance<TProps>;
): DelegateInstance<TProps>;
}

export interface Delegate<TProps = Props> {
Expand All @@ -183,7 +187,7 @@ export interface Delegate<TProps = Props> {
props: Partial<TProps> & {target: string},
/** @deprecated use Props.plugins */
plugins?: Plugin[],
): Instance<TProps>[];
): DelegateInstance<TProps>[];
}

export type CreateSingleton<TProps = Props> = (
Expand Down

0 comments on commit 5fe9918

Please sign in to comment.