feat: @motajs/animate 部分类型声明

This commit is contained in:
unanmed 2025-09-16 12:34:59 +08:00
parent 49a2b8d4b9
commit 0fc77f5007
5 changed files with 61 additions and 1 deletions

View File

@ -159,6 +159,7 @@ export class Winskin extends RenderItem<EWinskinEvent> {
private patternCache?: WinskinPatterns; private patternCache?: WinskinPatterns;
private patternTransform: DOMMatrix; private patternTransform: DOMMatrix;
// todo: 跨上下文可能是未定义行为,需要上下文无关化
private static patternMap: Map<string, WinskinPatterns> = new Map(); private static patternMap: Map<string, WinskinPatterns> = new Map();
constructor( constructor(

View File

@ -83,7 +83,7 @@ export class WeatherController implements IWeatherController {
const instance = new WeatherInstance(obj, element); const instance = new WeatherInstance(obj, element);
instance.setZIndex(this.zIndex + this.active.size); instance.setZIndex(this.zIndex + this.active.size);
this.active.add(instance); this.active.add(instance);
this.container?.appendChild(element); this.container.appendChild(element);
return instance; return instance;
} }

View File

@ -0,0 +1,3 @@
{
"name": "@motajs/animate"
}

View File

@ -0,0 +1 @@
export * from './types';

View File

@ -0,0 +1,55 @@
export interface IExcitable<T> {
/**
*
* @param payload
*/
excited(payload: T): void;
}
export interface IExcitableController<T> {
/** 受激励对象 */
readonly excitable: T;
/**
*
*/
revoke(): void;
/**
*
* @param payload
*/
excite(payload: T): void;
}
export interface IExcitation<T> {
/**
*
*/
payload(): T;
/**
*
* @param payload
*/
excite(payload: T): void;
/**
*
* @param object
* @returns
*/
add(object: IExcitable<T>): IExcitableController<T>;
/**
*
* @param object
* @returns `false`
*/
remove(object: IExcitable<T>): boolean;
/**
*
*/
destroy(): void;
}