import { PlayerProps, WritableProps } from '@vime/core';
import { Writable, Readable } from 'svelte/store';
declare type PropStoreType
= P extends keyof WritableProps ? Writable : Readable;
declare type PlayerStore = {
[P in keyof PlayerProps]: PropStoreType;
};
interface SvelteWebComponent {
getWebComponent: T | undefined;
}
declare type Ref = () => T | SvelteWebComponent;
/**
* This function will take the given `ref` and climb up the DOM tree until it finds the first
* ancestor player, which it will then return through the callback. This is useful for
* getting a reference to the player when you need to call a method on it.
*
* @param ref A function which returns a HTMLElement or Vime component.
*/
export declare const usePlayer: (ref: Ref, callback: (player: HTMLVmPlayerElement) => void) => void;
/**
* Creates and returns a store for the given player. The store is a collection of stores
* for each player property. It is safe to write to properties before the player has mounted or
* playback is ready.
*
* @param playerRef A function which returns the player to create the store for.
*
* @example
*
*
*
*
*
*/
export declare const usePlayerStore: (ref: Ref) => PlayerStore;
export {};