elexis/index.ts

20 lines
680 B
TypeScript
Raw Normal View History

2024-02-01 23:47:13 +08:00
declare global {
interface Array<T> {
detype<F extends undefined | null, O>(...types: F[]): Array<Exclude<T, F>>
}
}
Array.prototype.detype = function <T extends undefined | null, O>(this: O[], ...types: T[]) {
return this.filter(item => {
for (const type of types) typeof item !== typeof type
}) as Exclude<O, T>[];
}
export * from "./$index";
export * from "./lib/Router/Route";
export * from "./lib/Router/Router";
export * from "./lib/$Node";
export * from "./lib/$Anchor";
export * from "./lib/$Element";
export * from "./lib/$ElementManager";
export * from "./lib/$Text";
export * from "./lib/$Container";
export * from "./lib/$EventManager";