import { ComponentOptionsMixin } from 'vue';
import { ComponentProvideOptions } from 'vue';
import { DefineComponent } from 'vue';
import { PublicProps } from 'vue';

declare const __VLS_component: DefineComponent<SelectionCommentProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<SelectionCommentProps> & Readonly<{}>, {
webhookUrl: string;
dev: boolean;
page: string;
locale: string;
source: string;
appName: string;
appKey: string;
merchant: string;
}, {}, {}, {}, string, ComponentProvideOptions, false, {
root: HTMLDivElement;
}, HTMLDivElement>;

declare const __VLS_component_2: DefineComponent<MarkdownPreviewProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
rendered: (sections: HeadingSection[]) => any;
}, string, PublicProps, Readonly<MarkdownPreviewProps> & Readonly<{
onRendered?: ((sections: HeadingSection[]) => any) | undefined;
}>, {
locale: string;
}, {}, {}, {}, string, ComponentProvideOptions, false, {
contentRef: HTMLDivElement;
}, HTMLDivElement>;

declare function __VLS_template(): {
    attrs: Partial<{}>;
    slots: {
        default?(_: {}): any;
    };
    refs: {
        root: HTMLDivElement;
    };
    rootEl: HTMLDivElement;
};

declare function __VLS_template_2(): {
    attrs: Partial<{}>;
    slots: Readonly<{
        /** 可选的代码块渲染插槽；宿主可在这里接入 mermaid/markmap 等专用组件。 */
        code?: (props: {
            code: string;
            language: string;
            locale: string;
        }) => unknown;
    }> & {
        /** 可选的代码块渲染插槽；宿主可在这里接入 mermaid/markmap 等专用组件。 */
        code?: (props: {
            code: string;
            language: string;
            locale: string;
        }) => unknown;
    };
    refs: {
        contentRef: HTMLDivElement;
    };
    rootEl: HTMLDivElement;
};

declare type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;

declare type __VLS_TemplateResult_2 = ReturnType<typeof __VLS_template_2>;

declare type __VLS_WithTemplateSlots<T, S> = T & {
    new (): {
        $slots: S;
    };
};

declare type __VLS_WithTemplateSlots_2<T, S> = T & {
    new (): {
        $slots: S;
    };
};

export declare function buildFeedbackPayload(input: FeedbackInput, now?: Date): FeedbackPayload;

/** 公共代码主题使用的 token 分组，供可编辑文本范围与预览 HTML 共用。 */
export declare const CODE_HIGHLIGHT_CLASSES: {
    readonly comment: readonly ["hljs-comment", "hljs-quote"];
    readonly keyword: readonly ["hljs-keyword", "hljs-doctag", "hljs-selector-tag"];
    readonly attr: readonly ["hljs-attr", "hljs-attribute"];
    readonly string: readonly ["hljs-string", "hljs-regexp", "hljs-template-tag"];
    readonly number: readonly ["hljs-number"];
    readonly literal: readonly ["hljs-literal", "hljs-symbol", "hljs-bullet"];
    readonly title: readonly ["hljs-title", "hljs-section", "hljs-selector-id", "hljs-selector-class"];
    readonly punctuation: readonly ["hljs-punctuation"];
    readonly variable: readonly ["hljs-variable", "hljs-template-variable"];
    readonly builtin: readonly ["hljs-built_in", "hljs-type"];
    readonly tag: readonly ["hljs-name", "hljs-tag"];
    readonly meta: readonly ["hljs-meta"];
    readonly plain: readonly ["hljs-subst"];
};

export declare const CodePreview: DefineComponent<CodePreviewProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<CodePreviewProps> & Readonly<{}>, {
title: string;
locale: string;
language: string;
}, {}, {}, {}, string, ComponentProvideOptions, false, {}, HTMLDivElement>;

export declare interface CodePreviewProps {
    code: string;
    title?: string;
    /** 支持常见请求代码语言；为空或未注册时自动探测。 */
    language?: string;
    locale?: string;
}

/** 未传入地址时写入的飞书多维表格。各项目仍可用 webhookUrl 覆盖。 */
export declare const DEFAULT_FEEDBACK_WEBHOOK = "https://bytedance.larkoffice.com/base/workflow/webhook/event/D9h2a3gAkwESDohg6xKcqhq7nZe";

/**
 * 问题反馈直达飞书多维表格，不经过业务后端。
 *
 * 表格里建一条「接收到 webhook 时」的自动化：下一步「新增记录」，把下面 JSON 字段映射到列。
 * 不要开 IP 白名单，也不要开 Bearer 校验——浏览器跨域预检过不了，带这些校验请求发不出去。
 * 地址由各项目通过 webhookUrl 传入，会出现在该项目的前端产物里，只能用来新增一行。
 *
 * 示例请求体（自动化「输出设置 → 手动设置」可直接粘贴）：
 * {"score":5,"scoreLabel":"很好","category":"experience","categoryLabel":"体验问题","content":"示例","contact":"","source":"控制台","kind":"反馈","quote":"","page":"/apps/profile","appName":"示例应用","appKey":"ak_example","merchant":"示例企业","locale":"zh-CN","submittedAt":"2026-10-27 14:29:00","userAgent":"Mozilla/5.0"}
 */
export declare type FeedbackCategory = 'experience' | 'suggestion' | 'other';

export declare class FeedbackChannelError extends Error {
    constructor();
}

export declare interface FeedbackInput {
    score: number;
    category: FeedbackCategory;
    content: string;
    contact: string;
    /** 提交来自哪个站点，固定中文，例如「控制台」「文档中心」 */
    source: string;
    page: string;
    appName: string;
    appKey: string;
    merchant: string;
    locale: string;
    /** 记录类型。右下角反馈为「反馈」，划线评论为「划线评论」。 */
    kind?: string;
    /** 划线选中的原文。普通反馈为空。 */
    quote?: string;
}

export declare interface FeedbackPayload {
    score: number;
    /** 固定中文，方便表格里直接分组，不随界面语言变化 */
    scoreLabel: string;
    category: FeedbackCategory;
    categoryLabel: string;
    content: string;
    contact: string;
    /** 固定中文，方便表格里直接筛选站点 */
    source: string;
    page: string;
    appName: string;
    appKey: string;
    merchant: string;
    locale: string;
    kind: string;
    quote: string;
    /** 北京时间，文本列可直接读 */
    submittedAt: string;
    userAgent: string;
}

export declare const FeedbackWidget: DefineComponent<FeedbackWidgetProps, {}, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly<FeedbackWidgetProps> & Readonly<{}>, {
webhookUrl: string;
dev: boolean;
page: string;
locale: string;
source: string;
appName: string;
appKey: string;
merchant: string;
}, {}, {}, {}, string, ComponentProvideOptions, false, {
root: HTMLDivElement;
entryRef: HTMLButtonElement;
}, any>;

export declare interface FeedbackWidgetProps {
    /** 飞书多维表格 webhook。只接受 https 的飞书 / Lark 域名。 */
    webhookUrl?: string;
    /** 为 true 时，即使还没配 webhook 也展示入口，方便本地看样式。 */
    dev?: boolean;
    /** 当前页面路径。不传则提交时使用浏览器地址。 */
    page?: string;
    /** `zh-CN` 或 `en` / `en-US`。其它值按中文显示。 */
    locale?: string;
    /** 站点来源，写入飞书。控制台传「控制台」，文档中心传「文档中心」。 */
    source?: string;
    appName?: string;
    appKey?: string;
    merchant?: string;
}

export declare function formatFeedbackTime(date: Date): string;

export declare interface HeadingSection {
    id: string;
    label: string;
    level: number;
}

/**
 * 对代码进行安全高亮。语言为空或未注册时使用 highlightAuto，失败则返回空串，
 * 由组件用 Vue 插值安全展示原文。
 */
export declare function highlightCode(code: string, language?: string): string;

/** 只接受飞书 / Lark 的 https 地址，避免把企业名和页面路径发到任意域名。 */
export declare function isFeishuWebhook(url: string): boolean;

export declare const MarkdownPreview: __VLS_WithTemplateSlots_2<typeof __VLS_component_2, __VLS_TemplateResult_2["slots"]>;

export declare interface MarkdownPreviewProps extends MarkdownRenderOptions {
    markdown: string;
    /** `zh-CN` 或 `en` / `en-US`；其它值按中文显示。 */
    locale?: string;
}

export declare interface MarkdownRenderOptions {
    /** 相对资源 key 的解析方式；返回的地址仍会经过安全校验。 */
    resolveAssetUrl?: (src: string) => string;
    /** 同步解析链接；返回 null/undefined 表示无法定位，显示为失效引用。 */
    resolveLink?: (href: string) => string | null | undefined;
    /** 标题 id 前缀。渲染函数默认不加前缀，组件默认使用独立实例前缀。 */
    idPrefix?: string;
}

export declare interface MarkdownRenderResult {
    /** 已消毒的 HTML；正文组件会继续增强代码块和表格。 */
    html: string;
    /** H1/H2 的目录数据；H3–H6 也生成锚点，但不进入目录。 */
    sections: HeadingSection[];
}

/**
 * text/plain 属于浏览器的简单请求，不会先发 OPTIONS。
 * 飞书不回 Access-Control-Allow-Origin，带 application/json 会被预检拦住。
 * no-cors 读不到响应体，请求发出即视为已提交。
 */
export declare function postFeedback(input: FeedbackInput, webhookUrl: string, now?: Date): Promise<void>;

/** 浏览器端同步渲染。每次使用独立解析器和消毒器，不修改宿主的全局实例。 */
export declare function renderMarkdown(markdown: string, options?: MarkdownRenderOptions): MarkdownRenderResult;

export declare const SelectionComment: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;

export declare interface SelectionCommentProps {
    /** 飞书多维表格 webhook。只接受 https 的飞书 / Lark 域名。 */
    webhookUrl?: string;
    /** 为 true 时，即使还没配 webhook 也响应划线，方便本地看样式。 */
    dev?: boolean;
    /** 当前页面路径。不传则提交时使用浏览器地址。 */
    page?: string;
    /** `zh-CN` 或 `en` / `en-US`。其它值按中文显示。 */
    locale?: string;
    /** 站点来源，写入飞书。文档中心传「文档中心」。 */
    source?: string;
    appName?: string;
    appKey?: string;
    merchant?: string;
}

/** 本地始终展示入口，方便看样式；生产环境没配好地址就不出现，避免点了提交失败。 */
export declare function showFeedbackEntry(isDev: boolean, webhookUrl: string): boolean;

export { }
