403Webshell
Server IP : 15.235.198.142  /  Your IP : 216.73.216.190
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ballsack 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /usr/share/nodejs/@types/codemirror/addon/hint/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/share/nodejs/@types/codemirror/addon/hint/show-hint.d.ts
import '../../';

declare module '../../' {
    /**
     * Provides a framework for showing autocompletion hints. Defines editor.showHint, which takes an optional
     * options object, and pops up a widget that allows the user to select a completion. Finding hints is done with
     * a hinting functions (the hint option), which is a function that take an editor instance and options object,
     * and return a {list, from, to} object, where list is an array of strings or objects (the completions), and
     * from and to give the start and end of the token that is being completed as {line, ch} objects. An optional
     * selectedHint property (an integer) can be added to the completion object to control the initially selected hint.
     */
    function showHint(cm: Editor, hinter?: HintFunction, options?: ShowHintOptions): void;

    function on<T extends keyof CompletionEventMap>(hints: Hints, eventName: T, handler: CompletionEventMap[T]): void;
    function off<T extends keyof CompletionEventMap>(hints: Hints, eventName: T, handler: CompletionEventMap[T]): void;
    function signal<T extends keyof CompletionEventMap>(hints: Hints, eventName: T, ...args: Parameters<CompletionEventMap[T]>): void;

    interface CompletionEventMap {
        shown: () => void;
        select: (completion: Hint | string, element: Element) => void;
        pick: (completion: Hint | string) => void;
        close: () => void;
    }

    interface Hints {
        from: Position;
        to: Position;
        list: Array<Hint | string>;
    }

    /**
     * Interface used by showHint.js Codemirror add-on
     * When completions aren't simple strings, they should be objects with the following properties:
     */
    interface Hint {
        text: string;
        className?: string | undefined;
        displayText?: string | undefined;
        from?: Position | undefined;
        /** Called if a completion is picked. If provided *you* are responsible for applying the completion */
        hint?: ((cm: Editor, data: Hints, cur: Hint) => void) | undefined;
        render?: ((element: HTMLLIElement, data: Hints, cur: Hint) => void) | undefined;
        to?: Position | undefined;
    }

    interface EditorEventMap {
        startCompletion: (instance: Editor) => void;
        endCompletion: (instance: Editor) => void;
    }

    interface Editor {
        showHint(options?: ShowHintOptions): void;
        closeHint(): void;
    }

    interface CommandActions {
        /* An extension of the existing CodeMirror typings for the autocomplete command */
        autocomplete: typeof showHint;
    }

    interface HintFunction {
        (cm: Editor, options: ShowHintOptions): Hints | null | undefined | PromiseLike<Hints | null | undefined>;
    }

    interface AsyncHintFunction {
        (cm: Editor, callback: (hints: Hints | null | undefined) => void, options: ShowHintOptions): void;
        async: true;
    }

    interface HintFunctionResolver {
        resolve(cm: Editor, post: Position): HintFunction | AsyncHintFunction;
    }

    interface ShowHintOptions {
        completeSingle?: boolean | undefined;
        hint?: HintFunction | AsyncHintFunction | HintFunctionResolver | undefined;
        alignWithWord?: boolean | undefined;
        closeCharacters?: RegExp | undefined;
        closeOnPick?: boolean | undefined;
        closeOnUnfocus?: boolean | undefined;
        updateOnCursorActivity?: boolean | undefined;
        completeOnSingleClick?: boolean | undefined;
        container?: HTMLElement | null | undefined;
        customKeys?: { [key: string]: ((editor: Editor, handle: CompletionHandle) => void) | string } | null | undefined;
        extraKeys?: { [key: string]: ((editor: Editor, handle: CompletionHandle) => void) | string } | null | undefined;
        scrollMargin?: number | undefined;
        paddingForScrollbar?: boolean | undefined;
        moveOnOverlap?: boolean | undefined;
        words?: ReadonlyArray<string> | undefined; // used by fromList
    }

    /** The Handle used to interact with the autocomplete dialog box. */
    interface CompletionHandle {
        moveFocus(n: number, avoidWrap: boolean): void;
        setFocus(n: number): void;
        menuSize(): number;
        length: number;
        close(): void;
        pick(): void;
        data: any;
    }

    interface EditorConfiguration {
        showHint?: boolean | undefined;
        hintOptions?: ShowHintOptions | undefined;
    }

    interface HintHelpers {
        auto: HintFunctionResolver;
        fromList: HintFunction;
    }

    const hint: HintHelpers;
}

Youez - 2016 - github.com/yon3zu
LinuXploit