Skip to content

Commit

Permalink
feat(FEC-13686): add detach/attach types (#55)
Browse files Browse the repository at this point in the history
### Description of the Changes

add types for attach/detach feature

### CheckLists

- [ ] changes have been done against master branch, and PR does not
conflict
- [ ] new unit / functional tests have been added (whenever applicable)
- [ ] test are passing in local environment
- [ ] Travis tests are passing (or test results are not worse than on
master branch :))
- [ ] Docs have been updated
  • Loading branch information
semarche-kaltura authored May 21, 2024
1 parent 51e3087 commit 93cb124
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion types/modules.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,32 @@ declare module "services/side-panels-manager/models/side-panel-item" {
readonly position: PlaykitUI.SidePanelPosition;
readonly expandMode: PlaykitUI.SidePanelMode;
}
export const DETACHED_WINDOW_STYLES: {
margin: string;
backgroundColor: string;
};
export const DETACH_CONTAINER_CLASS = "playkit-player detach-sidebar-container";
export const CLOSE_DETACH_EVENTS: string[];
}
declare module "services/side-panels-manager/ui/panel-item-wrapper/panel-item-wrapper.component" { }
declare module "services/side-panels-manager/models/item-wrapper" { }
declare module "services/side-panels-manager/models/item-wrapper" {
import { FunctionalComponent, ComponentClass } from 'preact';
export interface DetachWindowOptions {
onAttach?: () => void;
top?: number;
left?: number;
width: number;
height: number;
title: string;
maxWidth?: number;
maxHeight?: number;
attachPlaceholder?: ComponentClass | FunctionalComponent;
}
}
declare module "services/side-panels-manager/side-panels-manager" {
import { KalturaPlayer, Logger } from '@playkit-js/kaltura-player-js';
import { SidePanelItem } from "services/side-panels-manager/models/side-panel-item";
import { DetachWindowOptions } from "services/side-panels-manager/models/item-wrapper";
export class SidePanelsManager {
private readonly player;
private readonly activePanels;
Expand All @@ -31,6 +51,10 @@ declare module "services/side-panels-manager/side-panels-manager" {
activateItem(itemId: number): void;
deactivateItem(itemId: number): void;
isItemActive(itemId: number): boolean;
isItemDetached(itemId: number): boolean;
detachItem(itemId: number, options: DetachWindowOptions): void;
attachItem(itemId: number): void;
getDetachedRef(itemId: number): HTMLDivElement;
/**
* Rerender (uses preact Component.forceUpdate api under the hoods) the side panel item component
* It's just for backward compatibility you should not use it.
Expand Down

0 comments on commit 93cb124

Please sign in to comment.