2024-02-01 23:47:13 +08:00
|
|
|
declare global {
|
2024-02-03 09:33:34 +08:00
|
|
|
var $: import('./$index').$;
|
2024-02-01 23:47:13 +08:00
|
|
|
interface Array<T> {
|
|
|
|
detype<F extends undefined | null, O>(...types: F[]): Array<Exclude<T, F>>
|
|
|
|
}
|
2024-02-03 09:33:34 +08:00
|
|
|
type OrMatrix<T> = T | OrMatrix<T>[];
|
|
|
|
type OrArray<T> = T | T[];
|
|
|
|
type OrPromise<T> = T | Promise<T>;
|
|
|
|
type Mutable<T> = {
|
|
|
|
-readonly [k in keyof T]: T[k];
|
|
|
|
};
|
|
|
|
type Types = 'string' | 'number' | 'boolean' | 'object' | 'symbol' | 'bigint' | 'function' | 'undefined'
|
|
|
|
type Autocapitalize = 'none' | 'off' | 'sentences' | 'on' | 'words' | 'characters';
|
|
|
|
type SelectionDirection = "forward" | "backward" | "none";
|
|
|
|
type InputType = "button" | "checkbox" | "color" | "date" | "datetime-local" | "email" | "file" | "hidden" | "image" | "month" | "number" | "password" | "radio" | "range" | "reset" | "search" | "submit" | "tel" | "text" | "time" | "url" | "week";
|
|
|
|
type ButtonType = "submit" | "reset" | "button" | "menu";
|
|
|
|
type TextDirection = 'ltr' | 'rtl' | 'auto' | '';
|
2024-02-13 19:38:46 +08:00
|
|
|
type ImageDecoding = "async" | "sync" | "auto";
|
|
|
|
type ImageLoading = "eager" | "lazy";
|
|
|
|
type ContructorType<T> = { new (...args: any[]): T }
|
2024-02-03 09:33:34 +08:00
|
|
|
interface Node {
|
|
|
|
$: import('./lib/$Node').$Node;
|
|
|
|
}
|
2024-02-01 23:47:13 +08:00
|
|
|
}
|
|
|
|
Array.prototype.detype = function <T extends undefined | null, O>(this: O[], ...types: T[]) {
|
|
|
|
return this.filter(item => {
|
2024-02-03 09:33:34 +08:00
|
|
|
if (!types.length) return item !== undefined;
|
|
|
|
else for (const type of types) if (typeof item !== typeof type) return false; else return true
|
2024-02-01 23:47:13 +08:00
|
|
|
}) 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";
|
2024-02-03 09:33:34 +08:00
|
|
|
export * from "./lib/$NodeManager";
|
2024-02-01 23:47:13 +08:00
|
|
|
export * from "./lib/$Text";
|
|
|
|
export * from "./lib/$Container";
|
2024-02-03 09:33:34 +08:00
|
|
|
export * from "./lib/$Button";
|
|
|
|
export * from "./lib/$Form";
|
|
|
|
export * from "./lib/$EventManager";
|
|
|
|
export * from "./lib/$State";
|