import { BodyType, Cache, ChunkDetail, ChunkInfo, ComparisonOperator, Credentials, DateString, Deadline, DeviceType, Direction, DotImageCanvasOptions, DotTextCanvasOptions, DragEvent, EventBus, FileChunk, FileMD5, FileSpliceOptions, FileType, IFetchConfig, IFetchInterceptors, IFetchOptions, IShellMessage, ISignature, ImageData as ImageData$1, IsESModule, JSCookie, LRU, Lang, MaybeElement, Merge, Method, Mode, MutationObserverInit, NodeWorkerPayload, ParsedURL, PkgTool, Position, Redirect, ResponseType, TimeUnit, TrimType, UseTimeoutReturn } from "./types-Bz_zk0kF.js"; import { Element as Element$1 } from "domhandler"; //#region src/array/diff.d.ts interface Options$2 { compare?: 'same' | 'different'; result?: 'value' | 'index'; } /** * 比较两个数组,返回相同项或不同项(值或索引) * @description EN: Compare two arrays and return either same/different items or their indices. * @param {any[]} array1 First array. * @param {any[]} array2 Second array. * @param {Options} [options] Comparison options. * @returns {any[] | number[][]} Depending on options, returns matching values, indices, or paired differences. */ declare function diff(array1: any[], array2: any[], options?: Options$2): any[] | number[][]; //#endregion //#region src/array/forEach.d.ts interface ForEachCallback { (value: T, index: number, array: T[]): any; } /** * 遍历数组并允许通过返回值提前退出 * @description EN: Iterate over an array and allow early return if the callback returns a defined value. * @param {T[]} array Input array to iterate. * @param {(value: T, index: number, array: T[]) => any} callback Callback invoked for each element. * @returns {any} The first defined (non-undefined) return value from the callback, or undefined. */ declare function forEach(array: T[], callback: ForEachCallback): any; //#endregion //#region src/array/getAverage.d.ts /** * 计算数字数组的平均值并格式化为指定小数位 * @description EN: Compute the average of a number array and return it formatted to a fixed number of decimal places. * @param {number[]} array Input numbers. * @param {number} [fraction] Number of decimal places to keep. * @returns {string} Formatted average as string (from toFixed). */ declare function getAverage(array: number[], fraction?: number): string; //#endregion //#region src/array/quickFilter.d.ts /** * 快速筛选数组项,支持简易条件或正则 * @description EN: Filter an array quickly by simple conditions or regex expressions. Keys can be 'prop=value' or regex literals. * @param {any[]} array Input array of objects. * @param {string | string[]} key Filter key or array of keys. * @returns {any[]} Filtered array. */ declare function quickFilter(array: any[], key: string | Array): any[]; //#endregion //#region src/array/quickFind.d.ts /** * 快速建立基于主键的查找结构(支持增删改) * @description EN: Build a quick-find helper for arrays keyed by a primary field. Returns an object with find/set/delete utilities. * @template T Record-like item type. * @param {T[]} array Input array of records. * @param {keyof T | string} id Property name used as primary key. * @returns {QuickFind} QuickFind wrapper instance. */ declare function quickFind>(array: T[], id: keyof T | string): QuickFind; /** * QuickFind helper class wrapping an array and an index map keyed by the provided id. * Provides convenience methods to find, set, update and delete items by id. * This class is returned by the `quickFind` factory function. * * @template T Item record type. */ declare class QuickFind> { array: T[]; indexMap: Map; id: keyof T | string; constructor(array: T[], indexMap: Map, id: keyof T | string); /** * Find an item by its id. * @param id - primary key value to look up * @returns the found item or undefined when not present */ find(id: any): T | undefined; /** * Internal update helper. When `key` is undefined the whole item is replaced. * Otherwise a single property on the target item is updated. * @internal */ _update(id: any, key: keyof T | T, value: any): T[]; /** * Delete an item by id. Returns the mutated array when deletion happened. * @param id - primary key value * @returns the array after deletion, or undefined when id not found */ delete(id: any): T[] | undefined; /** * Set or insert an item by id. If an item with `id` exists it will be updated; * otherwise the provided value will be pushed (must include the primary id). * * Usage: * - set(id, item) -> inserts or replaces the whole item * - set(id, key, value) -> updates a single property on existing item * * @param id - primary key value * @param key - either a property key to update or the full item when inserting * @param value - when `key` is a property key this is the new value; optional when inserting * @returns the array after mutation */ set(id: any, key: keyof T | T, value?: any): T[]; } //#endregion //#region src/array/sort.d.ts /** * * @param { any[] } array 数组 * @param { Array | number | string } match 匹配条件 * @returns */ declare function sort(array: T[], match: Array | number | string): T[]; //#endregion //#region src/array/sortByOrder.d.ts /** * 根据指定顺序对数组排序 * @description EN: Sort items in `array` according to the given `order` sequence. Items not in `order` will be placed after ordered items. Use `key` to pick nested values (dot path supported). * @param {T[]} array The input array to sort. * @param {Array} order An array specifying the desired order of values. Use "*" in `order` to mark the insertion index for remaining items. * @param {string} [key] Optional dot-separated key name to extract the value from objects in `array`. * @returns {T[]} A new array sorted according to `order`. */ declare function sortByOrder(array: T[], order: Array, key?: string): T[]; //#endregion //#region src/array/uniqueArray.d.ts /** * 数组去重函数 * @description EN: Remove duplicates from an array. Optionally dedupe by specified key paths (supports nested paths like 'target.age'). * @param { any[] } array 数组 * @param { string[] } keys 可选,指定比较的键路径数组,如 ['name', 'target.age']。如果指定了keys,则只要这些指定的键值都相同,就认为是同一项进行去重 * @returns 去重后的数组 * @example * // 基本去重 * uniqueArray([1, 2, 2, 3]) // [1, 2, 3] * * // 按指定键去重 * uniqueArray([ * { name: 'Tom', age: 20 }, * { name: 'Tom', age: 25 }, * { name: 'Jerry', age: 20 } * ], ['name']) // [{ name: 'Tom', age: 20 }, { name: 'Jerry', age: 20 }] * * // 按多个键去重 * uniqueArray([...], ['name', 'age']) // 只有name和age都相同才认为是重复项 * * // 按嵌套键去重 * uniqueArray([...], ['target.age']) // 支持深层嵌套访问 */ declare function uniqueArray(array: any[], keys?: string[]): any[]; //#endregion //#region src/array/chunk.d.ts /** * 将数组拆分为指定大小的块 * @description EN: Split an array into chunks of the given size. * @param {T[]} arr Input array to split. * @param {number} [size] Maximum size of each chunk. * @returns {T[][]} Array of chunked arrays. */ declare function chunk(arr: T[], size?: number): T[][]; //#endregion //#region src/array/countBy.d.ts /** * 按照迭代器结果统计数组中元素出现次数 * @description EN: Count elements in an array grouped by the value returned from the iterator. * @param { any[] } array Input array to count. * @param { Function } iterator Function that maps each item to a key. * @returns {Record} Map from key to its occurrence count. */ declare function countBy>(array: T[], iterator: (item: T) => any): Record; //#endregion //#region src/array/flatten.d.ts /** * 将嵌套结构扁平化为数组 * @description EN: Flatten a nested tree-like structure into a flat array. The property used for children can be customized. * @param { Record | Record[] } o Object or array to flatten. * @param { string } [flattenProps] Property name that holds children. * @param { boolean } [onlyLastNode] When true, only keep leaf nodes. * @param { any[] } [result] Internal accumulator used during recursion. * @returns { any[] } Flattened array of nodes. */ declare function flatten>(o: T | T[], flattenProps?: string, onlyLastNode?: boolean, result?: T[]): T[]; //#endregion //#region src/array/filterEmpty.d.ts /** /** * 过滤数组中的空值(falsey 值) * @description EN: Remove empty/falsey values from an array (filters with Boolean). * @param {T[]} array Input array. * @returns {T[]} Filtered array with truthy values only. */ declare function filterEmpty(array: T[]): T[]; //#endregion //#region src/canvas/Canvas.d.ts declare class Canvas { canvas: HTMLCanvasElement; ctx: CanvasRenderingContext2D; constructor(width?: number, height?: number); } //#endregion //#region src/canvas/CreateSignatureCanvas.d.ts /** * 创建签名画布工具类 * @description EN: Utility class to create and manage a signature canvas with drawing, undo/redo, and export features. */ declare class CreateSignatureCanvas implements ISignature { canvas: HTMLCanvasElement; ctx: CanvasRenderingContext2D; stop: (() => void)[]; active: boolean; historyStack: ImageData[]; resetStack: ImageData[]; color: string; bg: string; constructor(lineWidth?: number, w?: number, h?: number, color?: string, bg?: string); createCanvas(lineWidth: number | undefined, w: number, h: number): void; clearCanvas(): void; mount(el: MaybeElement): this; setColor(color: string): void; setBgColor(color: string): void; unmount(): void; listen(): void; undo(): void; redo(): void; erase(lineWidth?: number): void; unerased(): void; save(type?: string, quality?: number): string; } //#endregion //#region src/canvas/DotImageCanvas.d.ts /** * DotImageCanvas 将图片转换为点阵图形式展示,并提供动画绘制效果 * * 支持多种绘制方向,颜色控制,背景设置,以及动画效果控制 * @class * @description EN: Convert an image to a dot-matrix representation and provide animated drawing controls with various directions, colors, background and animation options. */ declare class DotImageCanvas { /** 用于绘制的 Canvas 元素 */ canvas: HTMLCanvasElement; /** Canvas 的绘制上下文 */ ctx: CanvasRenderingContext2D; /** 缓存已处理图像的点阵数据 */ points: Map>; /** 原始图片源地址 */ originSrc: string; /** 点阵图颜色,设置后将覆盖原图颜色 */ color: string; /** 点阵粗细,影响绘制的圆点大小 */ fontWeight: number; /** 绘制状态:pending-绘制中,success-完成,fail-失败,reverted-已撤销 */ status: string; /** 背景颜色 */ bgColor?: string; /** 停止当前动画的函数 */ stop: () => void; /** 绘制方向 */ direction: Direction; /** 所有绘制任务 */ allTasks: Function[]; /** 已完成的任务索引 */ completedTaskIndex: number; /** 是否正在撤销绘制 */ isReverting: boolean; /** 每个绘制任务中的点坐标记录 */ drawnPoints: Array<{ x: number; y: number; color: any; }[]>; /** 清除任务列表 */ clearTasks: Function[]; /** 是否使用优先渲染模式 (RAF) */ isPreferred: boolean; /** 是否已挂载到DOM */ mounted: boolean; /** * 创建 DotImageCanvas 实例 * * @param {string | DotImageCanvasOptions} srcOrOptions - 图片URL或选项对象 * @param {string} [color] - 绘制颜色,为空时保留原图颜色 * @param {number} [fontWeight] - 点阵粗细 * @param {string} [bgColor] - 背景颜色 * @param {Direction} [direction] - 绘制方向 */ constructor(srcOrOptions: string | DotImageCanvasOptions, color?: string, fontWeight?: number, bgColor?: string, direction?: Direction); createDotImage(img: HTMLImageElement): (string | number | undefined)[][]; createImage(): Promise | undefined; hasImage(): boolean; executor(): Promise; /** * 创建绘制和清除任务的辅助方法 - 保持原有实现方式 */ createDrawAndClearTasks(pointsGenerator: () => { x: number; y: number; color: any; }[], size: number): { drawTask: () => void; clearTask: () => void; }; getCanvas(imagePointSet: (string | number | undefined)[][]): void; startAnimation(): this; revert(): this; continue(): this; initOptions(src: string, color: string, fontWeight: number, bgColor: string, direction?: Direction): void; /** * 重新绘制图像,可以更新配置 * * @param {string | Partial} srcOrOptions - 图片URL或选项对象 * @param {string} [color] - 点阵颜色 * @param {number} [fontWeight] - 点阵粗细 * @param {string} [bgColor] - 背景颜色 * @param {Direction} [direction] - 绘制方向 * @returns {Promise} 更新后的实例 */ repaint(srcOrOptions: string | Partial, color?: string, fontWeight?: number, bgColor?: string, direction?: Direction): Promise; clearCanvas(): void; append(container: MaybeElement): this; destory(): void; } //#endregion //#region src/canvas/DotTextCanvas.d.ts /** * DotTextCanvas 将文字转换为点阵形式展示,并提供动画绘制效果 * * 支持多种绘制方向、颜色控制、间距设置以及动画效果 * @class * @description EN: Convert text into a dot-matrix representation and animate the drawing with configurable direction, color and spacing options. */ declare class DotTextCanvas { /** 用于绘制的 Canvas 元素 */ canvas: HTMLCanvasElement; /** Canvas 的绘制上下文 */ ctx: CanvasRenderingContext2D; /** 缓存已处理字符的点阵数据 */ points: Map>; /** 原始文本内容 */ originText: string; /** 字体大小 */ fontSize: number; /** 点阵颜色 */ color: string; /** 点阵粗细,影响绘制的圆点大小 */ fontWeight: number; /** 绘制方向 */ direction: Direction; /** 全局字符间距,默认为0 */ charSpacing: number; /** 每个字符对之间的间距数组,优先级高于全局间距 */ charSpacings: number[]; /** 存储最终合成的点阵数据 */ textPointSet: Array; /** 绘制状态:pending-绘制中,success-完成 */ status: string; /** 容器元素 */ container?: HTMLElement; /** 停止当前动画的函数 */ stop: () => void; /** 是否已挂载到DOM */ mounted: boolean; /** 是否使用优先渲染模式(RAF) */ isPreferred: boolean; /** 用于文本绘制的临时Canvas元素 */ private _textCanvas?; /** 临时Canvas的绘制上下文 */ private _textCtx?; /** * 创建 DotTextCanvas 实例 * * @param {string | DotTextCanvasOptions} textOrOptions - 文本内容或选项对象 * @param {number} [fontSize] - 字体大小 * @param {string} [color] - 点阵颜色 * @param {number} [fontWeight] - 点阵粗细 * @param {Direction} [direction] - 绘制方向 * @param {boolean} [isPreferred] - 是否使用优先渲染模式 * @param {number} [charSpacing] - 全局字符间距 * @param {number[]} [charSpacings] - 每个字符对之间的间距数组 */ constructor(textOrOptions: string | DotTextCanvasOptions, fontSize?: number, color?: string, fontWeight?: number, direction?: Direction, isPreferred?: boolean, charSpacing?: number, charSpacings?: number[]); /** * 为单个字符创建点阵数据 * * @param {string} text - 要转换为点阵的字符 * @returns {Array} 字符的点阵数据 */ createTextPoint(text: string): number[][]; /** * 执行文字点阵转换流程 */ executor(): void; /** * 获取字符的点阵数据,如果不存在则创建 * * @param {string} text - 要获取点阵数据的字符 * @returns {Array|undefined} 字符的点阵数据 */ getText(text: string): number[][] | undefined; /** * 合并所有字符的点阵数据,并应用字符间距 * * @returns {Array} 合并后的点阵数据 */ combineText(): number[][]; /** * 根据绘制方向生成点坐标数组 * * @param {number} h - 点阵高度 * @param {number} w - 点阵宽度 * @returns {Array<[number, number]>} 按指定方向排列的点坐标数组 */ getPointsForDirection(h: number, w: number): Array<[number, number]>; /** * 设置Canvas大小并准备绘制 */ getCanvas(): void; /** * 创建分批绘制任务 * * @param {Array<[number, number]>} pointsToDraw - 要绘制的点坐标数组 * @param {number} batchSize - 每批绘制的点数量 * @param {Function} getPoint - 点坐标计算函数 * @param {number} size - 点的大小 * @returns {Array} 绘制任务数组 */ createDrawTasks(pointsToDraw: Array<[number, number]>, batchSize: number, getPoint: Function, size: number): Function[]; /** * 创建一批点的绘制任务 * * @param {Array<[number, number]>} points - 一批要绘制的点坐标 * @param {Function} getPoint - 点坐标计算函数 * @param {number} size - 点的大小 * @returns {Function} 绘制任务函数 */ createBatchDrawTask(points: Array<[number, number]>, getPoint: Function, size: number): () => void; /** * 开始执行动画绘制 * * @param {Array} tasks - 绘制任务数组 */ startDrawing(tasks: Array): void; /** * 重新绘制文字,可以更新配置 * * @param {string | Partial} textOrOptions - 文本内容或选项对象 * @param {number} [fontSize] - 字体大小 * @param {string} [color] - 点阵颜色 * @param {number} [fontWeight] - 点阵粗细 * @param {Direction} [direction] - 绘制方向 * @returns {DotTextCanvas} 当前实例 */ repaint(this: any, textOrOptions: string | Partial, fontSize?: number, color?: string, fontWeight?: number, direction?: Direction): DotTextCanvas; /** * 清除Canvas上的内容 */ clearCanvas(): void; /** * 将Canvas元素添加到DOM容器中 * * @param {MaybeElement} container - 要插入的容器元素 * @returns {DotTextCanvas} 当前实例 */ append(container: MaybeElement): this; /** * 销毁实例,移除DOM元素并停止所有动画 */ destory(): void; } //#endregion //#region src/canvas/getImageData.d.ts declare function getImageData(src: string): Promise; //#endregion //#region src/canvas/removeRoundSpace.d.ts declare function removeRoundSpace(data: number[][]): number[][]; //#endregion //#region src/canvas/sliderValidation.d.ts declare function sliderValidation(url: string, container: HTMLElement | string, l?: number | (() => void), callback?: () => void): Promise; //#endregion //#region src/canvas/Line.d.ts declare class Line { ctx: CanvasRenderingContext2D; color: string; isFill: boolean; constructor(ctx: CanvasRenderingContext2D, color?: string, isFill?: boolean); draw(points: number[][], color?: string): void; } //#endregion //#region src/canvas/Point.d.ts declare class Point { r: number; ctx: CanvasRenderingContext2D; color: string; constructor(ctx: CanvasRenderingContext2D, r?: number, color?: string); draw(x: number, y: number, color?: string, r?: number): void; } //#endregion //#region src/canvas/Square.d.ts declare class Square { ctx: CanvasRenderingContext2D; r: number; color: string; isFill: boolean; constructor(ctx: CanvasRenderingContext2D, r?: number, color?: string, isFill?: boolean); draw(x: number, y: number, r?: number): void; } //#endregion //#region src/compress/compressCss.d.ts declare function compressCss(s: string): string; //#endregion //#region src/compress/compressImage.d.ts /** * @description EN: Minify CSS rules by trimming selectors and removing redundant whitespace in declarations. * @param s - CSS string to compress * @returns compressed CSS string */ type CompressImageOptionsType = 'base64' | 'blob'; interface CompressImageOptions { quality?: number; maxWidth?: number; maxHeight?: number; type?: CompressImageOptionsType; } declare function compressImage(source: string | File, options?: CompressImageOptions): Promise; //#endregion //#region src/css/getClasses.d.ts declare const classesReg: RegExp; declare function getClasses(str: string, callback: (classes: string, block: string, index: number) => string): string; //#endregion //#region src/css/getCssVar.d.ts declare function getCssVar(element: MaybeElement, style: string, callback: (css: string) => void): void; //#endregion //#region src/css/hasClassName.d.ts declare function hasClassName(element: Element, className: string): boolean; //#endregion //#region src/css/setCssVar.d.ts declare function setCssVar(element: MaybeElement, styleObj: Record): void; //#endregion //#region src/css/useNamespace.d.ts declare function useNamespace(defaultNamespace: string): (block: string) => { namespace: string; b: (blockSuffix?: string) => string; e: (element?: string) => string; m: (modifier?: string) => string; be: (blockSuffix?: string, element?: string) => string; em: (element?: string, modifier?: string) => string; bm: (blockSuffix?: string, modifier?: string) => string; bem: (blockSuffix?: string, element?: string, modifier?: string) => string; is: { (name: string, state: boolean | undefined): string; (name: string): string; }; cssVar: (object: Record) => Record; cssVarName: (name: string) => string; cssVarBlock: (object: Record) => Record; cssVarBlockName: (name: string) => string; }; //#endregion //#region src/css/setStyle.d.ts declare function setStyle(el: HTMLElement | string, styleObj: Record): void; //#endregion //#region src/css/removeStyle.d.ts declare function removeStyle(el: HTMLElement | string, styles: string[] | string): void; //#endregion //#region src/css/addStyleRules.d.ts /** * * @param { string } rule '#blanc { color: white }' * @param { number } [index] cssRules 中的位置 * @description EN: Insert a CSS rule string into the first stylesheet at an optional index. */ declare function addRules(rule: string, index?: number): void; //#endregion //#region src/css/addClass.d.ts /** * dom上添加class * @description EN: Add a CSS class to the provided element(s). * @param { MaybeElement } selector 元素 * @param { string } className class类 * @returns */ declare function addClass(selector: MaybeElement, className: string): void; //#endregion //#region src/css/removeClass.d.ts /** * dom上删除class * @description EN: Remove a CSS class from the provided element(s). * @param { MaybeElement } selector 元素 * @param { string } className class类 * @returns */ declare function removeClass(selector: MaybeElement, className: string): void; //#endregion //#region src/date/formateDate.d.ts declare function formateDate(datetime: Date, fmt?: string): string; //#endregion //#region src/date/getDateList.d.ts /** * Generates a list of dates starting from a given date. * * @param {string} start - The start date in the format 'YYYY-MM-DD' or 'YYYY/MM/DD'. * @param {number} [day] - The number of days to generate. If negative, dates will be generated in reverse order. * @returns {string[]} An array of date strings in the format 'YYYY-MM-DD'. * * @example * ```typescript * getDateList('2023-01-01', 5); * // Returns ['2023-01-01', '2023-01-02', '2023-01-03', '2023-01-04', '2023-01-05', '2023-01-06'] * ``` */ declare function getDateList(start: string, day?: number): string[]; //#endregion //#region src/date/getDaysOfMonth.d.ts /** * Returns the number of days in a given month. * * @param {number} currentMonth - The month for which to get the number of days (0-based, where 0 = January, 11 = December). * @returns {number} The number of days in the specified month. */ declare function getDaysOfMonth(currentMonth: number): number; //#endregion //#region src/date/createCalendar.d.ts /** * 返回当前月份的日历数组信息 * @description EN: Generate a 6x7 calendar grid for the specified month index (0-based), returning an array of weeks with day numbers. * @param currentMonth 今天的月份-1 从0开始 * @returns number[][] */ declare function createCalendar(currentMonth: number): unknown[][]; //#endregion //#region src/date/compareDate.d.ts /** * 比较2个月份的大小 * @description EN: Compare two full dates (YYYY-MM-DD or YYYY/MM/DD) returning -1/0/1 when date1 is less/equal/greater than date2. * @param date1 '2021-02-01' | '2021/02/01' * @param date2 '2021-03-02' | '2021/03/02' * @param separator '-' | '/' 默认 '-' * @returns -1 | 1 | 0 */ declare function compareDate(date1: DateString, date2: DateString, separator?: '-' | '/'): 0 | 1 | -1; //#endregion //#region src/date/compareTime.d.ts /** * 比较两个时间的大小 * * 该函数接受两个时间字符串,格式为 'HH:MM',并比较它们的大小。 * 返回值为 0 表示两个时间相同,1 表示第一个时间大于第二个时间,-1 表示第一个时间小于第二个时间。 * @description EN: Compare two times given as 'HH:MM'. Returns 0 if equal, 1 if time1 > time2, -1 if time1 < time2. * * @param {string} time1 - 第一个时间字符串,格式为 'HH:MM' * @param {string} time2 - 第二个时间字符串,格式为 'HH:MM' * @returns {number} - 返回 0 表示两个时间相同,1 表示第一个时间大于第二个时间,-1 表示第一个时间小于第二个时间 */ declare function compareTime(time1: string, time2: string): 0 | 1 | -1; //#endregion //#region src/date/compareDateTime.d.ts /** * 比较2个日期时间的大小 * @description EN: Compare two date-time strings and return -1 if date1 < date2, 1 if date1 > date2, or 0 if equal. * @param date1 '2021-02-01 12:00:01' | '2021/02/01 12:00:01' * @param date2 '2021-03-02 12:00:00' | '2021/03/02 12:00:00' * @param separator '-' | '/' 默认 '-' * @returns -1 | 1 | 0 */ declare function compareDateTime(date1: DateString, date2: DateString): 0 | 1 | -1; //#endregion //#region src/date/getFirstDay.d.ts /** * 获取当前周的周一日期 * @description EN: Return the ISO date string for Monday of the current week (YYYY-MM-DD). * @returns */ declare function getFirstDay(): string; //#endregion //#region src/date/getDifferenceDays.d.ts declare function getDifferenceDays(date1: Date | string, date2?: Date | string, unit?: TimeUnit): number; //#endregion //#region src/event/createElement.d.ts /** * Create a DOM element with optional attributes and innerHTML. * * @param tag - tag name to create (e.g. 'div') * @param attributes - optional attributes object to set on the element * @param innerHTML - optional innerHTML to insert * @param options - optional ElementCreationOptions for custom elements * @returns the created HTMLElement */ declare function createElement(tag: T, attributes?: Record, innerHTML?: string, options?: ElementCreationOptions): HTMLElementTagNameMap[T]; //#endregion //#region src/event/createFragment.d.ts /** * Create and return a DocumentFragment. Useful as a lightweight container * for building up DOM nodes before inserting them into the live document. * * @returns DocumentFragment */ declare function createFragment(): DocumentFragment; //#endregion //#region src/event/dragEvent.d.ts /** * Unified drag event helper that supports mouse and touch. * It normalizes touch events to look like mouse events (clientX/clientY etc.). * * @param target - Element or selector to attach drag handlers to * @param options - Handlers: dragStart, dragMove, dragEnd * @param trigger - When true, move events only fire after a start * @returns A stop function to remove all listeners */ declare function dragEvent(target: HTMLElement | string, options?: DragEvent, trigger?: boolean): () => true | undefined; //#endregion //#region src/event/findElement.d.ts /** * Find element(s) by CSS selector. * * - If `selector` is a string and `all` is truthy, returns a NodeList of matches. * - If `selector` is a string and `all` is falsy, returns the first matched * HTMLElement or null. * - If `selector` is an array of selectors, returns an array of Elements * matching all selectors (flattened). * - If an actual HTMLElement or NodeList is passed as `selector`, it is * returned unchanged (passthrough) which makes this helper safe to call * on union-typed variables. * * @param selector - CSS selector, array of selectors, HTMLElement, NodeList, or falsy * @param all - when true, return all matched nodes; when an HTMLElement is * passed, it is used as the `currentNode` to query from. Default is false. * @param currentNode - Root node to query from (defaults to `document`). */ declare function findElement(selector: string, all?: true | HTMLElement, currentNode?: HTMLElement | Document): NodeListOf | undefined; declare function findElement(selector: string, all?: false | undefined | HTMLElement, currentNode?: HTMLElement | Document): HTMLElement | null; declare function findElement(selector: string[], all?: boolean | HTMLElement, currentNode?: HTMLElement | Document): Element[]; declare function findElement(selector: HTMLElement | NodeListOf | null | undefined): HTMLElement | NodeListOf | null | undefined; //#endregion //#region src/event/insertElement.d.ts /** * Insert an element into a parent node. * * `parent` may be an HTMLElement or a selector string (the implementation uses * `mount` which resolves strings). `element` may be an HTMLElement, * DocumentFragment, or HTML string. If `target` is supplied, the element is * inserted before that child; otherwise it is appended. * * @param parent - parent element or selector * @param element - element, fragment or HTML string to insert * @param target - optional node to insert before */ declare function insertElement(parent: HTMLElement | string, element: HTMLElement | DocumentFragment | string, target?: HTMLElement | null): void; //#endregion //#region src/event/removeElement.d.ts /** * Remove an element from the DOM. * * Accepts an HTMLElement (or ChildNode/DocumentFragment) or a selector string. * If a selector is provided it will be resolved via `findElement` (caller * should resolve before calling if passing a selector). * * @param el - Element or selector to remove * @returns the parent HTMLElement that contained the removed node, or null */ declare function removeElement(el: HTMLElement | ChildNode | DocumentFragment | string): HTMLElement | null; //#endregion //#region src/event/useClick.d.ts /** * Attach a click listener to a target (element or selector). * The listener will be mounted when the element becomes available and can be stopped. * * @param target - A DOM element, selector string, or Document to attach the listener to * @param callback - MouseEvent handler * @returns A function that stops the listener. If called before the element exists, it will cancel mounting. */ declare function useClick(target: MaybeElement | Document, callback: (e: MouseEvent) => void): () => true | undefined; //#endregion //#region src/event/useElementBounding.d.ts /** * Watch an element's bounding rect and invoke callback when you want to sample it. * The function installs a mount handler to obtain the element and returns a * scroll listener stop function so callers can keep the rect up-to-date on scroll. * * @param element - Element or selector to measure * @param callback - Receives the element's DOMRect * @returns Stop function for the scroll listener */ declare function useElementBounding(element: Element | string, callback: (rect: DOMRect) => void): () => void; //#endregion //#region src/event/useEventListener.d.ts /** * Add an event listener to a target. The function supports Window, Document, Element, * MediaQueryList or selector string. Listener is automatically cleaned up when unmounted. * * @template T - Event name type from WindowEventMap & DocumentEventMap * @param target - Target to attach to (element, selector, window, document, or media query list) * @param eventName - Event name * @param callback - Event handler * @param useCapture - Options for addEventListener (capture or options object) * @param autoRemove - If true the listener will remove itself after first call * @returns A function that stops/removes the listener */ declare function useEventListener(target: Window | Document | Element | MediaQueryList | string, eventName: T, callback: (e: (WindowEventMap & DocumentEventMap)[T]) => void, useCapture?: boolean | AddEventListenerOptions, autoRemove?: boolean): () => void; //#endregion //#region src/event/useFocus.d.ts /** * Focus the first input within the provided target when it becomes available. * * @param target - Element, selector, or 'body' to search input within */ declare function useFocus(target?: MaybeElement): void; //#endregion //#region src/event/useHover.d.ts /** * Listen for hover enter/leave on a target and invoke callback with the hover state. * * @param target - Element or selector to observe * @param callback - Called with (isHover, event) * @returns A function that stops both listeners */ declare function useHover(target: MaybeElement, callback: (isHover: boolean, e: MouseEvent) => void): () => void; //#endregion //#region src/event/useIntersectionObserver.d.ts interface IntersectionObserverOptions { root?: Element | Document | string | null; rootMargin?: string; threshold?: number | number[]; } /** * Observe intersection changes for an element and call callback with entries. * `options.root` may be a selector string; if so it will be resolved via `findElement`. * * @param element - Element or selector to observe * @param callback - Receives IntersectionObserverEntry[] when the observer fires * @param options - IntersectionObserver options (root may be selector string) * @returns A stop function that disconnects the observer */ declare function useIntersectionObserver(element: Element | string, callback: (entries: IntersectionObserverEntry[]) => void, options?: IntersectionObserverOptions): () => void; //#endregion //#region src/event/useInterval.d.ts interface UseIntervalControls { isActive: () => boolean; pause: () => void; resume: () => void; } type UseIntervalReturn = T extends Function ? ((...args: any[]) => void) & UseIntervalControls : undefined; /** * A small helper around setInterval which exposes pause/resume controls. * If fn is not a function undefined is returned. * * @param fn - Callback function to run on each interval * @param duration - Interval duration in milliseconds * @returns Controls object with isActive, pause and resume methods, or undefined */ declare function useInterval(fn: T, duration: number): UseIntervalReturn; //#endregion //#region src/event/useKeyBoard.d.ts /** * Listen for specific keyboard shortcut string, e.g. "Ctrl+Shift+X". * Calls the callback when the generated key string matches the provided one. * * @param c - Shortcut string to match * @param callback - Called with the matched code when it occurs * @returns A stop function that removes the keydown listener */ declare function useKeyBoard(c: string, callback: (code: string) => void): () => void; //#endregion //#region src/event/useMouse.d.ts /** * Throttled mousemove listener. The callback will be called at most once per `delay` ms. * * @param callback - MouseEvent handler * @param delay - Minimum ms between invocations * @returns A stop function to remove the listener */ declare function useMouse(callback: (e: MouseEvent) => void, delay?: number): () => void; //#endregion //#region src/event/useMutationObserver.d.ts /** * Observe DOM mutations on a parent node and invoke callback when changes occur. * * @param element - The node or selector to observe * @param callback - MutationCallback invoked with mutations * @param options - MutationObserverInit options (defaults to { childList: true }) * @returns A stop function to disconnect the observer */ declare function useMutationObserver(element: Element | string | ParentNode | Text | null, callback: MutationCallback, options?: MutationObserverInit): (() => true | undefined) | undefined; //#endregion //#region src/event/useResizeObserver.d.ts /** * Call the callback when the window is resized, returning the viewport width and height. * * @param callback - Receives (width, height) * @returns A stop function for the resize listener */ declare function useResizeObserver(callback: (width: number, height: number) => void): () => void; //#endregion //#region src/event/useWindowScroll.d.ts /** * Listen to document scroll and call callback with current scrollLeft/scrollTop. * * @param callback - Receives (left, top) * @returns A stop function for the scroll listener */ declare function useWindowScroll(callback: (left: number, top: number) => void): () => void; //#endregion //#region src/event/useTimeout.d.ts /** * Run a function once after a delay and return a stop function. * If fn is not a function, undefined is returned. * * @param fn - Function to run after the delay * @param duration - Delay in milliseconds (default 0) * @returns A function that clears the timeout, or undefined if fn is not a function */ declare function useTimeout(fn: T, duration?: number): UseTimeoutReturn; //#endregion //#region src/event/collisionDetection.d.ts /** * Return whether two elements overlap (axis-aligned bounding box collision). * * @param o1 - Element, selector, or null-like value for the first object * @param o2 - Element, selector, or null-like value for the second object * @returns true if the two bounding boxes overlap, false otherwise */ declare function collisionDetection(o1: MaybeElement, o2: MaybeElement): boolean; //#endregion //#region src/event/download.d.ts /** * Trigger a download by creating a temporary anchor and clicking it. * * @param href - URL to download * @param download - suggested filename */ declare function download(href: string, download?: string): void; //#endregion //#region src/event/useHead.d.ts interface IMeta { name: 'description' | 'viewport' | 'keywords' | 'robots' | string; content: string; } interface IScript { src: string; type: 'async' | 'module' | 'nomodule' | 'defer'; } interface ILink { rel: 'stylesheet' | 'preload' | 'icon' | 'prefetch' | string; href: string; } interface HeadOptions { title?: string | (() => string); meta?: IMeta[]; script?: IScript[]; link?: ILink[]; } /** * Mount meta/script/link elements and optionally set document.title. * The created nodes are inserted into document.head and a function to remove * the created fragment is returned. * * @param options - Head options (title, meta, script, link) * @returns A function that removes the inserted nodes from the head */ declare function useHead(options: HeadOptions): HTMLElement | null; //#endregion //#region src/event/useLongPress.d.ts /** * Fire callback when the target receives a long mouse press (mousedown -> mouseup after ms). * * @param el - target element or selector * @param ms - duration threshold in milliseconds * @param callback - invoked when a long press is detected * @returns A stop function to remove listeners */ declare function useLongPress(el: MaybeElement, ms: number, callback: () => void): () => void; //#endregion //#region src/event/useBlur.d.ts /** * Call callback when focus is lost from the given element. * Internally it uses click listeners to determine when clicks happen inside/outside. * * @param el - Target element or selector * @param callback - Called when focus is lost (click outside) * @returns A stop function to remove listeners */ declare function useBlur(el: MaybeElement, callback: () => void): () => true | undefined; //#endregion //#region src/event/createTextNode.d.ts /** * Create a DOM Text node from a string. * * @param {string} text Text content. * @returns {Text} A DOM Text node. */ declare function createTextNode(text: string): Text; //#endregion //#region src/event/useRange.d.ts /** * Get the bounding client rect for a caret/cursor position at the start of a node. * Useful for positioning popups next to inline nodes. If the container has offsets * the caller may need to subtract them. * * @param target - Node to measure * @returns DOMRect representing the range bounding box */ declare function useRange(target: Node): DOMRect; //#endregion //#region src/flex/waterfall.d.ts /** * 创建图片瀑布流并挂载到目标容器 * @description EN: Create a simple waterfall (masonry) layout for images and mount it into the target container. Returns an `append` function to add more images. * @param { string[] } imageList 图片 URL 列表 * @param { MaybeElement | number } target 目标容器或直接传入宽度(当传数字时表示宽度并默认挂载到 body) * @param { number } width 图片显示宽度(像素),默认为 200 * @param { number } space 图片间距(像素),默认 20 * @returns {(imageList: string[]) => void} 返回一个函数,用于追加更多图片到瀑布流 */ declare function waterfall(imageList: string[], target: MaybeElement | number, width?: number, space?: number): (imageList: string[]) => void; //#endregion //#region src/html/escapeHtml.d.ts /** * 转义html * @description EN: Escape HTML special characters in a string to their entity equivalents. * @param { string } s 字符串 * @returns */ declare function escapeHtml(s: string): string; //#endregion //#region src/html/htmlTransform.d.ts interface Update { setAttribs: (key: string, value?: string) => void; beforeInsert: (str: string) => void; afterInsert: (s: string) => void; renameAttribs: (key: string, value: string) => void; } type HtmlTransformOptions = Record void>; /** * htmlparser * @description EN: Parse an HTML string into a DOM-like structure, allow transformations via callbacks, and return the transformed HTML string. * @param { string } s 字符串 * @param options {} * @param { (key: string, value?: string) => void } options.setAttribs 设置属性 * @param { (str: string) => void } options.beforeInsert 插入前 * @param { (s: string) => void } options.afterInsert 插入后 * @param { (key: string, value?: string) => void } options.renameAttribs 重命名 * @returns */ declare function htmlTransform(s?: string, options?: HtmlTransformOptions): Promise; //#endregion //#region src/html/unescapeHtml.d.ts /** * 反转义html * @description EN: Convert HTML entities back into their corresponding characters. * @param { string } s 字符串 * @returns */ declare function unescapeHtml(s: string): string; //#endregion //#region src/html/getStyles.d.ts declare const stylesReg: RegExp; /** * * @param { string } str 字符串模板 * @param { Function } callback 读取style时的回调 * @returns * @description EN: Extract inline style attributes from HTML-like strings and call `callback` with each style and the full matching block. */ declare function getStyles(str: string, callback: (style: string, block: string, index: number) => string): string; //#endregion //#region src/https/httpsRedirect.d.ts /** * http重定向到https * @description EN: If the current page is loaded over HTTP, redirect to the HTTPS version of the same URL. */ declare function httpsRedirect(): void; //#endregion //#region src/is/isAbsolute.d.ts /** * 判断是否是绝对路径 * @description EN: Return true when the provided path looks like an absolute path. Matches Unix absolute paths, Windows drive letters, or leading slashes/backslashes. * @param {string} url Path or URL string to test. * @returns {boolean} True when the path appears absolute. */ declare function isAbsolute(url: string): boolean; //#endregion //#region src/is/isArray.d.ts /** * 判断是否是数组 * @description EN: Alias for Array.isArray. */ declare const isArray: (arg: any) => arg is any[]; //#endregion //#region src/is/isBlob.d.ts /** * 判断是否是blob * @description EN: Check whether a value is a Blob object. * @param o - candidate value * @returns boolean */ declare function isBlob(o: any): o is Blob; //#endregion //#region src/is/isBool.d.ts /** * 判断是否是boolean类型 * @description EN: Check whether a value is a boolean. * @param value - candidate value * @returns boolean */ declare function isBool(value: any): value is boolean; //#endregion //#region src/is/isBottom.d.ts /** * Determine whether the document is scrolled to the bottom (within `distance`). * @description EN: Returns true when the document scroll position is at or near the bottom. * @param {number} [distance] Additional threshold in pixels. * @returns {boolean} */ declare function isBottom(distance?: number): boolean; //#endregion //#region src/is/isBrowser.d.ts /** * 判断当前环境是否具有浏览器全局(window) * @description EN: True in environments where `globalThis.window` is defined (typical browsers). */ declare const isBrowser: boolean; //#endregion //#region src/is/isContainCn.d.ts /** * 判断是否包含中文 * @description EN: Returns true if the input string contains any CJK Unified Ideographs (Chinese characters). * @param s - input string * @returns boolean */ declare function isContainCn(s: string): boolean; //#endregion //#region src/is/isDate.d.ts /** * 判断是否是日期格式 * @description EN: Check whether a value is a Date instance. * @param d - candidate value * @returns boolean */ declare function isDate(d: any): d is Date; //#endregion //#region src/is/isDef.d.ts /** * 判断元素不是undefined * @description EN: Determine whether a value is defined (not undefined). * @param v - candidate value * @returns boolean */ declare function isDef(v: T): v is T extends undefined ? never : T; //#endregion //#region src/is/isElement.d.ts /** * 判断元素是HTMLElement * @description EN: Check whether a value is an HTMLElement. * @param element - candidate value * @returns boolean */ declare function isElement(element: any): element is HTMLElement; //#endregion //#region src/is/isEqual.d.ts /** * 深度比较两个值是否相等 * @description EN: Deep equality check for plain objects and arrays. * @param {any} o1 First value. * @param {any} o2 Second value. * @returns {boolean} True when values are deeply equal. */ declare function isEqual(o1: any, o2: any): boolean; //#endregion //#region src/is/isEsModule.d.ts /** * 判断对象是ESModule * @description EN: Detect if an object is an ES module (common __esModule or Symbol.toStringTag). * @param obj - candidate object * @returns boolean */ declare function isESModule(obj: any): obj is IsESModule; //#endregion //#region src/is/isFalse.d.ts /** * 判断是否是false * @description EN: Check whether a value is the boolean false. * @param v - candidate value * @returns boolean */ declare function isFalse(v: any): v is false; //#endregion //#region src/is/isFileType.d.ts /** * 判断文件类型 * @description EN: Test if a filename/path has a given extension. * @param { string } file 文件路径 * @param { string } appendix 文件类型 * @returns boolean */ declare function isFileType(file: string, appendix: string): boolean; //#endregion //#region src/is/isFn.d.ts /** * 判断是否是函数 * @description EN: Check whether a value is a function. * @param o - candidate value * @returns boolean */ declare function isFn(o: any): o is Function; //#endregion //#region src/is/isIPv4.d.ts /** * 判断是否为 IPv4 地址 * @description EN: Test whether a string is a valid IPv4 address. * @param {string} ip Candidate IP string. * @returns {boolean} */ declare function isIPv4(ip: string): boolean; //#endregion //#region src/is/isIPv6.d.ts /** * 判断是否为 IPv6 地址 * @description EN: Test whether a string matches common IPv6 patterns. * @param {string} ip Candidate IP address. * @returns {boolean} */ declare function isIPv6(ip: string): boolean; //#endregion //#region src/is/isIdCard.d.ts /** * 判断是否是身份证 * @param s * @returns */ /** * 判断是否为身份证号(中国身份证格式的简单校验) * @description EN: Heuristic check for Chinese ID card numbers (15 or 18 digits with possible 'X'). * @param {string} s Candidate ID string. * @returns {boolean} */ declare function isIdCard(s: string): boolean; //#endregion //#region src/is/isLeapYear.d.ts /** * Determine whether a year is a leap year. * * @param {number} year Year number. * @returns {boolean} */ /** * 判断是否为闰年 * @description EN: Returns true for leap years (divisible by 400 or divisible by 4 and not by 100). * @param {number} year Year number. * @returns {boolean} */ declare function isLeapYear(year: number): boolean; //#endregion //#region src/is/isMap.d.ts /** * 判断是否是 Map * @description EN: Check whether a value is a Map instance. * @param {any} o Candidate value. * @returns {o is Map} True if the internal [[Class]] is 'Map'. */ declare function isMap(o: any): o is Map; //#endregion //#region src/is/isMobile.d.ts /** * 判断是否是手机号 * @description EN: Check whether a string looks like a mobile phone number (China-focused pattern). * @param s - phone number string * @returns boolean */ declare function isMobile(s: string): boolean; //#endregion //#region src/is/isNaN.d.ts /** * 判断是否为 NaN * @description EN: Wraps Number.isNaN for a consistent helper. * @param o Candidate value. * @returns {boolean} */ declare function isNaN(o: any): boolean; //#endregion //#region src/is/isNil.d.ts /** * 判断是否为 null 或 undefined * @description EN: Returns true when the value is strictly null or undefined. * @param {any} value Candidate value. * @returns {value is null | undefined} */ declare function isNil(value: any): value is null | undefined; //#endregion //#region src/is/isNull.d.ts /** * 判断是否为 null * @description EN: Check if a value is strictly `null`. * @param {any} o Candidate value. * @returns {o is null} True when the value is exactly null. */ declare function isNull(o: any): o is null; //#endregion //#region src/is/isNum.d.ts /** * 判断是否是number类型 */ /** * 判断是否为数字 * @description EN: Check whether a value has type 'number'. * @param {any} o Candidate value. * @returns {o is number} */ declare function isNum(o: any): o is number; //#endregion //#region src/is/isObject.d.ts /** * 判断是否为对象类型 * @description EN: Returns true for values with typeof 'object' (note: arrays/null are objects too). * @param {any} value Candidate value. * @returns {boolean} */ declare function isObject(value: any): boolean; //#endregion //#region src/is/isPlainObject.d.ts /** * Check whether value is a plain object (i.e. {}). * * @param {any} o Candidate value. * @returns {o is Record} True when `o` is a plain object. */ declare function isPlainObject(o: any): o is Record; //#endregion //#region src/is/isPostCode.d.ts /** * 判断是否是邮编 */ /** * 判断是否为邮政编码 * @description EN: Simplified check for a 6-digit postal code (China-style). * @param {string|number} s Candidate value. * @returns {boolean} */ declare function isPostCode(s: string | number): boolean; //#endregion //#region src/is/isPromise.d.ts /** * 判断是否是promise */ /** * 判断是否为 Promise * @description EN: Check whether a value is a Promise instance. * @param {any} o Candidate value. * @returns {o is Promise} */ declare function isPromise(o: any): o is Promise; //#endregion //#region src/is/isReg.d.ts /** * 判断是否是正则 * @description EN: Check whether a value is a RegExp instance. * @param o Candidate value. * @returns {o is RegExp} True when the value is a regular expression. */ declare function isReg(o: any): o is RegExp; //#endregion //#region src/is/isRelative.d.ts /** * 判断是否是相对路径 */ /** * 判断路径是否为相对路径 * @description EN: Returns true for strings starting with './' or '../'. * @param {string} str Path string. * @returns {boolean} */ declare function isRelative(str: string): boolean; //#endregion //#region src/is/isSameDay.d.ts /** * 判断是否是同一天 * @param { Date } dateLeft 日期一 * @param { Date } dateRight 日期二 */ /** * 判断两个日期是否为同一天 * @description EN: Compares year, month and date to determine whether two Date * objects represent the same calendar day. * @param {Date} dateLeft First date. * @param {Date} dateRight Second date. * @returns {boolean} */ declare function isSameDay(dateLeft: Date, dateRight: Date): boolean; //#endregion //#region src/is/isSet.d.ts /** * 判断是否为 Set * @description EN: Check whether a value is a Set instance. * @param {any} o Candidate value. * @returns {o is Set} True when the internal [[Class]] is 'Set'. */ declare function isSet(o: any): o is Set; //#endregion //#region src/is/isStr.d.ts /** * 判断是否为字符串 * @description EN: Check whether a value has type 'string'. * @param {any} o Candidate value. * @returns {o is string} */ declare function isStr(o: any): o is string; //#endregion //#region src/is/isSupportCamera.d.ts /** * 判断当前环境是否支持摄像头采集(getUserMedia) * @description EN: Heuristic detection for getUserMedia support across legacy vendor prefixes. * @returns {boolean} */ declare function isSupportCamera(): boolean; //#endregion //#region src/is/isSupportWebp.d.ts /** * 判断当前浏览器是否支持 WebP * @description EN: Returns true when the current browser can encode a WebP * data URL from a canvas (a common heuristic for WebP support). * @returns {boolean} */ declare function isSupportWebp(): boolean; //#endregion //#region src/is/isSymbol.d.ts /** * 判断是否是symbol类型 */ /** * 判断是否为 symbol * @description EN: Check whether a value has type 'symbol'. * @param {any} o Candidate value. * @returns {o is symbol} */ declare function isSymbol(o: any): o is symbol; //#endregion //#region src/is/isTrue.d.ts /** * 判断是否是true /** * \u5224\u65ad\u662f\u5426\u662ftrue * @description EN: Check whether a value is the boolean literal true. * @param v - candidate value * @returns v is true */ declare function isTrue(v: any): v is true; //#endregion //#region src/is/isType.d.ts /** * 判断对象类型 */ /** * 判断值是否匹配指定的类型标签 * @description EN: Flexible type checker that accepts a shorthand type string * (like 'str', 'array', 'map') or multiple types separated by '|'. The * implementation delegates to specific `isX` helpers. * @param s Candidate value to test. * @param type Type label or pipe-separated labels. * @returns boolean True when any of the provided type labels match. */ declare function isType(s: T, type: string): boolean; //#endregion //#region src/is/isUndef.d.ts /** * 判断是否为 undefined * @description EN: Returns true when the value is exactly `undefined`. * @param o Candidate value. * @returns {o is undefined} */ declare function isUndef(o: any): o is undefined; //#endregion //#region src/is/isUrl.d.ts /** * 判断是否是 URL * @description EN: Simple check whether a string looks like an HTTP/HTTPS URL. * @param {string} url The candidate URL string. * @returns {boolean} True if the string begins with "http://" or "https://". */ declare function isUrl(url: string): boolean; //#endregion //#region src/is/isVideo.d.ts /** * 判断是否为视频文件(基于扩展名) * @description EN: Returns true when the filepath ends with a known video file extension. * @param {string} filepath Path or filename. * @returns {boolean} */ declare function isVideo(filepath: string): boolean; //#endregion //#region src/is/isWeakMap.d.ts /** * 判断是否为 WeakMap * @description EN: Check whether a value is a WeakMap instance. * @param {any} o Candidate value. * @returns {o is WeakMap} */ declare function isWeakMap(o: any): o is WeakMap; //#endregion //#region src/is/isWeakSet.d.ts /** * 判断是否为 WeakSet * @description EN: Check whether a value is a WeakSet instance. * @param {any} o Candidate value. * @returns {o is WeakSet} */ declare function isWeakSet(o: any): o is WeakSet; //#endregion //#region src/is/isWin.d.ts /** * 判断是否为 Windows 平台 * @description EN: Returns true when running on Windows (platform 'win32'). * @returns {boolean} */ declare function isWin(): boolean; //#endregion //#region src/is/isSocketUrl.d.ts /** * 判断是否为 WebSocket URL * @description EN: Returns true for URLs that start with ws:// or wss://. * @param {string} url URL string. * @returns {boolean} */ declare function isSocketUrl(url: string): boolean; //#endregion //#region src/is/isBase64.d.ts /** * Check whether a string is a base64 data URL. * * @description EN: Validate whether a string is a data URL that contains base64-encoded content. * @param {string} base64 Candidate string. * @returns {boolean} True when the string looks like a base64 data URL. */ declare function isBase64(base64: string): boolean; //#endregion //#region src/is/isTrainNumber.d.ts /** * 判断是否是火车号 */ /** * 判断是否为火车车次(简单校验) * @description EN: Heuristic check for train numbers using common prefixes and 1-4 digits. * @param {string} s Candidate train number string. * @returns {boolean} */ declare const isTrainNumber: (s: string) => boolean; //#endregion //#region src/is/isNameCn.d.ts /** * 判断是否为中文姓名(含·) * @description EN: Test whether a string is a Chinese personal name (2-16 CJK chars or middle dot). * @param {string} s Candidate name string. * @returns {boolean} */ declare const isNameCn: (s: string) => boolean; //#endregion //#region src/is/isNameEn.d.ts /** * 判断输入是否为英文姓名样式 * @description EN: Simple heuristic to test for English name-like strings (letters and spaces, 2-22 chars). * @param {string} s Candidate string. * @returns {boolean} */ declare function isNameEn(s: string): boolean; //#endregion //#region src/is/isSoldierId.d.ts /** * 判断是否是军官证 * @description EN: Heuristic check for a soldier/officer ID string. This function uses a simple regex and may not cover all real-world formats; it is intended as a lightweight validator rather than authoritative verification. * @param {string} s Candidate ID string. * @returns {boolean} True when the string matches the expected pattern. */ declare function isSoldierId(s: string): boolean; //#endregion //#region src/is/isVersion.d.ts /** * 判断是否为版本号 * @description EN: Check whether a version string consists of dot-separated numeric parts. * @param {string} version Version string, e.g. '1.2.3'. * @returns {boolean} */ declare function isVersion(version: string): boolean; //#endregion //#region src/is/isDivElement.d.ts /** * 判断目标是否为 HTMLDivElement * @description EN: Narrow type guard to detect
elements. * @param {unknown} target Candidate value. * @returns {target is HTMLDivElement} */ declare function isDivElement(target: unknown): target is HTMLDivElement; //#endregion //#region src/is/isIFrameElement.d.ts /** * 判断目标是否为 HTMLIFrameElement * @description EN: Narrow type guard for iframe elements. * @param {unknown} target Candidate value. * @returns {target is HTMLIFrameElement} */ declare function isIFrameElement(target: unknown): target is HTMLIFrameElement; //#endregion //#region src/is/isImageElement.d.ts /** * 判断目标是否为 HTMLImageElement * @description EN: Narrow type check to determine whether the target is an element. * @param {unknown} target Candidate value. * @returns {target is HTMLImageElement} */ declare function isImageElement(target: unknown): target is HTMLImageElement; //#endregion //#region src/is/isNode.d.ts /** * 判断目标是否为 DOM Node * @description EN: Returns true when the target is a DOM Node or looks like one (has numeric nodeType). * @param {unknown} target Candidate value. * @returns {target is Node} */ declare function isNode(target: unknown): target is Node; //#endregion //#region src/is/isProxyDocument.d.ts /** * 判断目标是否为 ProxyDocument(特定实现的代理文档对象) * @description EN: Type guard that tests for an object whose [[Class]] is 'ProxyDocument'. * @param {unknown} target Candidate value. * @returns {target is Document} */ declare function isProxyDocument(target: unknown): target is Document; //#endregion //#region src/is/isScriptElement.d.ts /** * 判断目标是否为 HTMLScriptElement * @description EN: Narrow type guard for