declare module '*.less'; declare module '*.css'; declare module '*.js'; declare module '*.jsx'; declare module '*.cjs'; declare module '*.mjs'; declare module '*.json'; declare module '*.ts'; declare module '*.png'; declare module '*.svg'; declare module '*.woff2'; declare module './index.less' { const styles: { readonly [key: string]: string }; export default styles; } declare module '*.mdx' { // eslint-disable-next-line @typescript-eslint/no-explicit-any let MDXComponent: (props: any) => JSX.Element; export default MDXComponent; } declare module '*?raw' { export default string; } declare module '*?url' { export default string; } declare module 'scope:components' { import { MDXComponents } from '@moneko/solid/mdx'; const scope: MDXComponents; export default scope; } declare module '*.md' { import type { MDXProviderProps } from '@moneko/solid/mdx'; const MDXProvider: (props: Partial) => JSX.Element; export default MDXProvider; } declare module '*.mdx' { import type { MDXProviderProps } from '@moneko/solid/mdx'; const MDXProvider: (props: Partial) => JSX.Element; export default MDXProvider; } declare module 'docs:docs' { import { JSX } from 'solid-js'; interface ApiEntry { [key: string]: (() => JSX.Element)[]; } const entry: ApiEntry; export default entry; } declare module 'app:routes' { import { RouteDefinition } from '@solidjs/router'; interface IRouteDefinition extends Omit { children?: RouteConfig[]; } export interface RouteConfig extends IRouteDefinition { /** 菜单id */ key?: string; value?: string; path: string; /** 菜单图标 */ icon?: string; dynamicTitle?: string; /** 菜单名 */ label?: string | null; hideMenu?: boolean; hideTab?: boolean; onlyLogin?: boolean; /** 菜单父id */ parentId?: string; /** 可否关闭标签 */ closable?: boolean; /** 子菜单 */ // children?: RouterProps[]; props?: { path: string; [key: string]: Any; }; metadata?: Record; } const routes: RouteConfig[]; export default routes; } interface ExampleModuleBase { codes: Record; title?: string; description?: string; col?: string; order?: number; [key: string]: unknown; } declare module 'docs:example' { export interface ExampleModule extends ExampleModuleBase { [key: string]: unknown; } const examples: Record Promise<{ default: ExampleModule[] }>>; export default examples; } declare module 'example:*' { export interface ExampleModule extends ExampleModuleBase { [key: string]: unknown; } const example: ExampleModule[]; export default example; } declare module 'docs:coverage' { export type CoverageType = { /** 语句(statement coverage) */ statements: string; /** 语句覆盖: 是不是每个语句都执行了 */ coveredstatements: string; /** 条件(branch coverage) */ conditionals: string; /** 条件覆盖: 是不是每个条件代码块都执行了 */ coveredconditionals: string; /** 函数(function coverage) */ methods: string; /** 函数覆盖: 是不是每个函数都调用了 */ coveredmethods: string; }; export type ProjectCoverageType = { /** 元素 */ elements: string; /** 覆盖元素 */ coveredelements: string; complexity: string; loc: string; ncloc: string; /** 经过测试的组件 */ packages: string; /** 经过测试的文件 */ files: string; /** 经过测试的类 */ classes: string; }; const coverage: Record>; export default coverage; } declare module 'app:locales' { import type { SetStoreFunction } from 'solid-js/store'; export type LocaleConfig = { /** 语言名称 (未设置时使用文件名)*/ language?: string; /** 描述 */ title: string; /** Icon */ icon?: string; /** 翻译字典 */ translation: Record; }; type LocaleConfigMap = Record; export type InterpolationType = { [K in T]?: string | number | symbol | boolean; }; export interface Locale extends LocaleConfig { language: string; } /** 获取当前项目的语言列表 */ export const locales: Pick[] = []; export const resources: Partial = {}; /** * 插值字符串; 替换字符串中的占位符 `${}` 为对应的值 * @param {string} str 包含占位符的字符串 * @param {Argument} values 用于替换占位符的值,按照占位符出现的顺序排列 * @returns {string} 替换后的字符串 */ export function template(str: string, values: InterpolationType): string; /** 设置语言 * @param {string} localeName 语言名称 * @returns {void} * @example * ```js * setLang('zh_CN'); * ``` */ export function setLang(localeName: string): void; /** 使用的语言 */ export const lang: Omit; /** 映射 */ export const t: Record; /** 设置 */ export const setLocalizable: SetStoreFunction<{ lang: Omit; t: Record; }>; } declare let __webpack_public_path__: string | undefined; interface Window { areaPaddingTop?: number; areaPaddingBottom?: number; __POWERED_BY_QIANKUN__?: boolean; mainApp: { container: HTMLElement; [key: string]: any; }; } interface ICustomElement { // eslint-disable-next-line @typescript-eslint/no-explicit-any [prop: string]: any; __initialized?: boolean; __released: boolean; // eslint-disable-next-line @typescript-eslint/no-explicit-any __releaseCallbacks: any[]; // eslint-disable-next-line @typescript-eslint/no-explicit-any __propertyChangedCallbacks: any[]; __updating: { // eslint-disable-next-line @typescript-eslint/no-explicit-any [prop: string]: any; }; props: { // eslint-disable-next-line @typescript-eslint/no-explicit-any [prop: string]: any; }; lookupProp(attrName: string): string | undefined; renderRoot: Element | Document | ShadowRoot | DocumentFragment; addReleaseCallback(fn: () => void): void; // eslint-disable-next-line @typescript-eslint/no-explicit-any addPropertyChangedCallback(fn: (name: string, value: any) => void): void; } type IEvent = (e: CustomEvent) => void; type ICustomEvent = T extends { [key in K]?: (v: infer V) => void } ? IEvent : T extends { [key in K]?: (...args: infer Args) => void } ? IEvent : never; type IOmit = Omit & { [K in Keys]?: ICustomEvent; }; type CustomElement = ICustomElement, E = 'onChange'> = IOmit< T, E > & { ref?: CustomElement | { current: CustomElement | null }; shadowRoot?: ShadowRoot | Element | null; offsetWidth?: number; part?: string; }; interface ComponentOptions { element: T & ICustomElement; }