import "@inpageedit/modal/style.css"; import "@/styles/index.scss"; import * as fexios0 from "fexios"; import "./plugins/quick-preview/style.scss"; import "./plugins/quick-upload/style.scss"; import "./plugins/toolbox/styles.scss"; //#region ../../node_modules/.pnpm/cosmokit@1.8.0/node_modules/cosmokit/lib/index.d.ts type Dict = { [key in K$1]: T }; type Promisify = Promise ? S : T>; type Awaitable = [T] extends [Promise] ? T : T | Promise; declare function isArrayBufferLike(value: any): value is ArrayBufferLike; declare function isArrayBufferSource(value: any): value is Binary.Source; declare namespace Binary { type Source = T | ArrayBufferView; const is: typeof isArrayBufferLike; const isSource: typeof isArrayBufferSource; function fromSource(source: Source): T; function toBase64(source: ArrayBufferLike): string; function fromBase64(source: string): ArrayBuffer; function toHex(source: ArrayBufferLike): string; function fromHex(source: string): ArrayBuffer; } //#endregion //#region ../../node_modules/.pnpm/@cordisjs+core@3.18.1/node_modules/@cordisjs/core/lib/index.d.ts declare abstract class Service { static readonly setup: unique symbol; static readonly invoke: unique symbol; static readonly extend: unique symbol; static readonly tracker: unique symbol; static readonly provide: unique symbol; static readonly immediate: unique symbol; protected start(): Awaitable; protected stop(): Awaitable; protected fork?(ctx: C$1, config: any): void; protected ctx: C$1; name: string; config: T; constructor(...args: Spread); constructor(ctx: C$1, ...args: Spread); constructor(ctx: C$1, name: string, immediate?: boolean); protected [symbols.filter](ctx: Context): boolean; protected [symbols.setup](): void; protected [symbols.extend](props?: any): any; static [Symbol.hasInstance](instance: any): boolean; } declare const symbols: { shadow: symbol; receiver: symbol; original: symbol; store: typeof Context.store; events: typeof Context.events; static: typeof Context.static; filter: typeof Context.filter; expose: typeof Context.expose; isolate: typeof Context.isolate; internal: typeof Context.internal; intercept: typeof Context.intercept; setup: typeof Service.setup; invoke: typeof Service.invoke; extend: typeof Service.extend; tracker: typeof Service.tracker; provide: typeof Service.provide; immediate: typeof Service.immediate; }; type Inject = string[] | Dict; declare function Inject(inject: Inject): (value: any, ctx: ClassDecoratorContext | ClassMethodDecoratorContext) => void; declare namespace Inject { interface Meta { required: boolean; } function resolve(inject: Inject | null | undefined): { [k: string]: { required: boolean; }; }; } type Plugin$1 = Plugin$1.Function | Plugin$1.Constructor | Plugin$1.Object; declare namespace Plugin$1 { interface Base { name?: string; reactive?: boolean; reusable?: boolean; Config?: (config: any) => T; inject?: Inject; intercept?: Dict; } interface Transform { schema?: true; Config: (config: S) => T; } interface Function extends Base { (ctx: C$1, config: T): void; } interface Constructor extends Base { new (ctx: C$1, config: T): void; } interface Object extends Base { apply: (ctx: C$1, config: T) => void; } } type Spread = undefined extends T ? [config?: T] : [config: T]; interface Context { /** @deprecated use `ctx.inject()` instead */ using(deps: Inject, callback: Plugin$1.Function): ForkScope; inject(deps: Inject, callback: Plugin$1.Function): ForkScope; plugin(plugin: Plugin$1.Function & Plugin$1.Transform, ...args: Spread): ForkScope; plugin(plugin: Plugin$1.Constructor & Plugin$1.Transform, ...args: Spread): ForkScope; plugin(plugin: Plugin$1.Object & Plugin$1.Transform, ...args: Spread): ForkScope; plugin(plugin: Plugin$1.Function, ...args: Spread): ForkScope; plugin(plugin: Plugin$1.Constructor, ...args: Spread): ForkScope; plugin(plugin: Plugin$1.Object, ...args: Spread): ForkScope; } declare class Registry { ctx: C$1; private _counter; private _internal; protected context: Context; constructor(ctx: C$1, config: any); get counter(): number; get size(): number; resolve(plugin: Plugin$1, assert?: boolean): Function | undefined; get(plugin: Plugin$1): MainScope | undefined; has(plugin: Plugin$1): boolean; set(plugin: Plugin$1, state: MainScope): void; delete(plugin: Plugin$1): MainScope | undefined; keys(): IterableIterator; values(): IterableIterator>; entries(): IterableIterator<[Function, MainScope]>; forEach(callback: (value: MainScope, key: Function, map: Map>) => void): void; using(inject: Inject, callback: Plugin$1.Function): ForkScope; inject(inject: Inject, callback: Plugin$1.Function): ForkScope; plugin(plugin: Plugin$1, config?: any, error?: any): ForkScope; } interface Context { scope: EffectScope; runtime: MainScope; effect(callback: Callable): T; effect(callback: Callable, config: R$1): T; /** @deprecated use `ctx.effect()` instead */ collect(label: string, callback: () => void): () => void; accept(callback?: (config: this['config']) => void | boolean, options?: AcceptOptions): () => boolean; accept(keys: (keyof this['config'])[], callback?: (config: this['config']) => void | boolean, options?: AcceptOptions): () => boolean; decline(keys: (keyof this['config'])[]): () => boolean; } type Disposable = () => void; type DisposableLike = Disposable | { dispose: Disposable; }; type Callable = ((...args: R$1) => T) | (new (...args: R$1) => T); interface AcceptOptions { passive?: boolean; immediate?: boolean; } interface Acceptor extends AcceptOptions { keys?: string[]; callback?: (config: any) => void | boolean; } declare const enum ScopeStatus { PENDING = 0, LOADING = 1, ACTIVE = 2, FAILED = 3, DISPOSED = 4, } declare class CordisError extends Error { code: CordisError.Code; constructor(code: CordisError.Code, message?: string); } declare namespace CordisError { type Code = keyof typeof Code; const Code: { readonly INACTIVE_EFFECT: "cannot create effect on inactive context"; }; } declare abstract class EffectScope { parent: C$1; config: C$1['config']; uid: number | null; ctx: C$1; disposables: Disposable[]; error: any; status: ScopeStatus; isActive: boolean; protected context: Context; protected proxy: any; protected acceptors: Acceptor[]; protected tasks: Set>; protected hasError: boolean; abstract runtime: MainScope; abstract dispose(): boolean; abstract update(config: C$1['config'], forced?: boolean): void; constructor(parent: C$1, config: C$1['config']); protected get _config(): any; assertActive(): void; effect(callback: Callable, config?: any): { dispose: Disposable; } | (() => void); collect(label: string, callback: () => any): () => any; restart(): void; protected _getStatus(): ScopeStatus; updateStatus(callback?: () => void): void; ensure(callback: () => Promise): void; cancel(reason?: any): void; get ready(): boolean; reset(): void; protected init(error?: any): void; start(): true | undefined; accept(callback?: (config: C$1['config']) => void | boolean, options?: AcceptOptions): () => boolean; accept(keys: string[], callback?: (config: C$1['config']) => void | boolean, options?: AcceptOptions): () => boolean; decline(keys: string[]): () => boolean; checkUpdate(resolved: any, forced?: boolean): boolean[]; } declare class ForkScope extends EffectScope { runtime: MainScope; dispose: () => boolean; constructor(parent: Context, runtime: MainScope, config: C$1['config'], error?: any); start(): true | undefined; update(config: any, forced?: boolean): void; } declare class MainScope extends EffectScope { plugin: Plugin$1; value: any; runtime: this; schema: any; name?: string; inject: Dict; forkables: Function[]; children: ForkScope[]; isReusable?: boolean; isReactive?: boolean; constructor(ctx: C$1, plugin: Plugin$1, config: any, error?: any); get isForkable(): boolean; fork(parent: Context, config: any, error?: any): ForkScope; dispose(): boolean; private setup; private apply; reset(): void; start(): true | undefined; update(config: C$1['config'], forced?: boolean): void; } interface Context { get(name: K$1): undefined | this[K$1]; get(name: string): any; set(name: K$1, value: undefined | this[K$1]): () => void; set(name: string, value: any): () => void; /** @deprecated use `ctx.set()` instead */ provide(name: string, value?: any, builtin?: boolean): void; accessor(name: string, options: Omit): void; alias(name: string, aliases: string[]): void; mixin(name: K$1, mixins: (keyof this & keyof this[K$1])[] | Dict): void; mixin(source: T, mixins: (keyof this & keyof T)[] | Dict): void; } declare class ReflectService { ctx: Context; static resolveInject(ctx: Context, name: string): readonly [string, Context.Internal.Service | Context.Internal.Accessor]; static checkInject(ctx: Context, name: string, error: Error): void; static handler: ProxyHandler; constructor(ctx: Context); get(name: string): any; set(name: string, value: any): () => void; provide(name: string, value?: any, builtin?: boolean): void; _accessor(name: string, options: Omit): () => void; accessor(name: string, options: Omit): void; alias(name: string, aliases: string[]): void; _mixin(source: any, mixins: string[] | Dict): () => void; mixin(source: any, mixins: string[] | Dict): void; trace(value: T): T; bind(callback: T): T; } type Parameters$1 = F extends ((...args: infer P) => any) ? P : never; type ReturnType$1 = F extends ((...args: any) => infer R) ? R : never; type ThisType$1 = F extends ((this: infer T, ...args: any) => any) ? T : never; type GetEvents = C$1[typeof Context.events]; interface Context { [Context.events]: Events$1; parallel>(name: K$1, ...args: Parameters$1[K$1]>): Promise; parallel>(thisArg: ThisType$1[K$1]>, name: K$1, ...args: Parameters$1[K$1]>): Promise; emit>(name: K$1, ...args: Parameters$1[K$1]>): void; emit>(thisArg: ThisType$1[K$1]>, name: K$1, ...args: Parameters$1[K$1]>): void; serial>(name: K$1, ...args: Parameters$1[K$1]>): Promisify[K$1]>>; serial>(thisArg: ThisType$1[K$1]>, name: K$1, ...args: Parameters$1[K$1]>): Promisify[K$1]>>; bail>(name: K$1, ...args: Parameters$1[K$1]>): ReturnType$1[K$1]>; bail>(thisArg: ThisType$1[K$1]>, name: K$1, ...args: Parameters$1[K$1]>): ReturnType$1[K$1]>; on>(name: K$1, listener: GetEvents[K$1], options?: boolean | EventOptions): () => boolean; once>(name: K$1, listener: GetEvents[K$1], options?: boolean | EventOptions): () => boolean; off>(name: K$1, listener: GetEvents[K$1]): boolean; start(): Promise; stop(): Promise; } interface EventOptions { prepend?: boolean; global?: boolean; } interface Hook$2 extends EventOptions { ctx: Context; callback: (...args: any[]) => any; } declare class Lifecycle { private ctx; isActive: boolean; _tasks: Set>; _hooks: Record; constructor(ctx: Context); flush(): Promise; filterHooks(hooks: Hook$2[], thisArg?: object): Hook$2[]; dispatch(type: string, args: any[]): Generator; parallel(...args: any[]): Promise; emit(...args: any[]): void; serial(...args: any[]): Promise; bail(...args: any[]): any; register(label: string, hooks: Hook$2[], callback: any, options: EventOptions): () => any; unregister(hooks: Hook$2[], callback: any): true | undefined; on(name: string, listener: (...args: any) => any, options?: boolean | EventOptions): any; once(name: string, listener: (...args: any) => any, options?: boolean | EventOptions): any; start(): Promise; stop(): Promise; } interface Events$1 { 'fork'(ctx: C$1, config: C$1['config']): void; 'ready'(): Awaitable; 'dispose'(): Awaitable; 'internal/fork'(fork: ForkScope): void; 'internal/runtime'(runtime: MainScope): void; 'internal/status'(scope: EffectScope, oldValue: ScopeStatus): void; 'internal/info'(this: C$1, format: any, ...param: any[]): void; 'internal/error'(this: C$1, format: any, ...param: any[]): void; 'internal/warning'(this: C$1, format: any, ...param: any[]): void; 'internal/before-service'(this: C$1, name: string, value: any): void; 'internal/service'(this: C$1, name: string, value: any): void; 'internal/before-update'(fork: ForkScope, config: any): void; 'internal/update'(fork: ForkScope, oldConfig: any): void; 'internal/inject'(this: C$1, name: string): boolean | undefined; 'internal/listener'(this: C$1, name: string, listener: any, prepend: boolean): void; 'internal/event'(type: 'emit' | 'parallel' | 'serial' | 'bail', name: string, args: any[], thisArg: any): void; } declare namespace Context { type Parameterized = C$1 & { config: T; }; /** @deprecated use `string[]` instead */ interface MixinOptions { methods?: string[]; accessors?: string[]; prototype?: {}; } interface Item { value?: any; source: C$1; } type Internal = Internal.Service | Internal.Accessor | Internal.Alias; namespace Internal { interface Service { type: 'service'; builtin?: boolean; prototype?: {}; } interface Accessor { type: 'accessor'; get: (this: Context, receiver: any) => any; set?: (this: Context, value: any, receiver: any) => boolean; } interface Alias { type: 'alias'; name: string; } } } interface Intercept {} interface Context { [Context.store]: Dict, symbol>; [Context.isolate]: Dict; [Context.intercept]: Intercept; [Context.internal]: Dict; root: this; lifecycle: Lifecycle; reflect: ReflectService; registry: Registry; config: any; } declare class Context { static readonly store: unique symbol; static readonly events: unique symbol; static readonly static: unique symbol; static readonly filter: unique symbol; static readonly expose: unique symbol; static readonly isolate: unique symbol; static readonly internal: unique symbol; static readonly intercept: unique symbol; static readonly origin = "ctx"; static readonly current = "ctx"; static is(value: any): value is C$1; /** @deprecated use `Service.traceable` instead */ static associate(object: T, name: string): T; constructor(config?: any); get name(): string; get events(): Lifecycle; /** @deprecated */ get state(): EffectScope; extend(meta?: {}): this; isolate(name: string, label?: symbol): this; intercept(name: K$1, config: Intercept[K$1]): this; } //#endregion //#region ../../node_modules/.pnpm/@inpageedit+logger@0.1.0/node_modules/@inpageedit/logger/dist/index.d.ts declare type AnyConsoleMethod = 'debug' | 'log' | 'info' | 'warn' | 'error'; declare function createLogger(options?: LoggerOptions): Logger; declare interface LevelDefinition { level: LoggerLevel; /** e.g. "[I]" or "✅" */ label: string; /** which console method to use */ method: AnyConsoleMethod; } /** * @inpageedit/logger * Flexible, Extensible Console Logger with Colored Labels and Hierarchical Loggers * * @author dragon-fish * @license MIT * * @example * ```ts * const logger = new Logger({ name: 'MyApp', level: LoggerLevel.debug }) * // normal usage * logger.info('Application started') * // create sub-logger group * const apiLogger = logger.group('API', { color: '#f59e0b' }) * apiLogger.warn('Deprecated API endpoint used') * // define custom level * logger.defineLevel('success', { level: LoggerLevel.info, label: '✅', method: 'info' }) * logger.success('User created successfully') * ``` */ declare class Logger { private _name?; private _nameColor?; private _groupPath; private _dynamicLevels; private _levelRef; /** * Note: constructor returns a callable Proxy so that you can do `logger('group')`. */ constructor(options?: LoggerOptions); get level(): LoggerLevel; set level(v: LoggerLevel); /** Create a sub-logger with a group label */ group(group: string, options?: { color?: string; }): Logger; /** Define a custom level, e.g. logger.defineLevel('success', { level: info, label: '✅', method: 'info' }) */ defineLevel(name: string, def: LevelDefinition): void; get debug(): (...args: any[]) => void; get log(): (...args: any[]) => void; get info(): (...args: any[]) => void; get warn(): (...args: any[]) => void; get error(): (...args: any[]) => void; private _installBuiltinLevels; private _installLevelGetter; private _custom; private _method; private _consoleMethod; private _enabled; private _prefix; } declare interface Logger { (group: string, options?: { color?: string; }): Logger; } /** * @inpageedit/logger * * Flexible, Extensible Console Logger with Colored Labels and Hierarchical Loggers * * @author dragon-fish * @license MIT */ declare enum LoggerLevel { debug = -1, log = 0, info = 1, warn = 2, error = 3, silent = 4, } declare interface LoggerOptions { name?: string; /** preferred color for the name badge */ color?: string; /** minimum enabled level (inclusive). default: LoggerLevel.info */ level?: LoggerLevel; /** internal: group path */ _groupPath?: string[]; /** internal: inherit dynamic levels */ _dynamicLevels?: Record; /** internal: share level ref with parent */ _levelRef?: { value: LoggerLevel; }; } //#endregion //#region ../../node_modules/.pnpm/fexios@6.1.1/node_modules/fexios/dist/shared/fexios.BqMQ-9n0.d.mts type Func = (...args: Args$1) => Return; interface CallableInstanceConstructor { new (property: string | symbol): Func & CallableInstance; readonly prototype: CallableInstance; } interface CallableInstance extends Function { (...args: Args$1): Return; } declare const CallableInstance: CallableInstanceConstructor; //#endregion //#region ../../node_modules/.pnpm/fexios@6.1.1/node_modules/fexios/dist/shared/fexios.DVh0kFwC.d.mts /** * Fexios * @desc Fetch based HTTP client with similar API to axios for browser and Node.js */ declare class Fexios extends CallableInstance<[string | URL | (Partial & { url: string | URL; }), Partial?], Promise>> { static readonly version: any; private static readonly FINAL_SYMBOL; baseConfigs: FexiosConfigs; get defaults(): FexiosConfigs; set defaults(configs: FexiosConfigs); static readonly DEFAULT_CONFIGS: FexiosConfigs; protected hooks: FexiosHookStore[]; static readonly ALL_METHODS: FexiosMethods[]; static readonly METHODS_WITHOUT_BODY: FexiosMethods[]; constructor(baseConfigs?: Partial); private attachLegacyAliases; private finalizeContext; request(url: string | URL, options?: Partial): Promise>; request(options: Partial & { url: string | URL; }): Promise>; mergeQueries: (...incomes: Array | URLSearchParams | FormData | Map | ReadonlyMap | string | null | undefined>) => T; mergeHeaders: (...incomes: Array | Headers | Map | ReadonlyMap | null | undefined>) => Headers; private applyDefaults; private restoreNulls; emit(event: E, ctx: C$1, opts?: { shouldHandleShortCircuitResponse?: boolean; }): Promise; on(event: E, action: FexiosHook, prepend?: boolean): this; off(event: E, action: FexiosHook): this; off(event: '*' | null, action: FexiosHook): this; private createInterceptor; readonly interceptors: FexiosInterceptors; private createMethodShortcut; extends(configs: Partial): Fexios; readonly create: typeof Fexios.create; static create(configs?: Partial): Fexios; private _plugins; plugin(plugin: FexiosPlugin): Fexios; uninstall(plugin: FexiosPlugin | string): this; /** @deprecated Use `mergeQueries` instead */ readonly mergeQuery: (...incomes: Array | URLSearchParams | FormData | Map | ReadonlyMap | string | null | undefined>) => T; } interface Fexios { (url: string | URL, options?: Partial): Promise>; (options: Partial & { url: string | URL; }): Promise>; } interface Fexios { get: FexiosRequestShortcut<'get'>; post: FexiosRequestShortcut<'post'>; put: FexiosRequestShortcut<'put'>; patch: FexiosRequestShortcut<'patch'>; delete: FexiosRequestShortcut<'delete'>; head: FexiosRequestShortcut<'head'>; options: FexiosRequestShortcut<'options'>; trace: FexiosRequestShortcut<'trace'>; } /** * Fexios response wrapper class * @param data Transformed response body * @param responseType Guessed response type */ declare class FexiosResponse implements IFexiosResponse { readonly rawResponse: IFexiosResponse['rawResponse']; readonly data: T; readonly responseType: IFexiosResponse['responseType']; constructor(rawResponse: IFexiosResponse['rawResponse'], data: T, responseType: IFexiosResponse['responseType']); readonly ok: boolean; readonly status: number; readonly statusText: string; readonly headers: Headers; readonly url: string; readonly redirected: boolean; } /** * Resolve response body based on content type and expected type * @param expectedType `undefined` means auto-detect based on content-type header. And also try JSON.stringify if it's a string. */ declare function createFexiosResponse(rawResponse: Response, expectedType?: FexiosConfigs['responseType'], onProgress?: (progress: number, buffer?: Uint8Array) => void, shouldThrow?: (response: FexiosResponse) => boolean | void, timeout?: number): Promise>; /** * Type definitions for Fexios */ type AwaitAble$1 = Promise | T; type FetchLike = (input: Request | string | URL, init?: RequestInit) => Promise; interface FexiosConfigs { baseURL: string | URL; timeout: number; /** * Query parameters, its value can be: * - `null` - to remove the item * - `undefined` - to keep the item as is */ query: Record | URLSearchParams; headers: Record | Headers; credentials?: RequestInit['credentials']; cache?: RequestInit['cache']; mode?: RequestInit['mode']; /** * Whether to throw FexiosResponseError for non-OK response. * @default * ```ts * (response) => !response.ok * ``` */ shouldThrow?: (response: FexiosResponse) => boolean | void; /** * Fexios will try its best to transform request body. * * * ### `"json"` * - If body is text-like, it will be parsed as JSON first. If parsing fails, it will be sent as is. * - If body is FormData or URLSearchParams, see `FexiosQueryBuilder.toQueryRecord` for conversion details. * * ### `"text"` * - Body always be sent as text. * - Even if body is not text-like, it will be converted to string using `String(body)`. * * ### `"form"` * - If body is FormData or URLSearchParams, it will be sent as is. * - Other transformations is NOT supported YET. * * ### `"blob"` * - If body is ArrayBuffer or TypedArray, it will be converted to Blob. * - If body is text-like, it will be converted to Blob using UTF-8 encoding. * * ### `"arrayBuffer"` * - If body is Blob or TypedArray, it will be converted to ArrayBuffer. * - If body is text-like, it will be converted to ArrayBuffer using UTF-8 encoding. * * ### `undefined` * This means auto-detect based on content-type header. * - `application/json` -> JSON * - `text/plain` -> Try to parse as JSON, if fails, Text * - `text/*`, `application/text`, `application/xml`, `application/javascript` -> Text * - `multipart/form-data`, `application/x-www-form-urlencoded` -> Form * - `image/*`, `video/*`, `audio/*`, `application/pdf` -> Blob * - Others -> Try to detect if it's probably text data, if yes, Text, otherwise ArrayBuffer * - For unknown content-type, if content-length is 0, Text will be assumed. * - Note: WebSocket / SSE are NOT handled by core. Use plugins instead. * * If transformation fails, ArrayBuffer / stream / FormData will be sent as is. */ responseType?: 'json' | 'text' | 'form' | 'blob' | 'arrayBuffer'; fetch?: FetchLike; } interface FexiosRequestOptions extends Omit { url?: string | URL; method?: FexiosMethods; /** * Request headers, its value can be: * - `null` - to remove the header * - `undefined` - to keep the header as is */ headers: Record | Headers; /** * Request body */ body?: Record | string | FormData | URLSearchParams; /** * Custom environment variables, can be any value. * Useful for passing data between hooks. */ customEnv?: any; /** * AbortController for cancellation/timeout control. * @note * In v6, this will be moved to `ctx.runtime.abortController` in lifecycle hooks. */ abortController?: AbortController; /** * Progress callback for streaming responses. * @note * In v6, this will be moved to `ctx.runtime.onProgress` in lifecycle hooks. */ onProgress?: (progress: number, buffer?: Uint8Array) => void; } type FexiosRequestContext = Omit & { /** Request URL, may be relative before normalization */ url: string; /** * Built Request instance that will be sent (after hooks & normalization). * Available from `beforeActualFetch` and later. */ rawRequest?: Request; }; type FexiosRuntimeContext = { abortController?: AbortController; onProgress?: (progress: number, buffer?: Uint8Array) => void; /** * Custom environment variables, can be any value. * Useful for passing data between hooks and plugins. */ customEnv?: any; }; interface FexiosContext { /** * The current Fexios instance handling this request. * This is injected by core before any lifecycle hooks are executed. */ readonly app: Fexios; request: FexiosRequestContext; runtime: FexiosRuntimeContext; /** * Parsed response wrapper. * Available in `afterResponse` and in the final returned context. */ response?: FexiosResponse; /** * Raw response (may be the original Response before parsing). * Available from `afterRawResponse` and later. * @note * In final context, `ctx.rawResponse === ctx.response.rawResponse` (unread original Response). */ rawResponse?: Response; /** * --- Legacy aliases (v5) --- * They are kept for easier migration and will be removed in a future major. */ /** @deprecated Use `ctx.request.url` */ url: string; /** @deprecated Use `ctx.request.method` */ method?: FexiosMethods; /** @deprecated Use `ctx.request.headers` */ headers: FexiosRequestOptions['headers']; /** @deprecated Use `ctx.request.query` */ query: FexiosRequestOptions['query']; /** @deprecated Use `ctx.request.body` */ body?: FexiosRequestOptions['body']; /** @deprecated Use `ctx.runtime.abortController` */ abortController?: AbortController; /** @deprecated Use `ctx.runtime.onProgress` */ onProgress?: (progress: number, buffer?: Uint8Array) => void; /** @deprecated Use `ctx.runtime.customEnv` */ customEnv?: any; /** @deprecated Use `ctx.request.rawRequest` */ rawRequest?: Request; /** * Resolved response body (shortcut, usually only meaningful after response is ready) */ data?: T; } type FexiosFinalContext = Omit>, 'headers' | 'url' | 'responseType' | 'data' | 'rawRequest' | 'rawResponse'> & { /** Shortcut: response raw Request */ readonly rawRequest: Request; /** Shortcut: response raw Response (unread original Response) */ readonly rawResponse: Response; /** Response Headers */ readonly headers: Headers; /** * Resolved response body * @note * This is a read-only property, * if you want to completely replace the ctx.data, * you should return Response in `afterResponse` hook. */ readonly data: T; /** * Response type of data * If not set in request options, it will be guessed based on content-type header. * May be different from required responseType in request options. */ readonly responseType: NonNullable; /** Response URL */ readonly url: string; }; type FexiosHook = (context: C$1) => AwaitAble$1; interface FexiosHookStore { event: FexiosLifecycleEvents; action: FexiosHook; } type FexiosLifecycleEvents = keyof FexiosLifecycleEventMap; interface FexiosLifecycleEventMap { beforeInit: Omit; beforeRequest: Required>; afterBodyTransformed: Required>; beforeActualFetch: Required>; afterRawResponse: Required>; afterResponse: FexiosFinalContext; } interface FexiosInterceptor { handlers: () => FexiosHookHandler[]; use: (hook: FexiosHookHandler, prepend?: boolean) => any; clear: () => void; } interface FexiosInterceptors { request: FexiosInterceptor<'beforeRequest'>; response: FexiosInterceptor<'afterResponse'>; } type FexiosHookHandler = FexiosHook extends ((ctx: FexiosLifecycleEventMap[E]) => any) ? (ctx: FexiosLifecycleEventMap[E]) => any : never; type LowerAndUppercase = Lowercase | Uppercase; type FexiosMethods = LowerAndUppercase<'get' | 'post' | 'put' | 'patch' | 'delete' | 'head' | 'options' | 'trace'>; type MethodsWithoutBody = LowerAndUppercase<'get' | 'head' | 'options' | 'trace'>; type FexiosRequestShortcut = M$1 extends MethodsWithoutBody ? ShortcutWithoutBody : ShortcutWithBody; type ShortcutWithoutBody = (url: string | URL, options?: Partial) => Promise>; type ShortcutWithBody = (url: string | URL, body?: Record | string | URLSearchParams | FormData | null, options?: Partial) => Promise>; interface IFexiosResponse extends Pick { readonly rawResponse: Response; readonly data: T; readonly responseType: FexiosConfigs['responseType']; } type FexiosPlugin = { name: string; install: (fx: Fexios) => Fexios | void; uninstall?: (fx: Fexios) => void; }; //#endregion //#region ../../node_modules/.pnpm/fexios@6.1.1/node_modules/fexios/dist/models/index.d.mts /** * Error codes for Fexios */ declare enum FexiosErrorCodes { BODY_USED = "BODY_USED", NO_BODY_READER = "NO_BODY_READER", TIMEOUT = "TIMEOUT", NETWORK_ERROR = "NETWORK_ERROR", BODY_NOT_ALLOWED = "BODY_NOT_ALLOWED", HOOK_CONTEXT_CHANGED = "HOOK_CONTEXT_CHANGED", ABORTED_BY_HOOK = "ABORTED_BY_HOOK", INVALID_HOOK_CALLBACK = "INVALID_HOOK_CALLBACK", UNEXPECTED_HOOK_RETURN = "UNEXPECTED_HOOK_RETURN", UNSUPPORTED_RESPONSE_TYPE = "UNSUPPORTED_RESPONSE_TYPE", FEATURE_MOVED_TO_PLUGIN = "FEATURE_MOVED_TO_PLUGIN", BODY_TRANSFORM_ERROR = "BODY_TRANSFORM_ERROR", } /** * Base Fexios error class */ declare class FexiosError extends Error { readonly code: FexiosErrorCodes | string; readonly context?: FexiosContext; name: string; constructor(code: FexiosErrorCodes | string, message?: string, context?: FexiosContext, options?: ErrorOptions); static is(e: any, code?: FexiosErrorCodes): e is FexiosError; } /** * Fexios response error class for HTTP errors */ declare class FexiosResponseError extends FexiosError { readonly response: IFexiosResponse; name: string; constructor(message: string, response: IFexiosResponse, options?: ErrorOptions); static is(e: any): e is FexiosResponseError; } /** * Check if the error is a FexiosError that not caused by Response error * @deprecated Use FexiosError.is(e) instead */ declare const isFexiosError: (e: any) => boolean; /** * Static utility class for building and merging HTTP Headers * * Notes: * - Conversions are not guaranteed to be reversible. * - Header names are treated case-insensitively by the `Headers` interface. * - Only one-level object is considered when building from a record. */ declare namespace FexiosHeaderBuilder { /** * Build a Headers object from a plain record, a Map/ReadonlyMap, or an existing Headers. * * Rules: * - Only top-level keys are considered. * - Array values: append each element. * - Non-primitive values: use `toString()` even if it becomes "[object Object]". * - `undefined`/`null` values are ignored. * * @example * ```ts * makeHeaders({ 'x-foo': 'a', 'x-bar': ['b','c'], obj: { k: 1 } }) * // => Headers with: x-foo: "a"; x-bar: "b" (append) "c"; obj: "[object Object]" * ``` */ const makeHeaders: (input?: Record | Headers | Map | ReadonlyMap) => Headers; /** * Convert Headers into a plain record of string arrays. * * Notes: * - Returns `Record` (values are arrays). * - Multiple underlying header values may already be combined by the platform; * we do not attempt to split on commas. * * @example * ```ts * toHeaderRecord(new Headers({ 'x-foo': 'a' })) * // => { 'x-foo': ['a'] } * ``` */ const toHeaderRecord: (input: Headers | Map | ReadonlyMap) => Record; /** * Merge multiple header representations into a new Headers. * * Semantics: * - `undefined` => no change for that key. * - `null` => remove the key. * - Array value => remove the key first, then append each element. * - Other value => set/overwrite the key (single value). * * Sources can be `Headers`, plain objects, or Map/ReadonlyMap; processing order is left-to-right. * The returned `Headers` is a fresh instance; the original is not mutated. * * @example * ```ts * // Starting from existing headers * const base = new Headers({ 'x-a': '1', 'x-b': '2' }) * * // Object patch: overwrite x-b, append two values for x-c * const merged = mergeHeaders(base, { 'x-b': '3', 'x-c': ['v1','v2'] }) * * // Deletion via null * const merged2 = mergeHeaders(merged, { 'x-a': null }) * ``` */ const mergeHeaders: (...incomes: Array | Headers | Map | ReadonlyMap | null | undefined>) => Headers; } /** * Static utility class for building URL search parameters * * @example * { foo: 'bar', baz: ['qux', 'quux'] } // ?foo=bar&baz=qux&baz=quux * @example * { 'foo[]': 'bar', 'baz[]': ['qux', 'quux'] } // ?foo[]=bar&baz[]=qux&baz[]=quux */ declare namespace FexiosQueryBuilder { /** * Transform a plain object into a URL search params string. * * @example * ``` * makeSearchParams({ str: '123' }) // str=123 * makeSearchParams({ num: 123 }) // num=123 * makeSearchParams({ bool: true }) // bool=true * makeSearchParams({ arr: [1, 2, 3] }) // arr=1&arr=2&arr=3 * makeSearchParams({ plainObj: { a: 1, b: 2 } }) // plainObj[a]=1&plainObj[b]=2 * makeSearchParams({ deepObj: { a: { b: { c: 3 } } } }) // deepObj[a][b][c]=3 * makeSearchParams({ obj: }) // obj=.toString() (if object is not a primitive type) * makeSearchParams({ empty: '' }) // empty= * makeSearchParams({ null: null, undefined: undefined }) // (ignored) * ``` */ const makeSearchParams: (params?: Record | URLSearchParams) => URLSearchParams; /** * Build query string from a record object with proper array handling * @param query - The query object containing key-value pairs * @returns URL-encoded query string */ const makeQueryString: (query: Record) => string; /** * Create a URL object with the given parameters. * * @example * ``` * makeURL('https://example.com?existing=1', { foo: 'bar' }, 'baz') // https://example.com?existing=1&foo=bar#baz */ const makeURL: (url: string | URL, params?: Record, hash?: string, /** for SSR compatibility */ base?: string | URL) => URL; /** * Convert URLSearchParams back to a plain object * * @note numbers/booleans or special objects (e.g. Date) are not restored, all values are strings * * @example * ``` * // Basic key-value pairs * toQueryRecord(new URLSearchParams('foo=bar&baz=qux&number=123&bool=true')) * // -> { foo: 'bar', baz: 'qux', number: '123', bool: 'true' } * * // Repeated keys are converted to arrays * toQueryRecord(new URLSearchParams('foo=bar&foo=baz&single=value')) * // -> { foo: ['bar', 'baz'], single: 'value' } * * // Nested objects are reconstructed * toQueryRecord(new URLSearchParams('obj[foo]=bar&obj[baz]=qux&deep[dark][fantasy]=yes')) * // -> { obj: { foo: 'bar', baz: 'qux' }, deep: { dark: { fantasy: 'yes' } } } * * // Key with [] suffix always treated as array * toQueryRecord(new URLSearchParams('arr[]=only-one-value')) * // -> { 'arr[]': ['only-one-value'] } * ``` */ const toQueryRecord: >(input: string | URLSearchParams | FormData | Map | ReadonlyMap) => T; /** * Convert a string to a URLSearchParams object. * @param s - The string to convert. * @returns The URLSearchParams object. * @example * ``` * fromString('?a=1&b=2') // URLSearchParams { 'a' => '1', 'b' => '2' } * fromString('a=1&b=2') // URLSearchParams { 'a' => '1', 'b' => '2' } * fromString('https://x.com/path?a=1#hash') // URLSearchParams { 'a' => '1' } * ``` */ const fromString: (s: string) => URLSearchParams; /** * Merge multiple query representations into a single plain object. * * @note income `undefined` meaning no change, `null` meaning remove the key. * * @example * ``` * mergeQueries({ a: '1' }, { b: '2' }, { c: '3' }) // { a: '1', b: '2', c: '3' } * mergeQueries({ a: '1', b: '2' }, { b: '3', c: '4' }) // { a: '1', b: '3', c: '4' } * mergeQueries({ a: '1', b: '2' }, null, { c: '3' }) // { a: '1', b: '2', c: '3' } * mergeQueries({ a: '1', b: '2' }, { b: null }, { c: '3' }) // { a: '1', c: '3' } * mergeQueries(new URLSearchParams('a=1&b=2'), { b: '3', c: '4' }) // { a: '1', b: '3', c: '4' } * mergeQueries({ a: '1' }, new URLSearchParams('b=2&c=3')) // { a: '1', b: '2', c: '3' } */ const mergeQueries: (...incomes: Array | URLSearchParams | FormData | Map | ReadonlyMap | string | null | undefined>) => T; } //#endregion //#region ../../node_modules/.pnpm/fexios@6.1.1/node_modules/fexios/dist/utils/index.d.mts declare function clone(value: T): T; declare function deepMerge(obj: Partial, ...incomes: (Partial | null | undefined)[]): T; /** * Check if given payload is a plain object * "Plain object" means it is not an instance of any class or built-in type, * or just like Record in TypeScript. */ declare function isPlainObject(payload: any): payload is Record; //#endregion //#region ../../node_modules/.pnpm/fexios@6.1.1/node_modules/fexios/dist/index.d.mts /** * Fexios * @desc Fetch based HTTP client with similar API to axios for browser and Node.js * * @license MIT * @author dragon-fish */ declare const createFexios: typeof Fexios.create; declare const fexios: Fexios; //#endregion //#region ../../node_modules/.pnpm/wiki-saikou@7.5.0/node_modules/wiki-saikou/dist/WikiSaikou.d.mts interface FexiosSaikou extends Fexios { _tokens: Map; } /** * FexiosSaikou * * A pre-configured Fexios instance with MediaWiki-friendly defaults: * - MediaWiki-specific request/response params normalization * - built-in token management * - error handling * * @author dragon-fish * @license MIT * * @param {string|URL} payload create a new FexiosSaikou instance with the given baseURL * @param {Fexios} payload or make the given Fexios instance a FexiosSaikou instance */ declare function createFexiosSaikou(payload: string | URL | Fexios): FexiosSaikou; type MwApiParams = Record; type MwTokenName = 'createaccount' | 'csrf' | 'login' | 'patrol' | 'rollback' | 'userrights' | 'watch'; type MwApiResponse = T & { batchcomplete?: string; continue?: { [key: string]: string; continue: string; }; limits?: Record; error?: MwApiResponseError; errors?: MwApiResponseError[]; warnings?: Record; }; interface MwApiResponseError { code: string; text: string; module?: string; docref?: string; } /** * Error codes for WikiSaikouError */ declare enum WikiSaikouErrorCode { HTTP_ERROR = "HTTP_ERROR", LOGIN_FAILED = "LOGIN_FAILED", LOGIN_RETRY_LIMIT_EXCEEDED = "LOGIN_RETRY_LIMIT_EXCEEDED", TOKEN_RETRY_LIMIT_EXCEEDED = "TOKEN_RETRY_LIMIT_EXCEEDED", } /** * Server-side (MediaWiki API) business error: * - fetch succeeded but JSON includes `error` or `errors.length > 0` * - Special states (e.g., login NeedToken/WrongToken) are also considered API-side errors * Note: network/retry issues belong to WikiSaikouError, not this class */ declare class MediaWikiApiError extends Error { readonly errors: MwApiResponseError[]; readonly cause?: FexiosFinalContext; readonly name = "MediaWikiApiError"; readonly code: string; constructor(errors: MwApiResponseError[], cause?: FexiosFinalContext); get firstError(): MwApiResponseError; isBadTokenError(): boolean; toString(): string; static is(data?: any): data is MediaWikiApiError; static normalizeErrors(errors: MwApiResponseError[]): MwApiResponseError[]; } /** * WikiSaikou Error: * - Transport/network failures (e.g., fetch failure, HTTP layer issues) * - SDK behavioral errors such as exhausted internal retries or misconfigurations * Note: When MediaWiki API responds with JSON containing error/errors, a MediaWikiApiError should be thrown instead */ declare class WikiSaikouError extends Error { readonly code: WikiSaikouErrorCode; readonly message: string; readonly cause?: FexiosFinalContext; readonly name = "WikiSaikouError"; constructor(code: WikiSaikouErrorCode, message?: string, cause?: FexiosFinalContext); static is(data?: any, code?: WikiSaikouErrorCode): data is WikiSaikouError; } /** * Helper functions for WikiSaikouError and MediaWikiApiError */ declare namespace WikiSaikouError { function includesMediaWikiApiError(data?: any): boolean; const normalizeMwApiErrors: typeof MediaWikiApiError.normalizeErrors; function extractMediaWikiApiErrors(data?: any): MwApiResponseError[]; function isBadTokenError(data?: any): boolean; } declare namespace MwParamNormalizer { function normalizeParamValue(item: any): string | Blob | undefined; function normalizeBody(body: any): FormData | undefined; } interface WikiSaikouConfig { /** * @default undefined // required in Node.js environment * @default `${wgServer}${wgScriptPath}/api.php` // in MW pages * @description The MediaWiki API endpoint, e.g. "https://www.mediawiki.org/w/api.php" * @optional In real MediaWiki browser pages, `baseURL` can be omitted and will be inferred automatically based on `window.mw` */ baseURL: string; /** * Transport/runtime options passed to the underlying Fexios instance (headers, fetch, credentials, etc.). * @default { responseType: 'json' } */ fexiosConfigs: Partial; /** * Default query parameters merged into every request. * @default { action: 'query' } */ defaultParams: MwApiParams; /** * When true, responses whose JSON body contains `error`/`errors` will throw `MediaWikiApiError` even if HTTP status is 2xx. * @default false */ throwOnApiError: boolean; } type WikiSaikouInitConfig = Omit, 'baseURL'> & { baseURL: string; }; /** * WikiSaikou Core class * @internal You **SHOULD NOT** use this class directly, instead, use the `MediaWikiApi` class. * @author dragon-fish * @license MIT */ declare class WikiSaikouCore { readonly config: Required; readonly version: any; readonly request: FexiosSaikou; static INIT_DEFAULT_PARAMS: MwApiParams; static DEFAULT_CONFIGS: Required; /** @deprecated Use `new MediaWikiApi(config)` instead */ constructor(baseURL?: string, defaultOptions?: Partial, defaultParams?: MwApiParams); constructor(config?: WikiSaikouInitConfig); setBaseURL(baseURL: string): this; /** Base methods encapsulation */ get(query: MwApiParams, options?: Partial): Promise>>; post(data: MwApiParams | URLSearchParams | FormData, options?: Partial): Promise>>; /** * Wrap a request to map non-2xx responses containing MediaWiki API error bodies * into MediaWikiApiError when throwOnApiError=true, and then pass 2xx responses * through handleApiResponse for unified processing. */ private runRequestWithApiErrorMapping; private throwIfApiError; private handleApiResponse; /** Token Handler */ get tokens(): Map; fetchTokens(types?: MwTokenName[]): Promise>; getToken(type?: MwTokenName, noCache?: boolean): Promise; badToken(type: MwTokenName): Map; postWithToken(tokenType: MwTokenName, body: MwApiParams, options?: { tokenName?: string; retry?: number; noCache?: boolean; fexiosOptions?: Partial; }): Promise>>; postWithEditToken(body: MwApiParams): Promise>>; /** @deprecated Use `this.config.baseURL` instead */ get baseURL(): string; /** @deprecated Use `this.config.defaultParams` instead */ get defaultParams(): MwApiParams; /** @deprecated Use `this.config.fexiosConfigs` instead */ get defaultOptions(): Partial; /** @deprecated Use `createFexiosSaikou` instead */ static readonly createRequestHandler: typeof createFexiosSaikou; /** @deprecated Use `this.getToken` instead */ token: (type?: MwTokenName, noCache?: boolean) => Promise; } //#endregion //#region ../../node_modules/.pnpm/fexios@6.1.1/node_modules/fexios/dist/plugins/index.d.mts /** * Cookie object interface */ interface CookieJarItem { name: string; value: string; domain?: string; path?: string; expires?: Date; maxAge?: number; secure?: boolean; httpOnly?: boolean; sameSite?: 'Strict' | 'Lax' | 'None'; _createdAt?: Date; _hostOnly?: boolean; } /** * Cookie Jar * * @author dragon-fish * @license MIT */ declare class CookieJar { private cookies; /** * Set a cookie */ setCookie(cookie: CookieJarItem, domain?: string, path?: string): void; /** * Get a cookie */ getCookie(name: string, domain?: string, path?: string): CookieJarItem | undefined; /** * Get all matching cookies */ getCookies(domain?: string, path?: string): CookieJarItem[]; /** * Delete a cookie */ deleteCookie(name: string, domain?: string, path?: string): boolean; /** * Clear all cookies */ clear(): void; /** * Clean expired cookies */ cleanExpiredCookies(): number; /** * Get all cookies (including expired ones) */ getAllCookies(domain?: string, path?: string): CookieJarItem[]; /** * Parse cookies from Set-Cookie header */ parseSetCookieHeader(setCookieHeader: string, domain?: string, path?: string): void; /** * Generate Cookie header string */ getCookieHeader(domain?: string, path?: string): string; /** * Get the unique key for a cookie */ private getCookieKey; /** * Check if cookie matches the given domain and path */ private isCookieMatch; /** * Check if domain matches */ private isDomainMatch; /** * Check if path matches */ private isPathMatch; /** * Check if cookie is expired */ private isCookieExpired; /** * Parse cookie string */ private parseCookieString; /** * Safely split a possibly-combined Set-Cookie header string into individual cookie strings. * Split on commas that are followed by the start of a new cookie-pair (name=), * avoiding commas inside Expires attribute values. */ private splitSetCookieHeader; } declare module 'fexios' { interface Fexios { cookieJar?: CookieJar; } } type FexiosPostFormInput = FormData | HTMLFormElement; type FexiosPostFormRecord = Record; type FexiosPostFormAnyInput = FexiosPostFormInput | FexiosPostFormRecord; declare module 'fexios' { interface Fexios { /** * Post a form with a simpler API. * * - Accepts `FormData` directly. * - In browsers, also accepts `HTMLFormElement` and converts it via `new FormData(form)`. */ postForm: (url: string | URL, form: FexiosPostFormAnyInput, options?: Partial) => Promise>; } } type FexiosSSEOptions = { /** * Query params to append/merge into url */ query?: Record | URLSearchParams; /** * Connect timeout (ms) * @default app.baseConfigs.timeout ?? 60000 */ timeout?: number; }; type FexiosSSEContext = { url: string; timeout: number; eventSource?: EventSource; }; declare module 'fexios' { interface Fexios { /** * Connect SSE (EventSource) (moved out of core). * Resolves after the connection is opened. */ sse: (url: string | URL, options?: FexiosSSEOptions) => Promise; } } declare module 'fexios/types' { interface FexiosLifecycleEventMap { 'sse:beforeConnect': FexiosSSEContext; 'sse:open': FexiosSSEContext & { event: Event; }; 'sse:message': FexiosSSEContext & { event: MessageEvent; }; 'sse:error': FexiosSSEContext & { event: Event; }; 'sse:close': FexiosSSEContext; } } type FexiosWebSocketOptions = { /** * WebSocket sub-protocols * @see https://developer.mozilla.org/en-US/docs/Web/API/WebSocket/WebSocket */ protocols?: string | string[]; /** * Query params to append/merge into url */ query?: Record | URLSearchParams; /** * Connect timeout (ms) * @default app.baseConfigs.timeout ?? 60000 */ timeout?: number; }; type FexiosWebSocketContext = { url: string; protocols?: string | string[]; timeout: number; socket?: WebSocket; }; declare module 'fexios' { interface Fexios { /** * Connect a WebSocket (moved out of core). * Resolves after the socket is opened. */ ws: (url: string | URL, options?: FexiosWebSocketOptions) => Promise; } } declare module 'fexios/types' { interface FexiosLifecycleEventMap { 'websocket:beforeConnect': FexiosWebSocketContext; 'websocket:open': FexiosWebSocketContext; 'websocket:message': FexiosWebSocketContext & { event: MessageEvent; }; 'websocket:error': FexiosWebSocketContext & { event: Event; }; 'websocket:close': FexiosWebSocketContext & { event: CloseEvent; }; } } //#endregion //#region src/types/WikiMetadata.d.ts interface WikiSiteInfo { general: WikiSiteGeneralInfo; specialpagealiases: WikiSpecialPageAlias[]; namespacealiases: WikiNameSpaceAlias[]; magicwords: WikiMagicWord[]; namespaces: Record; repos: WikiFileRepo[]; } interface WikiSiteGeneralInfo { mainpage: string; base: string; sitename: string; mainpageisdomainroot: boolean; logo: string; generator: string; phpversion: string; phpsapi: string; dbtype: string; dbversion: string; imagewhitelistenabled: boolean; langconversion: boolean; titleconversion: boolean; linkprefixcharset: string; linkprefix: string; linktrail: string; legaltitlechars: string; invalidusernamechars: string; allunicodefixes: boolean; fixarabicunicode: boolean; fixmalayalamunicode: boolean; 'git-hash'?: string; 'git-branch'?: string; case: 'first-letter' | string; lang: string; fallback?: { code: string; }[]; variants: { code: string; name: string; }[]; rtl: boolean; fallback8bitEncoding: string; readonly: boolean; writeapi: boolean; maxarticlesize: number; timezone: string; timeoffset: number; articlepath: string; scriptpath: string; script: string; variantarticlepath: string | false; server: string; servername: string; wikiid: string; time: string; misermode: boolean; uploadsenabled: boolean; maxuploadsize: number; minuploadchunksize: number; galleryoptions: { imagesPerRow: number; imageWidth: number; imageHeight: number; captionLength: boolean; showBytes: boolean; showDimensions: boolean; mode: 'traditional' | string; }; thumblimits: Record<`${number}`, number>; imagelimits: Record<`${number}`, { width: number; height: number; }>; favicon: string; centralidlookupprovider: string; allcentralidlookupproviders: string[]; interwikimagic: boolean; magiclinks: Record; categorycollation: 'uppercase' | string; citeresponsivereferences: boolean; } interface WikiSpecialPageAlias { realname: string; aliases: string[]; } interface WikiNameSpaceAlias { id: number; alias: string; } interface WikiNamespace { canonical?: string; case: 'first-letter' | string; content: boolean; id: number; name: string; namespaceprotection?: string; nonincludable: boolean; subpages: boolean; } interface WikiMagicWord { name: string; aliases: string[]; 'case-sensitive': boolean; } interface WikiUserInfo extends Partial { id: number; name: string; groups: string[]; rights: string[]; options: WikiUserOptions; } interface WikiUserBlockInfo { blockid: number; blockedby: string; blockedbyid: string; blockreason: string; blockedtimestamp: string; blockexpiry: string; } type IntBool = 0 | 1; interface WikiUserOptions { minordefault: IntBool; watchcreations: IntBool; watchdefault: IntBool; watchdeletion: IntBool; watchuploads: IntBool; watchmoves: IntBool; language: string; [key: string]: unknown; } interface WikiFileRepo { name: string; displayname: string; rootUrl: string; local: boolean; url: string; thumbUrl: string; initialCapital: boolean; scriptDirUrl: string; canUpload: boolean; } //#endregion //#region ../../node_modules/.pnpm/wiki-saikou@7.5.0/node_modules/wiki-saikou/dist/browser.d.mts interface ClientLoginOptions extends MwApiParams { rememberMe?: boolean; loginmessageformat?: string; loginreturnurl?: string; logincontinue?: boolean; } type ClientLoginResult = { status: 'PASS'; username: string; } | { status: 'FAIL'; username: never; message: string; messagecode: string; canpreservestate: boolean; }; /** * WikiSaikou * @description Standalone MediaWiki API SDK with `mw.Api`-like API in any environments * @author Dragon-Fish * @license MIT */ declare class MediaWikiApi extends WikiSaikouCore { clientLogin(username: string, password: string, params?: ClientLoginOptions): Promise; } /** * WikiSaikou for foreign wiki * @description Standalone MediaWiki API SDK with `mw.Api`-like API in any environments * @author Dragon-Fish * @license MIT */ declare class MediaWikiForeignApi extends MediaWikiApi { /** @deprecated Use `new MediaWikiForeignApi(config)` instead */ constructor(baseURL?: string, defaultOptions?: Partial, defaultParams?: MwApiParams); constructor(config?: WikiSaikouInitConfig); } //#endregion //#region src/services/ApiService.d.ts // ↓ '@/InPageEdit' declare module '.' { interface InPageEdit { api: MediaWikiApi; apiService: ApiService; } } interface ApiServiceOptions extends Partial {} declare class ApiService { ctx: InPageEdit; private options; api: MediaWikiApi; constructor(ctx: InPageEdit, options?: Partial); private _apiClients; getClientByFileRepo(repo: WikiFileRepo): MediaWikiApi; } //#endregion //#region src/models/WikiTitle/index.d.ts interface IWikiTitle { /** * Get db key without namespace prefix * e.g. "template:hello world" -> "Hello_world" */ getMainDBKey(): string; /** * Get page name without namespace prefix * e.g. "template:hello world" -> "Hello world" */ getMainText(): string; /** * Get db key with namespace prefix * e.g. "template:hello world" -> "Template:Hello_world" */ getPrefixedDBKey(): string; /** * Get page name with namespace prefix * e.g. "template:hello world" -> "Template:Hello world" */ getPrefixedText(): string; toText: () => string; toString: () => string; /** * Get namespace ID * e.g. "template:hello world" -> 10 */ getNamespaceId(): number; /** * Get namespace text * e.g. "template:hello world" -> "Template" */ getNamespaceText(): string; /** * Get namespace db key * e.g. "template talk:hello world" -> "Template_talk" */ getNamespaceDBKey(): string; /** * Get subject page * If current page is subject page, return itself * e.g. "template talk:hello world" -> new WikiTitle("Template:Hello world") */ getSubjectPage(): IWikiTitle; /** * Get talk page * If current page is talk page, return itself * If current page cannot have talk page, return null * e.g. "template:hello world" -> new WikiTitle("Template talk:Hello world") */ getTalkPage(): IWikiTitle | null; /** * Get URL of the page * e.g. "template:hello world" -> "https://example.com/wiki/Template:Hello_world" */ getURL(params?: Record | URLSearchParams): URL; /** * Reset current title with given title string */ setTitle(title: string): IWikiTitle; /** * Set main title, keep current ns, update dbkey */ setMainText(mainTitle: string): IWikiTitle; /** * Set namespace by text */ setNamespaceText(namespaceText: string): IWikiTitle; /** * Set namespace by ID */ setNamespaceId(namespaceId: number): IWikiTitle; /** * Check if the title is equal to another title */ equals(other: IWikiTitle | string): boolean; /** * Check if the title is specific special page * e.g. "Special:Diff" is "差异" or "diff" -> true */ isSpecial(alia: string): boolean; newTitle(title: string, namespace?: number): IWikiTitle; } interface WikiTitleConstructor { new (title: string, namespace?: number): IWikiTitle; create(title: string, namespace?: number): IWikiTitle; } declare function createWikiTitleModel(metadata: WikiSiteInfo): WikiTitleConstructor; //#endregion //#region src/services/CurrentPageService.d.ts // ↓ '@/InPageEdit.js' declare module '.' { interface InPageEdit { /** * Basic information of the current web page */ currentPage: CurrentPageService; } interface Events { 'current-page/popstate'(): void; 'current-page/resolve-title'(title: IWikiTitle | null): IWikiTitle | void; 'current-page/resolve-action'(action: string): string | void; 'current-page/resolve-main-page'(isMainPage: boolean): boolean | void; } } declare class CurrentPageService extends Service { #private; readonly ctx: InPageEdit; constructor(ctx: InPageEdit); private get logger(); static readonly HISTORY_CHANGE_EVENT = "inpageedit:historychange"; static readonly POPSTATE_INJECTION_KEY: symbol; protected start(): Promise; protected stop(): void | Promise; url: URL; get params(): URLSearchParams; get canonicalUrl(): URL | null; readonly isMainPage: boolean; /** * Get the title of the current page by location URL * @returns IWikiTitle or null if cannot be determined */ wikiTitle: IWikiTitle | null; get wikiAction(): string | boolean | Promise; } //#endregion //#region src/services/ResourceLoaderService.d.ts // ↓ '@/InPageEdit' declare module '.' { interface InPageEdit { resourceLoader: ResourceLoaderService; } } declare class ResourceLoaderService extends Service { ctx: InPageEdit; constructor(ctx: InPageEdit); protected stop(): void | Promise; loadScript(src: string, attrs?: Record): Promise; loadStyle(href: string, attrs?: Record): Promise; removeStyle(href: string): void; removeScript(src: string): void; removeAll(): void; resolveImportPath(path: string): string; } //#endregion //#region ../../node_modules/.pnpm/csstype@3.1.3/node_modules/csstype/index.d.ts interface StandardLonghandProperties { /** * The **`accent-color`** CSS property sets the accent color for user-interface controls generated by some elements. * * **Syntax**: `auto | ` * * **Initial value**: `auto` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :------: | :--: | :-: | * | **93** | **92** | **15.4** | n/a | No | * * @see https://developer.mozilla.org/docs/Web/CSS/accent-color */ accentColor?: Property.AccentColor | undefined; /** * The CSS **`align-content`** property sets the distribution of space between and around content items along a flexbox's cross-axis or a grid's block axis. * * **Syntax**: `normal | | | ? ` * * **Initial value**: `normal` * * | Chrome | Firefox | Safari | Edge | IE | * | :------: | :-----: | :-----: | :----: | :----: | * | **29** | **28** | **9** | **12** | **11** | * | 21 _-x-_ | | 7 _-x-_ | | | * * @see https://developer.mozilla.org/docs/Web/CSS/align-content */ alignContent?: Property.AlignContent | undefined; /** * The CSS **`align-items`** property sets the `align-self` value on all direct children as a group. In Flexbox, it controls the alignment of items on the Cross Axis. In Grid Layout, it controls the alignment of items on the Block Axis within their grid area. * * **Syntax**: `normal | stretch | | [ ? ]` * * **Initial value**: `normal` * * | Chrome | Firefox | Safari | Edge | IE | * | :------: | :-----: | :-----: | :----: | :----: | * | **29** | **20** | **9** | **12** | **11** | * | 21 _-x-_ | | 7 _-x-_ | | | * * @see https://developer.mozilla.org/docs/Web/CSS/align-items */ alignItems?: Property.AlignItems | undefined; /** * The **`align-self`** CSS property overrides a grid or flex item's `align-items` value. In Grid, it aligns the item inside the grid area. In Flexbox, it aligns the item on the cross axis. * * **Syntax**: `auto | normal | stretch | | ? ` * * **Initial value**: `auto` * * | Chrome | Firefox | Safari | Edge | IE | * | :------: | :-----: | :-----: | :----: | :----: | * | **29** | **20** | **9** | **12** | **10** | * | 21 _-x-_ | | 7 _-x-_ | | | * * @see https://developer.mozilla.org/docs/Web/CSS/align-self */ alignSelf?: Property.AlignSelf | undefined; /** * The **`align-tracks`** CSS property sets the alignment in the masonry axis for grid containers that have masonry in their block axis. * * **Syntax**: `[ normal | | | ? ]#` * * **Initial value**: `normal` * * | Chrome | Firefox | Safari | Edge | IE | * | :----: | :-----: | :----: | :--: | :-: | * | No | n/a | No | n/a | No | * * @see https://developer.mozilla.org/docs/Web/CSS/align-tracks */ alignTracks?: Property.AlignTracks | undefined; /** * The **`animation-composition`** CSS property specifies the composite operation to use when multiple animations affect the same property simultaneously. * * **Syntax**: `#` * * **Initial value**: `replace` * * | Chrome | Firefox | Safari | Edge | IE | * | :-----: | :-----: | :----: | :--: | :-: | * | **112** | **115** | **16** | n/a | No | * * @see https://developer.mozilla.org/docs/Web/CSS/animation-composition */ animationComposition?: Property.AnimationComposition | undefined; /** * The **`animation-delay`** CSS property specifies the amount of time to wait from applying the animation to an element before beginning to perform the animation. The animation can start later, immediately from its beginning, or immediately and partway through the animation. * * **Syntax**: `