artalk
    Preparing search index...

    Interface Context

    Artalk Context

    interface Context {
        $root: HTMLElement;
        conf: Config;
        $t(
            key:
                | "link"
                | "client"
                | "server"
                | "open"
                | "cancel"
                | "loading"
                | "pending"
                | "username"
                | "email"
                | "confirm"
                | "days"
                | "hours"
                | "minutes"
                | "seconds"
                | "expand"
                | "ignore"
                | "emoticon"
                | "now"
                | "reply"
                | "edit"
                | "placeholder"
                | "noComment"
                | "send"
                | "signIn"
                | "signUp"
                | "save"
                | "nick"
                | "preview"
                | "uploadImage"
                | "uploadFail"
                | "commentFail"
                | "restoredMsg"
                | "onlyAdminCanReply"
                | "uploadLoginMsg"
                | "counter"
                | "sortLatest"
                | "sortOldest"
                | "sortBest"
                | "sortAuthor"
                | "openComment"
                | "closeComment"
                | "listLoadFailMsg"
                | "listRetry"
                | "loadMore"
                | "admin"
                | "voteUp"
                | "voteDown"
                | "voteFail"
                | "readMore"
                | "actionConfirm"
                | "collapse"
                | "collapsed"
                | "collapsedMsg"
                | "approved"
                | "pendingMsg"
                | "editCancel"
                | "delete"
                | "deleteConfirm"
                | "pin"
                | "unpin"
                | "adminCheck"
                | "captchaCheck"
                | "msgCenter"
                | "ctrlCenter"
                | "userProfile"
                | "noAccountPrompt"
                | "haveAccountPrompt"
                | "forgetPassword"
                | "resetPassword"
                | "changePassword"
                | "confirmPassword"
                | "passwordMismatch"
                | "verificationCode"
                | "verifySend"
                | "verifyResend"
                | "waitSeconds"
                | "emailVerified"
                | "password"
                | "nextStep"
                | "skipVerify"
                | "logoutConfirm"
                | "accountMergeNotice"
                | "accountMergeSelectOne"
                | "accountMergeConfirm"
                | "dismiss"
                | "merge"
                | "loadFail"
                | "editing"
                | "editFail"
                | "deleting"
                | "deleteFail"
                | "reqGot"
                | "reqAborted"
                | "updateMsg"
                | "currentVersion"
                | "openName",
            args?: { [key: string]: string },
        ): string;
        checkAdmin(payload: CheckerPayload): Promise<void>;
        checkCaptcha(payload: CheckerCaptchaPayload): Promise<void>;
        destroy(): void;
        editComment(commentData: CommentData, $comment: HTMLElement): void;
        editorHideLoading(): void;
        editorResetState(): void;
        editorShowLoading(): void;
        editorShowNotify(msg: string, type: NotifyLevel): void;
        fetch(params: Partial<ListFetchParams>): void;
        get<T extends keyof Services>(key: T): Services[T];
        getApi(): Api;
        getApiHandlers(): ApiHandlers;
        getCommentDataList(): CommentData[];
        getCommentList(): CommentNode[];
        getCommentNodes(): CommentNode[];
        getComments(): CommentData[];
        getConf(): Config;
        getData(): DataManager;
        getEl(): HTMLElement;
        getMarked(): Marked<string, string> | undefined;
        getUser(): UserManager;
        hideSidebar(): void;
        inject<T = undefined, K extends keyof Services = any>(
            key: K,
        ): T extends undefined ? Services[K] : T;
        listGotoFirst(): void;
        off<K extends keyof EventPayloadMap>(
            name: K,
            handler: EventHandler<EventPayloadMap[K]>,
        ): void;
        on<K extends keyof EventPayloadMap>(
            name: K,
            handler: EventHandler<EventPayloadMap[K]>,
            opts?: EventOptions,
        ): void;
        provide<
            K extends keyof Services,
            T extends
            
                    | DataManager
                    | Editor
                    | ConfigManager
                    | Api
                    | UserManager
                    | CheckerManager
                    | ApiHandlers
                    | EditorPluginManager
                    | EventManager<EventPayloadMap>
                    | List
                    | SidebarLayer
                    | LayerManager
                    | undefined = any,
            D extends readonly (keyof Services)[] = any,
        >(
            key: K,
            impl: Constructor<T, Services, D>,
            deps?: D,
            opts?: ProvideFuncOptions,
        ): void;
        reload(): void;
        replyComment(commentData: CommentData, $comment: HTMLElement): void;
        setDarkMode(darkMode: boolean | "auto"): void;
        showSidebar(payload?: SidebarShowPayload): void;
        trigger<K extends keyof EventPayloadMap>(
            name: K,
            payload?: EventPayloadMap[K],
        ): void;
        updateConf(conf: ConfigPartial): void;
        watchConf<T extends (keyof Config)[]>(
            keys: T,
            effect: (val: Pick<Config, T[number]>) => void,
        ): void;
    }

    Hierarchy (View Summary)

    Index

    Properties

    $root: HTMLElement

    The root element of Artalk

    Use getEl() instead

    conf: Config

    Get config object

    Use getConf() and updateConf() instead

    Methods

    • Translate i18n message

      Parameters

      • key:
            | "link"
            | "client"
            | "server"
            | "open"
            | "cancel"
            | "loading"
            | "pending"
            | "username"
            | "email"
            | "confirm"
            | "days"
            | "hours"
            | "minutes"
            | "seconds"
            | "expand"
            | "ignore"
            | "emoticon"
            | "now"
            | "reply"
            | "edit"
            | "placeholder"
            | "noComment"
            | "send"
            | "signIn"
            | "signUp"
            | "save"
            | "nick"
            | "preview"
            | "uploadImage"
            | "uploadFail"
            | "commentFail"
            | "restoredMsg"
            | "onlyAdminCanReply"
            | "uploadLoginMsg"
            | "counter"
            | "sortLatest"
            | "sortOldest"
            | "sortBest"
            | "sortAuthor"
            | "openComment"
            | "closeComment"
            | "listLoadFailMsg"
            | "listRetry"
            | "loadMore"
            | "admin"
            | "voteUp"
            | "voteDown"
            | "voteFail"
            | "readMore"
            | "actionConfirm"
            | "collapse"
            | "collapsed"
            | "collapsedMsg"
            | "approved"
            | "pendingMsg"
            | "editCancel"
            | "delete"
            | "deleteConfirm"
            | "pin"
            | "unpin"
            | "adminCheck"
            | "captchaCheck"
            | "msgCenter"
            | "ctrlCenter"
            | "userProfile"
            | "noAccountPrompt"
            | "haveAccountPrompt"
            | "forgetPassword"
            | "resetPassword"
            | "changePassword"
            | "confirmPassword"
            | "passwordMismatch"
            | "verificationCode"
            | "verifySend"
            | "verifyResend"
            | "waitSeconds"
            | "emailVerified"
            | "password"
            | "nextStep"
            | "skipVerify"
            | "logoutConfirm"
            | "accountMergeNotice"
            | "accountMergeSelectOne"
            | "accountMergeConfirm"
            | "dismiss"
            | "merge"
            | "loadFail"
            | "editing"
            | "editFail"
            | "deleting"
            | "deleteFail"
            | "reqGot"
            | "reqAborted"
            | "updateMsg"
            | "currentVersion"
            | "openName"
      • Optionalargs: { [key: string]: string }

      Returns string

    • Check captcha

      Parameters

      • payload: CheckerCaptchaPayload

      Returns Promise<void>

    • Watch the config

      Type Parameters

      Parameters

      • keys: T
      • effect: (val: Pick<Config, T[number]>) => void

      Returns void