import { default as default_2 } from 'react'; import { Endpoints } from '@octokit/types'; declare type Comment_2 = Pick & { user: Pick, "avatar_url" | "login" | "html_url">; reactions: Reactions; }; declare type CommentDefine = Endpoints["GET /repos/{owner}/{repo}/issues/{issue_number}/comments"]["response"]["data"][number]; declare const Gitalk: default_2.FC; export { Gitalk } export default Gitalk; export declare interface GitalkProps extends Omit, HTMLDivElement>, "id" | "title"> { /** * GitHub Application Client ID. */ clientID: string; /** * GitHub Application Client Secret. * When provided, exchange credentials through the selected CORS proxy. * Exposed in browser code; omit it to use a server-side `proxy`. */ clientSecret?: string; /** * GitHub repository owner. * Can be personal user or organization. */ owner: string; /** * Name of Github repository. */ repo: string; /** * GitHub repository owner and collaborators. * (Users who having write access to this repository) */ admin: string[]; /** * The unique id of the page. * Length must less than 50. * * @default location.host + location.pathname */ id?: string; /** * The issue ID of the page. * If the number attribute is not defined, issue will be located using id. */ number?: number; /** * GitHub issue labels. * * @default ['Gitalk'] */ labels?: string[]; /** * GitHub issue title. * * @default document.title */ title?: string; /** * GitHub issue body. * * @default location.href + header.meta[description] */ body?: string; /** * BCP 47 language tag. Regional tags use the available base translation; * Chinese tags preserve simplified/traditional script differences. * * @default navigator.language */ language?: string; /** * Pagination size, with maximum 100. * * @default 10 */ perPage?: number; /** * Comment sorting direction. * Available values are `last` and `first`. * * @default "last" */ pagerDirection?: "last" | "first"; /** * By default, Gitalk will create a corresponding github issue for your every single page automatically when the logined user is belong to the admin users. * You can create it manually by setting this option to true. * * @default false */ createIssueManually?: boolean; /** * Enable hot key (cmd|ctrl + enter) submit comment. * * @default true */ enableHotKey?: boolean; /** * Facebook-like distraction free mode. * * @default false */ distractionFreeMode?: boolean; /** * With `clientSecret`: optional CORS relay, defaulting to `https://cors-anywhere.azm.workers.dev/https://github.com/login/oauth/access_token`. * Without `clientSecret`: required server-side OAuth exchange endpoint. * Server-side mode receives GET requests with only `code` and returns * `{ access_token: string }`; credentials stay on the server. */ proxy?: string; /** * Default user field if comments' author is not provided * * @default * ```ts * { * avatar_url: "//avatars1.githubusercontent.com/u/29697133?s=50", * login: "null", * html_url: "" * } */ defaultUser?: Comment_2["user"]; /** * Default user field if comments' author is not provided * * @deprecated use `defaultUser` */ defaultAuthor?: { avatarUrl: Comment_2["user"]["avatar_url"]; login: Comment_2["user"]["login"]; url: Comment_2["user"]["html_url"]; }; /** * Default collapse the comment if meets the height (px) */ collapsedHeight?: number; /** * Whether to highlight the comment created by admin users. * * @default true */ highlightAdminComment?: boolean; /** * Whether to show the administrator label on comments by admin users. * * @default true */ showAdminLabel?: boolean; /** * Callback method invoked when updating the number of comments. * * @param count comments number */ updateCountCallback?: (count: number) => void; /** * Callback method invoked when a new issue is successfully created. * * @param issue created issue */ onCreateIssue?: (issue: Issue) => void; /** * Callback method invoked when a new comment is successfully created. * * @param comment created comment */ onCreateComment?: (comment: Comment_2) => void; } declare type Issue = Endpoints["GET /repos/{owner}/{repo}/issues/{issue_number}"]["response"]["data"]; declare type ReactionContent = (typeof REACTIONS)[number]["content"]; declare const REACTIONS: readonly [{ readonly content: "THUMBS_UP"; readonly restKey: "+1"; readonly emoji: "👍"; readonly label: "Thumbs up"; }, { readonly content: "THUMBS_DOWN"; readonly restKey: "-1"; readonly emoji: "👎"; readonly label: "Thumbs down"; }, { readonly content: "LAUGH"; readonly restKey: "laugh"; readonly emoji: "😄"; readonly label: "Laugh"; }, { readonly content: "HOORAY"; readonly restKey: "hooray"; readonly emoji: "🎉"; readonly label: "Hooray"; }, { readonly content: "CONFUSED"; readonly restKey: "confused"; readonly emoji: "😕"; readonly label: "Confused"; }, { readonly content: "HEART"; readonly restKey: "heart"; readonly emoji: "❤️"; readonly label: "Heart"; }, { readonly content: "ROCKET"; readonly restKey: "rocket"; readonly emoji: "🚀"; readonly label: "Rocket"; }, { readonly content: "EYES"; readonly restKey: "eyes"; readonly emoji: "👀"; readonly label: "Eyes"; }]; declare type Reactions = Record; export { }