import type { Nullable } from 'aidly'; import type { HooksOn, RefinePlugin } from 'hooks-plugin'; import type { Manager } from './manager'; import type { Container } from './container'; import type { FacileDanmaku } from './danmaku/facile'; import type { FlexibleDanmaku } from './danmaku/flexible'; export type DanmakuType = 'facile' | 'flexible'; export type Direction = 'left' | 'right' | 'none'; export type Mode = 'none' | 'strict' | 'adaptive'; export type Distribution = 'random' | 'order'; export type Speed = Nullable; export type Layer = StashData | FacileDanmaku; export type Danmaku = FacileDanmaku | FlexibleDanmaku; export type StyleKey = keyof Omit; export type FilterCallback = EachCallback; export type EachCallback = ( danmaku: FacileDanmaku | FlexibleDanmaku, ) => boolean | void; export type ValueType> = Exclude< Parameters[0], FacileDanmaku >; export type ManagerPlugin = RefinePlugin< Manager['pluginSystem']['lifecycle'] >; export type DanmakuPlugin = RefinePlugin< FacileDanmaku['pluginSystem']['lifecycle'] >; export type InternalStatuses = { freeze: boolean; viewStatus: 'hide' | 'show'; styles: Record; }; export type PushFlexOptions = Omit, 'direction'> & { direction?: Direction; position: | Position | (( danmaku: Danmaku, container: Container, ) => Position); }; export interface PushOptions { speed?: Speed; duration?: number; progress?: number; plugin?: DanmakuPlugin; rate?: ManagerOptions['rate']; direction?: ManagerOptions['direction']; } export interface EngineOptions { speed?: Speed; mode: Mode; rate: number; gap: number | string; overlap?: number; trackHeight: number | string; durationRange: [number, number]; direction: Exclude; limits: { view?: number; stash: number; }; distribution?: Distribution; } export interface ManagerOptions extends EngineOptions { interval: number; } export interface Location { top: number; middle: number; bottom: number; } export interface Position { x: T; y: T; } export interface MoveTimer { cb: () => void; clear: () => void; } export interface SizeArea { start: T; end: T; } export interface AreaOptions { x?: Partial>; y?: Partial>; } export interface FreezeOptions { preventEvents?: Array<'pause' | 'stop' | 'resume' | 'start' | (string & {})>; } export interface StashData { data: T; options: Required>; } export interface InfoRecord { pauseTime: number; startTime: number; prevPauseTime: number; } export interface RenderOptions { statuses: InternalStatuses; danmakuPlugin: DanmakuPlugin; hooks: HooksOn< Manager['pluginSystem'], ['render', 'finished', 'willRender'] >; } export interface CreateOption extends Partial { plugin?: ManagerPlugin | Array>; }