import type { Config } from '../base'; import type { Token } from '../internal'; export interface TitleOptions { temporary?: boolean | undefined; decode?: boolean | undefined; selfLink?: boolean | undefined; halfParsed?: boolean | undefined; page?: string | undefined; nowiki?: boolean; } /** * title object of a MediaWiki page * * MediaWiki页面标题对象 */ export declare class Title { #private; readonly valid: boolean; /** namespace number / 命名空间 */ get ns(): number; /** 片段标识符 */ get fragment(): string | undefined; /** main part without the namespace / 不含命名空间的标题主体部分 */ get main(): string; set main(title: string); /** namespace prefix / 命名空间前缀 */ get prefix(): string; /** full title / 完整标题 */ get title(): string; /** * file extension * * 扩展名 * @since v1.1.0 */ get extension(): string | undefined; /** * @see MediaWikiTitleCodec::splitTitleString * * @param title 标题(含或不含命名空间前缀) * @param defaultNs 命名空间 * @param config * @param opt 选项 * @param opt.temporary 是否是临时标题 * @param opt.decode 是否需要解码 * @param opt.selfLink 是否允许selfLink * @param opt.page 当前页面标题 * @param opt.nowiki 是否剥离nowiki标签 */ constructor(title: string, defaultNs: number, config: Config, { temporary, decode, selfLink, page, nowiki }?: TitleOptions, accum?: Token[]); /** * Check if the title is a redirect and get the redirect target * * 检测是否是重定向并获取重定向目标 * @since v1.12.2 */ getRedirection(): [boolean, string]; /** * Get the URL of the title * * 生成URL * @param articlePath article path / 条目路径 * @since v1.10.0 */ getUrl(articlePath?: string): string; }